本文整理汇总了Java中org.eclipse.swt.widgets.Slider.setIncrement方法的典型用法代码示例。如果您正苦于以下问题:Java Slider.setIncrement方法的具体用法?Java Slider.setIncrement怎么用?Java Slider.setIncrement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Slider
的用法示例。
在下文中一共展示了Slider.setIncrement方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FrameView
import org.eclipse.swt.widgets.Slider; //导入方法依赖的package包/类
FrameView(Composite parent) {
super(parent, SWT.NONE);
GridLayout layout = new GridLayout();
setLayout(layout);
setBackground(ColorConstants.white);
header = new Label(this, SWT.BORDER);
header.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
FontManager.setFont(header, Constants.MESSAGE_FONT_SIZE);
viewer = new FrameViewer(this);
slider = new Slider(this, SWT.HORIZONTAL | SWT.BORDER);
slider.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
slider.setMinimum(1);
slider.setMaximum(1);
slider.setIncrement(1);
slider.addSelectionListener(new SelectionAdapter() {
int sel = slider.getSelection();
@Override
public void widgetSelected(SelectionEvent e) {
if(slider.getSelection() != sel) {
model.setStep(slider.getSelection()-1);
sel = slider.getSelection();
PandionJUI.navigateToLine(model.getSourceFile(), model.getStepLine());
// slider.setToolTipText(slider.getSelection() + "/" + slider.getMaximum());
}
}
});
slider.setVisible(false);
}
示例2: createDialogArea
import org.eclipse.swt.widgets.Slider; //导入方法依赖的package包/类
/**
* Create contents of the dialog.
* @param parent
*/
@Override protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(5, false));
Label gl = new Label(container, 0);
gl.setText("Gamma correction: ");
gammaSlider = new Slider(container, SWT.HORIZONTAL);
gammaSlider.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
gammaSlider.setIncrement(1);
gammaSlider.setValues(1, 1, 100, 1, 1, 1);
gammaSlider.setSelection(50);
gammaSlider.addSelectionListener(new SelectionAdapter() {
@Override public void widgetSelected(SelectionEvent e) {
updateGammaValue();
}
});
gammaValueLabel = new Label(container, 0);
applyGammaBtn = new Button(container, SWT.PUSH);
applyGammaBtn.setText("Apply");
defaultGammaBtn = new Button(container, SWT.PUSH);
defaultGammaBtn.setText("Default");
// defaultGammaBtn.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
updateSliderValueFromGamma();
addListener();
return container;
}