当前位置: 首页>>代码示例>>Java>>正文


Java Slider.setThumb方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Slider.setThumb方法的典型用法代码示例。如果您正苦于以下问题:Java Slider.setThumb方法的具体用法?Java Slider.setThumb怎么用?Java Slider.setThumb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Slider的用法示例。


在下文中一共展示了Slider.setThumb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: TreeViewControls

import org.eclipse.swt.widgets.Slider; //导入方法依赖的package包/类
public TreeViewControls(Composite parent) {
    super(parent, SWT.NONE);
    GridLayout layout = new GridLayout(5, false);
    layout.marginWidth = layout.marginHeight = 2;
    layout.verticalSpacing = layout.horizontalSpacing = 4;
    setLayout(layout);

    Label filterLabel = new Label(this, SWT.NONE);
    filterLabel.setText("Filter by class or id:");
    filterLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));

    mFilterText = new Text(this, SWT.LEFT | SWT.SINGLE);
    mFilterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    mFilterText.addModifyListener(mFilterTextModifyListener);
    mFilterText.setText(HierarchyViewerDirector.getDirector().getFilterText());

    Label smallZoomLabel = new Label(this, SWT.NONE);
    smallZoomLabel.setText(" 20%");
    smallZoomLabel
            .setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));

    mZoomSlider = new Slider(this, SWT.HORIZONTAL);
    GridData zoomSliderGridData = new GridData(GridData.CENTER, GridData.CENTER, false, false);
    zoomSliderGridData.widthHint = 190;
    mZoomSlider.setLayoutData(zoomSliderGridData);
    mZoomSlider.setMinimum((int) (TreeViewModel.MIN_ZOOM * 10));
    mZoomSlider.setMaximum((int) (TreeViewModel.MAX_ZOOM * 10 + 1));
    mZoomSlider.setThumb(1);
    mZoomSlider.setSelection((int) Math.round(TreeViewModel.getModel().getZoom() * 10));

    mZoomSlider.addSelectionListener(mZoomSliderSelectionListener);

    Label largeZoomLabel = new Label(this, SWT.NONE);
    largeZoomLabel
            .setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, true));
    largeZoomLabel.setText("200%");

    addDisposeListener(mDisposeListener);

    TreeViewModel.getModel().addTreeChangeListener(this);
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:42,代码来源:TreeViewControls.java


注:本文中的org.eclipse.swt.widgets.Slider.setThumb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。