本文整理汇总了Java中org.eclipse.swt.widgets.Spinner.setDigits方法的典型用法代码示例。如果您正苦于以下问题:Java Spinner.setDigits方法的具体用法?Java Spinner.setDigits怎么用?Java Spinner.setDigits使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.Spinner
的用法示例。
在下文中一共展示了Spinner.setDigits方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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;
}
示例4: 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);
}
示例5: 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);
}
示例6: updateUI_PropertyDetail_Number_Float
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void updateUI_PropertyDetail_Number_Float(final TourFilterProperty filterProperty, final int fieldNo) {
final TourFilterFieldConfig fieldConfig = filterProperty.fieldConfig;
final FieldValueConverter fieldValueProvider = fieldConfig.fieldValueConverter;
final int valueDigits = fieldConfig.numDigits;
Spinner spinner;
double modelValue;
if (fieldNo == 1) {
modelValue = filterProperty.doubleValue1;
spinner = filterProperty.uiSpinner_Number1;
} else {
modelValue = filterProperty.doubleValue2;
spinner = filterProperty.uiSpinner_Number2;
}
double uiValue = modelValue;
if (fieldValueProvider != null) {
uiValue = fieldValueProvider.convert_Model_To_UI(modelValue);
}
// add spinner digits
final int spinnerValue = (int) (uiValue * Math.pow(10, valueDigits));
spinner.setSelection(spinnerValue);
spinner.setDigits(valueDigits);
spinner.setMinimum(fieldConfig.minValue);
spinner.setMaximum(fieldConfig.maxValue);
spinner.setPageIncrement(fieldConfig.pageIncrement);
}
示例7: createUI_48_SegmenterBy_MinAltitude
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private Composite createUI_48_SegmenterBy_MinAltitude(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory.fillDefaults().numColumns(5).applyTo(container);
{
// label: min alti diff
final Label label = new Label(container, SWT.NONE);
label.setText(Messages.tour_segmenter_segType_byUpDownAlti_label);
// spinner: minimum altitude
_spinnerMinAltitude = new Spinner(container, SWT.BORDER);
GridDataFactory.fillDefaults().applyTo(_spinnerMinAltitude);
_spinnerMinAltitude.setMinimum(1); // 0.1
_spinnerMinAltitude.setMaximum(10000); // 1000
_spinnerMinAltitude.setDigits(1);
_spinnerMinAltitude.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
createSegments(true);
}
});
_spinnerMinAltitude.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(final MouseEvent event) {
UI.adjustSpinnerValueOnMouseScroll(event);
onSelect_BreakTime();
}
});
// label: unit
_lblMinAltitude = new Label(container, SWT.NONE);
_lblMinAltitude.setText(net.tourbook.common.UI.UNIT_LABEL_ALTITUDE);
_lblAltitudeUpMin = createUI_DP_Info(container);
_btnSaveTourMin = createUI_DB_SaveTour(container);
}
return container;
}
示例8: createUI_20_SmoothSpeed
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_20_SmoothSpeed(final Composite parent) {
/*
* image: speed
*/
_iconSpeed = new CLabel(parent, SWT.NONE);
GridDataFactory.fillDefaults().indent(16, 0).applyTo(_iconSpeed);
_iconSpeed.setBackground(_tk.getColors().getBackground());
_iconSpeed.setImage(_imageSpeed);
/*
* label: smooth speed
*/
final Label label = _tk.createLabel(parent, Messages.TourChart_Smoothing_Label_SpeedSmoothing);
GridDataFactory.fillDefaults() //
.align(SWT.FILL, SWT.CENTER)
.applyTo(label);
label.setToolTipText(Messages.TourChart_Smoothing_Label_SpeedSmoothing_Tooltip);
/*
* spinner: tau
*/
_spinnerSpeedTau = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerSpeedTau);
_spinnerSpeedTau.setDigits(1);
_spinnerSpeedTau.setMinimum(1);
_spinnerSpeedTau.setMaximum(MAX_TAU);
_spinnerSpeedTau.addSelectionListener(_selectionListener);
_spinnerSpeedTau.addMouseWheelListener(_spinnerMouseWheelListener);
}
示例9: createUI_22_SmoothGradient
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_22_SmoothGradient(final Composite parent) {
/*
* image: gradient
*/
_iconGradient = new CLabel(parent, SWT.NONE);
GridDataFactory.fillDefaults().indent(16, 0).applyTo(_iconGradient);
_iconGradient.setBackground(_tk.getColors().getBackground());
_iconGradient.setImage(_imageGradient);
/*
* label: smooth gradient
*/
final Label label = _tk.createLabel(parent, Messages.TourChart_Smoothing_Label_GradientSmoothing, SWT.CHECK);
GridDataFactory.fillDefaults() //
.align(SWT.FILL, SWT.CENTER)
.applyTo(label);
label.setToolTipText(Messages.TourChart_Smoothing_Label_GradientSmoothing_Tooltip);
/*
* spinner: gradient tau
*/
_spinnerGradientTau = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerGradientTau);
_spinnerGradientTau.setDigits(1);
_spinnerGradientTau.setMinimum(1);
_spinnerGradientTau.setMaximum(MAX_TAU);
_spinnerGradientTau.addSelectionListener(_selectionListener);
_spinnerGradientTau.addMouseWheelListener(_spinnerMouseWheelListener);
}
示例10: 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);
}
示例11: createUI_55_Field_Weight
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
/**
* field: weight
*/
private void createUI_55_Field_Weight(final Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText(Messages.Pref_People_Label_weight);
final Composite containerWeight = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.applyTo(containerWeight);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(containerWeight);
{
// spinner: weight
_spinnerWeight = new Spinner(containerWeight, SWT.BORDER);
GridDataFactory.fillDefaults() //
.align(SWT.BEGINNING, SWT.FILL)
// .hint(_spinnerWidth, SWT.DEFAULT)
.applyTo(_spinnerWeight);
_spinnerWeight.setDigits(1);
_spinnerWeight.setMinimum(0);
_spinnerWeight.setMaximum(3000); // 300.0 kg
_spinnerWeight.addSelectionListener(_defaultSelectionListener);
_spinnerWeight.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(final MouseEvent event) {
UI.adjustSpinnerValueOnMouseScroll(event);
onModifyPerson();
}
});
// label: unit
label = new Label(containerWeight, SWT.NONE);
label.setText(UI.UNIT_WEIGHT_KG);
}
// 3rd column filler
new Label(parent, SWT.NONE);
}
示例12: createUI_56_Field_Height
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
/**
* field: height
*/
private void createUI_56_Field_Height(final Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText(Messages.Pref_People_Label_height);
final Composite containerHeight = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.applyTo(containerHeight);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(containerHeight);
{
// spinner: height
_spinnerHeight = new Spinner(containerHeight, SWT.BORDER);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.FILL)
// .hint(_spinnerWidth, SWT.DEFAULT)
.applyTo(_spinnerHeight);
_spinnerHeight.setDigits(2);
_spinnerHeight.setMinimum(0);
_spinnerHeight.setMaximum(300); // 3.00 m
_spinnerHeight.addSelectionListener(_defaultSelectionListener);
_spinnerHeight.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(final MouseEvent event) {
UI.adjustSpinnerValueOnMouseScroll(event);
onModifyPerson();
}
});
// label: unit
label = new Label(containerHeight, SWT.NONE);
label.setText(UI.UNIT_METER);
}
// filler
new Label(parent, SWT.NONE);
}
示例13: postConstruct
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void postConstruct(final NumberFormat nf, final RangeContent range) {
final int increment = range.getIncrement();
final Spinner spinner = getControl();
spinner.setDigits(nf.getMaximumFractionDigits());
spinner.setMinimum(range.getMinimum());
spinner.setMaximum(range.getMaximum());
spinner.setIncrement(increment);
spinner.setPageIncrement(increment * 10);
spinner.addMouseWheelListener(_defaultMouseWheelListener);
}
示例14: createControl
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
public void createControl(Composite parent) {
// inherit default container and name specification widgets
super.createControl(parent);
final Composite composite = (Composite)getControl();
// sample section generation group
final Group group = new Group(composite,SWT.NONE);
group.setLayout(new GridLayout(2,false));
group.setText("Traceability algorithm parameter(LSA)");
group.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
Label nameLabel = new Label(group, SWT.NONE);
nameLabel.setText("Dimensions:");
dimensions = new Spinner(group, SWT.BORDER); // use desired style
dimensions.setMinimum(50);
dimensions.setMaximum(300);
dimensions.setSelection(DIMENSIONS);
dimensions.setIncrement(1);
dimensions.setPageIncrement(10);
GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
dimensions.setLayoutData(gridData);
Label thresholdLabel = new Label(group, SWT.NONE);
thresholdLabel.setText("Threshold:");
gridData = new GridData();
gridData.verticalAlignment = SWT.TOP;
thresholdLabel.setLayoutData(gridData);
threshold = new Spinner(group, SWT.NONE);
// allow 3 decimal places
threshold.setDigits(3);
// set the minimum value to 0.001
threshold.setMinimum(1);
// set the maximum value to 20
threshold.setMaximum(1000);
// set the increment value to 0.010
threshold.setIncrement(10);
// set the seletion to 3.456
threshold.setSelection(THRESHOLD);
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
threshold.setLayoutData(gridData);
}
开发者ID:germanattanasio,项目名称:traceability-assistant-eclipse-plugins,代码行数:50,代码来源:TraceCreationPage.java
示例15: createUI_580_IL_LastMarker
import org.eclipse.swt.widgets.Spinner; //导入方法依赖的package包/类
private void createUI_580_IL_LastMarker(final Composite parent) {
{
/*
* Checkbox: Last marker
*/
_chkIL_SetLastMarker = new Button(parent, SWT.CHECK);
_chkIL_SetLastMarker.setText(Messages.Dialog_ImportConfig_Checkbox_LastMarker);
_chkIL_SetLastMarker.setToolTipText(Messages.Dialog_ImportConfig_Checkbox_LastMarker_Tooltip);
_chkIL_SetLastMarker.addSelectionListener(_defaultModify_Listener);
GridDataFactory
.fillDefaults()//
.span(2, 1)
.indent(0, 5)
.applyTo(_chkIL_SetLastMarker);
}
{
/*
* Last marker distance
*/
// label
_lblIL_LastMarker = new Label(parent, SWT.NONE);
_lblIL_LastMarker.setText(Messages.Dialog_ImportConfig_Label_LastMarkerDistance);
_lblIL_LastMarker.setToolTipText(Messages.Dialog_ImportConfig_Label_LastMarkerDistance_Tooltip);
GridDataFactory
.fillDefaults()//
.align(SWT.FILL, SWT.CENTER)
.indent(_leftPadding, 0)
.applyTo(_lblIL_LastMarker);
final Composite container = new Composite(parent, SWT.NONE);
// GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
{
// spinner: distance 1.1 km
_spinnerIL_LastMarkerDistance = new Spinner(container, SWT.BORDER);
_spinnerIL_LastMarkerDistance.setMaximum(EasyConfig.LAST_MARKER_DISTANCE_MAX / 100);
_spinnerIL_LastMarkerDistance.setMinimum(EasyConfig.LAST_MARKER_DISTANCE_MIN);
_spinnerIL_LastMarkerDistance.setDigits(1);
_spinnerIL_LastMarkerDistance.addMouseWheelListener(_defaultModify_MouseWheelListener);
_spinnerIL_LastMarkerDistance.addSelectionListener(_defaultModify_Listener);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(_spinnerIL_LastMarkerDistance);
// label: unit
_lblIL_LastMarkerDistanceUnit = new Label(container, SWT.NONE);
_lblIL_LastMarkerDistanceUnit.setText(UI.UNIT_LABEL_DISTANCE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(_lblIL_LastMarkerDistanceUnit);
}
}
{
/*
* Marker text
*/
// label
_lblIL_LastMarkerText = new Label(parent, SWT.NONE);
_lblIL_LastMarkerText.setText(Messages.Dialog_ImportConfig_Label_LastMarkerText);
GridDataFactory
.fillDefaults()//
.align(SWT.FILL, SWT.CENTER)
.indent(_leftPadding, 0)
.applyTo(_lblIL_LastMarkerText);
// text
_txtIL_LastMarker = new Text(parent, SWT.BORDER);
GridDataFactory
.fillDefaults()//
.grab(true, false)
.applyTo(_txtIL_LastMarker);
}
}