本文整理汇总了Java中org.eclipse.swt.widgets.Spinner.setMaximum方法的典型用法代码示例。如果您正苦于以下问题:Java Spinner.setMaximum方法的具体用法?Java Spinner.setMaximum怎么用?Java Spinner.setMaximum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Spinner
的用法示例。
在下文中一共展示了Spinner.setMaximum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogArea
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
Label labelDescription = new Label(composite, SWT.WRAP);
labelDescription.setText("Limit chars logs");
final Spinner spinnerBox = new Spinner(composite, SWT.WRAP);
spinnerBox.setMaximum(MAX_LOG_CHARS);
spinnerBox.setMinimum(MIN_LOG_CHARS);
spinnerBox.setSelection(limitLogsChars);
spinnerBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
spinnerBox.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
limitLogsChars = Integer.parseInt(spinnerBox.getText());
}
});
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
composite.setLayout(new GridLayout(2, false));
return composite;
}
示例2: createControl
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
@Override
protected Control createControl(Composite parent) {
spinner = new Spinner(parent, style);
spinner.setBackground(parent.getBackground());
spinner.setMinimum(minimum);
spinner.setMaximum(maximum);
spinner.setSelection(selection);
spinner.setIncrement(increment);
if (selectionListeners != null) {
for (SelectionListener l : selectionListeners) {
spinner.addSelectionListener(l);
}
}
return spinner;
}
示例3: createUI_Margin
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private Spinner createUI_Margin(final Composite parent) {
final Spinner spinner = new Spinner(parent, SWT.BORDER);
spinner.setMinimum(CalendarProfileManager.DEFAULT_MARGIN_MIN);
spinner.setMaximum(CalendarProfileManager.DEFAULT_MARGIN_MAX);
spinner.addSelectionListener(_defaultSelectionListener);
spinner.addMouseWheelListener(_defaultMouseWheelListener);
// ensure that the -- sign is displayed
GridDataFactory
.fillDefaults()
.hint(_pc.convertWidthInCharsToPixels(3), SWT.DEFAULT)
.applyTo(spinner);
return spinner;
}
示例4: createSpinner
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
/**
* @param parent
* @param min
* @param max
* @param hspan
* @param style
* @return
*/
public static Spinner createSpinner(Composite parent, int min, int max, int hspan, int style)
{
Spinner spinner = new Spinner(parent, SWT.BORDER | style);
spinner.setMinimum(min);
spinner.setMaximum(max);
GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false, hspan, 1);
PixelConverter pc = new PixelConverter(spinner);
// See http://jira.appcelerator.org/browse/APSTUD-3215
// We need to add some extra spacing to the MacOSX spinner in order to adjust the size to the way Mac draws
// spinners.
int extraWidth = Platform.OS_MACOSX.equals(Platform.getOS()) ? 25 : 0;
gd.widthHint = pc.convertWidthInCharsToPixels(2) + extraWidth;
spinner.setLayoutData(gd);
return spinner;
}
示例5: createUI_Spinner_ColorOpacity
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private Spinner createUI_Spinner_ColorOpacity(final Composite parent) {
final Spinner spinnerOpacity = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults() //
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(spinnerOpacity);
spinnerOpacity.setMinimum(Map3GradientColorManager.OPACITY_MIN);
spinnerOpacity.setMaximum(Map3GradientColorManager.OPACITY_MAX);
spinnerOpacity.setDigits(Map3GradientColorManager.OPACITY_DIGITS);
spinnerOpacity.setIncrement(1);
spinnerOpacity.setPageIncrement(10);
spinnerOpacity.addSelectionListener(_defaultSelectionListener);
spinnerOpacity.addMouseWheelListener(_defaultMouseWheelListener);
return spinnerOpacity;
}
示例6: createCommun_trigger
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
/**
* This method initializes commun_trigger
*
*/
private void createCommun_trigger() {
commun_trigger = new Composite(this, SWT.NONE);
GridData gridData1 = new GridData();
gridData1.verticalAlignment = GridData.CENTER;
gridData1.horizontalAlignment = GridData.FILL;
gridData1.grabExcessHorizontalSpace = true;
commun_trigger.setLayoutData(gridData1);
GridLayout gridLayout = new GridLayout();
gridLayout.makeColumnsEqualWidth = false;
gridLayout.numColumns = 2;
commun_trigger.setLayout(gridLayout);
type_trigger_label = new Label(commun_trigger, SWT.NONE);
type_trigger_label.setText("Type of synchronizer");
createType_trigger_combo();
timeout_label = new Label(commun_trigger, SWT.NONE);
timeout_label.setText("Timeout (ms)");
timeout_spin = new Spinner(commun_trigger, SWT.BORDER);
timeout_spin.setMinimum(0);
timeout_spin.setMaximum(Integer.MAX_VALUE);
timeout_spin.setSelection((int) trigger.getTimeout());
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.verticalAlignment = GridData.CENTER;
gridData.grabExcessHorizontalSpace = true;
timeout_spin.setLayoutData(gridData);
}
示例7: fillSynthPolyphonySpinner
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
protected void fillSynthPolyphonySpinner( Spinner spinner ){
int value = getIntegerValue( MidiSettings.SYNTH_POLYPHONY );
int[] range = getSynth().getIntegerPropertyRange( MidiSettings.SYNTH_POLYPHONY );
if( range.length == 2 && range[0] < range[1] ){
spinner.setMinimum( range[0] );
spinner.setMaximum( range[1] );
spinner.setIncrement(1);
spinner.setPageIncrement(1);
if( value >= range[0] && value <= range[1] ){
spinner.setSelection( value );
}
}
}
示例8: makeSpinner
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private Spinner makeSpinner(Composite parent,String label,int value, int min, int max){
this.newLabel(parent,label);
Spinner spinner = new Spinner(parent,SWT.BORDER);
spinner.setMinimum(min);
spinner.setMaximum(max);
spinner.setSelection(value);
spinner.setLayoutData(getGridData());
return spinner;
}
示例9: initScaleGroup
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void initScaleGroup(final Composite parent) {
final GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
final Group scaleGroup = new Group(parent, SWT.NONE);
scaleGroup.setLayoutData(gridData);
scaleGroup.setText(ResourceString.getResourceString("label.page.scale.printing"));
final GridLayout scaleGroupLayout = new GridLayout();
scaleGroupLayout.marginWidth = 20;
scaleGroupLayout.horizontalSpacing = 20;
scaleGroupLayout.numColumns = 3;
scaleGroup.setLayout(scaleGroupLayout);
Label label = new Label(scaleGroup, SWT.NONE);
label.setText(ResourceString.getResourceString("label.page.scale"));
scaleSpinner = new Spinner(scaleGroup, SWT.BORDER);
scaleSpinner.setIncrement(5);
scaleSpinner.setMinimum(10);
scaleSpinner.setMaximum(400);
scaleSpinner.setSelection(100);
label = new Label(scaleGroup, SWT.NONE);
label.setText("%");
}
示例10: setMarginSpinner
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void setMarginSpinner(final Spinner spinner) {
spinner.setDigits(1);
spinner.setIncrement(5);
spinner.setMinimum(0);
spinner.setMaximum(1000);
spinner.setSelection(20);
}
示例11: createSpinner
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private Spinner createSpinner(Composite parent, String label, boolean isFloat, String propertyName) {
Label l = new Label(parent, SWT.LEFT);
l.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
l.setText(label);
Spinner sp = new Spinner(parent, SWT.BORDER);
sp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
if (propertyName!=null && !propertyName.isEmpty())
sp.setData("propertyName", propertyName);
// set the minimum value to 0.1
sp.setMinimum(0);
// set the maximum value to 20
sp.setMaximum((int) 1e6);
if (isFloat) {
// allow 3 decimal places
sp.setDigits(FLOAT_DIGITS);
sp.setIncrement(FLOAT_MULTIPLICATOR);
// sp.setSelection(FLOAT_MULTIPLICATOR);
} else {
sp.setIncrement(0);
sp.setIncrement(1);
// sp.setSelection(1);
}
sp.setSelection(0);
sp.pack();
return sp;
}
示例12: initScaleGroup
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void initScaleGroup(Composite parent) {
GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.horizontalAlignment = GridData.FILL;
Group scaleGroup = new Group(parent, SWT.NONE);
scaleGroup.setLayoutData(gridData);
scaleGroup.setText(ResourceString
.getResourceString("label.page.scale.printing"));
GridLayout scaleGroupLayout = new GridLayout();
scaleGroupLayout.marginWidth = 20;
scaleGroupLayout.horizontalSpacing = 20;
scaleGroupLayout.numColumns = 3;
scaleGroup.setLayout(scaleGroupLayout);
Label label = new Label(scaleGroup, SWT.NONE);
label.setText(ResourceString.getResourceString("label.page.scale"));
scaleSpinner = new Spinner(scaleGroup, SWT.BORDER);
scaleSpinner.setIncrement(5);
scaleSpinner.setMinimum(10);
scaleSpinner.setMaximum(400);
scaleSpinner.setSelection(100);
label = new Label(scaleGroup, SWT.NONE);
label.setText("%");
}
示例13: setMarginSpinner
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void setMarginSpinner(Spinner spinner) {
spinner.setDigits(1);
spinner.setIncrement(5);
spinner.setMinimum(0);
spinner.setMaximum(1000);
spinner.setSelection(20);
}
示例14: createUI_24_SmoothPulse
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_24_SmoothPulse(final Composite parent) {
/*
* image: pulse
*/
_iconPulse = new CLabel(parent, SWT.NONE);
GridDataFactory.fillDefaults().indent(16, 0).applyTo(_iconPulse);
_iconPulse.setBackground(_tk.getColors().getBackground());
_iconPulse.setImage(_imagePulse);
/*
* checkbox: smooth speed
*/
_chkIsPulseSmoothing = _tk.createButton(
parent,
Messages.TourChart_Smoothing_Checkbox_IsPulseSmoothing,
SWT.CHECK);
GridDataFactory.fillDefaults() //
.align(SWT.FILL, SWT.CENTER)
.applyTo(_chkIsPulseSmoothing);
_chkIsPulseSmoothing.addSelectionListener(_selectionListener);
_chkIsPulseSmoothing.setToolTipText(Messages.TourChart_Smoothing_Checkbox_IsPulseSmoothing_Tooltip);
/*
* spinner: speed tau
*/
_spinnerPulseTau = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerPulseTau);
_spinnerPulseTau.setDigits(1);
_spinnerPulseTau.setMinimum(1);
_spinnerPulseTau.setMaximum(MAX_TAU);
_spinnerPulseTau.addSelectionListener(_selectionListener);
_spinnerPulseTau.addMouseWheelListener(_spinnerMouseWheelListener);
}
示例15: setupDirection
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private Spinner setupDirection(Composite parent) {
Spinner result = new Spinner(parent, SWT.NONE);
result.setMinimum(-180);
result.setMaximum(180);
result.setIncrement(1);
result.setPageIncrement(10);
return result;
}