本文整理汇总了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);
}