本文整理匯總了Java中org.eclipse.swt.widgets.Spinner.addMouseWheelListener方法的典型用法代碼示例。如果您正苦於以下問題:Java Spinner.addMouseWheelListener方法的具體用法?Java Spinner.addMouseWheelListener怎麽用?Java Spinner.addMouseWheelListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Spinner
的用法示例。
在下文中一共展示了Spinner.addMouseWheelListener方法的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: createUI_10_LatLonDigits
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_10_LatLonDigits(final Composite parent) {
final SelectionListener _selectionAdapterLatLonDigits = new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
onSelect_LatLonDigits();
}
};
/*
* Lat/lon digits
*/
{
// label: lat/lon digits
_lblLatLonDigits = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.FILL, SWT.CENTER)
.applyTo(_lblLatLonDigits);
_lblLatLonDigits.setText(Messages.Slideout_TourEditor_Label_LatLonDigits);
_lblLatLonDigits.setToolTipText(Messages.Slideout_TourEditor_Label_LatLonDigits_Tooltip);
// spinner
_spinnerLatLonDigits = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults() //
.align(SWT.END, SWT.CENTER)
.applyTo(_spinnerLatLonDigits);
_spinnerLatLonDigits.setMinimum(0);
_spinnerLatLonDigits.setMaximum(20);
_spinnerLatLonDigits.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(final MouseEvent event) {
UI.adjustSpinnerValueOnMouseScroll(event);
onSelect_LatLonDigits();
}
});
_spinnerLatLonDigits.addSelectionListener(_selectionAdapterLatLonDigits);
}
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}
示例6: createUI_52_BreakByAvgSpeed
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private Composite createUI_52_BreakByAvgSpeed(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory.fillDefaults().numColumns(3).applyTo(container);
// container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
{
/*
* minimum average speed
*/
// label: minimum speed
Label label = new Label(container, SWT.NONE);
label.setText(Messages.Compute_BreakTime_Label_MinimumAvgSpeed);
_firstColBreakTime.add(label);
// spinner: minimum speed
_spinnerBreakMinAvgSpeed = new Spinner(container, SWT.BORDER);
GridDataFactory
.fillDefaults()//
.applyTo(_spinnerBreakMinAvgSpeed);
_spinnerBreakMinAvgSpeed.setMinimum(0); // 0.0 km/h
_spinnerBreakMinAvgSpeed.setMaximum(BREAK_MAX_SPEED_KM_H); // 10.0 km/h
_spinnerBreakMinAvgSpeed.setDigits(1);
_spinnerBreakMinAvgSpeed.addSelectionListener(_selectionListener);
_spinnerBreakMinAvgSpeed.addMouseWheelListener(_spinnerMouseWheelListener);
// label: km/h
label = new Label(container, SWT.NONE);
label.setText(net.tourbook.common.UI.UNIT_LABEL_SPEED);
/*
* label: description
*/
label = new Label(container, SWT.WRAP);
GridDataFactory
.fillDefaults()//
.span(3, 1)
.indent(0, DEFAULT_V_DISTANCE_PARAGRAPH)
.hint(DEFAULT_DESCRIPTION_WIDTH, SWT.DEFAULT)
.grab(true, false)
.applyTo(label);
label.setText(Messages.Compute_BreakTime_Label_Description_ComputeByAvgSpeed);
}
return container;
}
示例7: createUI_110_DirectionArrow
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_110_DirectionArrow(final Composite parent) {
/*
* Direction Arrow
*/
{
/*
* Label
*/
final Label label = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(label);
label.setText(Messages.TourTrack_Properties_Label_DirectionArrow);
label.setToolTipText(Messages.TourTrack_Properties_Label_DirectionArrow_Tooltip);
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
{
/*
* Size
*/
_spinnerDirectionArrowSize = new Spinner(container, SWT.BORDER);
GridDataFactory.fillDefaults() //
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerDirectionArrowSize);
_spinnerDirectionArrowSize.setMinimum(TourTrackConfigManager.DIRECTION_ARROW_SIZE_MIN);
_spinnerDirectionArrowSize.setMaximum(TourTrackConfigManager.DIRECTION_ARROW_SIZE_MAX);
_spinnerDirectionArrowSize.setIncrement(10);
_spinnerDirectionArrowSize.setPageIncrement(50);
_spinnerDirectionArrowSize.addSelectionListener(_defaultSelectionListener);
_spinnerDirectionArrowSize.addMouseWheelListener(_defaultMouseWheelListener);
/*
* Vertical distance
*/
_spinnerDirectionArrowDistance = new Spinner(container, SWT.BORDER);
GridDataFactory.fillDefaults() //
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerDirectionArrowDistance);
_spinnerDirectionArrowDistance.setMinimum(TourTrackConfigManager.DIRECTION_ARROW_VERTICAL_DISTANCE_MIN);
_spinnerDirectionArrowDistance.setMaximum(TourTrackConfigManager.DIRECTION_ARROW_VERTICAL_DISTANCE_MAX);
_spinnerDirectionArrowDistance.setIncrement(1);
_spinnerDirectionArrowDistance.setPageIncrement(5);
_spinnerDirectionArrowDistance.addSelectionListener(_defaultSelectionListener);
_spinnerDirectionArrowDistance.addMouseWheelListener(_defaultMouseWheelListener);
}
}
}
示例8: createUI_20_AdjustImportYear
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_20_AdjustImportYear(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
group.setText(Messages.PrefPage_HAC45_Group);
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(group);
{
// checkbox: adjust import year
{
_chkAdjustImportYear = new Button(group, SWT.CHECK);
GridDataFactory.fillDefaults().span(2, 1).applyTo(_chkAdjustImportYear);
_chkAdjustImportYear.setText(Messages.PrefPage_HAC45_Checkbox_AdjustImportYear);
_chkAdjustImportYear.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
enableControls();
}
});
}
// label: import year
{
_lblImportYear = new Label(group, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.CENTER)
.indent(_pc.convertHorizontalDLUsToPixels(12), 0)
.applyTo(_lblImportYear);
_lblImportYear.setText(Messages.PrefPage_HAC45_Label_ImportYear);
}
// spinner: import year
{
_spinnerImportYear = new Spinner(group, SWT.BORDER);
GridDataFactory.fillDefaults() //
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerImportYear);
_spinnerImportYear.setPageIncrement(10);
_spinnerImportYear.setMaximum(3000);
_spinnerImportYear.setMinimum(1800);
_spinnerImportYear.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(final MouseEvent event) {
Util.adjustSpinnerValueOnMouseScroll(event);
}
});
}
}
}
示例9: createUI_50_IgnoreLastMarker
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private Composite createUI_50_IgnoreLastMarker(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory
.fillDefaults()//
.numColumns(3)
.extendedMargins(5, 5, 15, 5)
.spacing(20, 5)
.applyTo(container);
{
/*
* Marker
*/
// checkbox: ignore last marker
{
_chkIgnoreLastMarker = new Button(container, SWT.CHECK);
GridDataFactory.fillDefaults().span(3, 1).applyTo(_chkIgnoreLastMarker);
_chkIgnoreLastMarker.setText(Messages.PrefPage_Fit_Checkbox_IgnoreLastMarker);
_chkIgnoreLastMarker.addSelectionListener(_defaultSelectionListener);
}
// label: info
{
_lblIgnorLastMarker_Info = createUI_InfoLabel(container, 3);
_lblIgnorLastMarker_Info.setText(Messages.PrefPage_Fit_Label_IgnoreLastMarker_Info);
}
// label: ignore time slices
{
_lblIgnorLastMarker_TimeSlices = new Label(container, SWT.NONE);
_lblIgnorLastMarker_TimeSlices.setText(Messages.PrefPage_Fit_Label_IgnoreLastMarker_TimeSlices);
}
// spinner
{
_spinnerIgnorLastMarker_TimeSlices = new Spinner(container, SWT.BORDER);
GridDataFactory
.fillDefaults() //
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_spinnerIgnorLastMarker_TimeSlices);
_spinnerIgnorLastMarker_TimeSlices.setMinimum(0);
_spinnerIgnorLastMarker_TimeSlices.setMaximum(1000);
_spinnerIgnorLastMarker_TimeSlices.setPageIncrement(10);
_spinnerIgnorLastMarker_TimeSlices.addMouseWheelListener(new MouseWheelListener() {
@Override
public void mouseScrolled(final MouseEvent event) {
Util.adjustSpinnerValueOnMouseScroll(event);
}
});
}
}
return container;
}
示例10: 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);
}
}
示例11: createUI_10_Toolbar
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_10_Toolbar(final Composite parent) {
_toolbar = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.grab(true, false)
.align(SWT.BEGINNING, SWT.FILL)
.applyTo(_toolbar);
GridLayoutFactory.fillDefaults()//
.numColumns(6)
.margins(3, 3)
.applyTo(_toolbar);
// container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
{
/*
* label: hr min
*/
_lblHrMin = new Label(_toolbar, SWT.NONE);
GridDataFactory.fillDefaults()//
// .indent(5, 0)
.align(SWT.BEGINNING, SWT.CENTER)
.applyTo(_lblHrMin);
_lblHrMin.setText(Messages.Training_View_Label_LeftChartBorder);
_lblHrMin.setToolTipText(Messages.Training_View_Label_LeftChartBorder_Tooltip);
/*
* spinner: hr min
*/
_spinnerHrLeft = new Spinner(_toolbar, SWT.BORDER);
_spinnerHrLeft.setMinimum(HR_LEFT_MIN_BORDER);
_spinnerHrLeft.setMaximum(HR_RIGHT_MAX_BORDER);
_spinnerHrLeft.addModifyListener(_defaultSpinnerModifyListener);
_spinnerHrLeft.addSelectionListener(_defaultSpinnerSelectionListener);
_spinnerHrLeft.addMouseWheelListener(_defaultSpinnerMouseWheelListener);
/*
* label: hr max
*/
_lblHrMax = new Label(_toolbar, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.CENTER)
.applyTo(_lblHrMax);
_lblHrMax.setText(Messages.Training_View_Label_RightChartBorder);
_lblHrMax.setToolTipText(Messages.Training_View_Label_RightChartBorder_Tooltip);
/*
* spinner: hr max
*/
_spinnerHrRight = new Spinner(_toolbar, SWT.BORDER);
_spinnerHrRight.setMinimum(HR_LEFT_MIN_BORDER);
_spinnerHrRight.setMaximum(HR_RIGHT_MAX_BORDER);
_spinnerHrRight.addModifyListener(_defaultSpinnerModifyListener);
_spinnerHrRight.addSelectionListener(_defaultSpinnerSelectionListener);
_spinnerHrRight.addMouseWheelListener(_defaultSpinnerMouseWheelListener);
/*
* toolbar actions
*/
final ToolBar toolbar = new ToolBar(_toolbar, SWT.FLAT);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.CENTER)
.applyTo(toolbar);
_headerToolbarManager = new ToolBarManager(toolbar);
}
// // label: horizontal separator
// final Label label = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
// GridDataFactory.fillDefaults()//
// .grab(true, false)
// .hint(SWT.DEFAULT, 1)
// .applyTo(label);
// label.setText(UI.EMPTY_STRING);
}
示例12: createUI_20_Options
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_20_Options(final Composite parent) {
{
/*
* Checkbox: Show segment line
*/
_chkShowSegmentLine = new Button(parent, SWT.CHECK);
GridDataFactory.fillDefaults()//
.span(2, 1)
.applyTo(_chkShowSegmentLine);
_chkShowSegmentLine.setText(Messages.Slideout_SegmenterChartOptions_Checkbox_IsShowSegmentLine);
_chkShowSegmentLine.addSelectionListener(_defaultSelectionAdapter);
}
{
/*
* Line opacity
*/
// Label
_lblLineOpacity = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.FILL, SWT.CENTER)
.applyTo(_lblLineOpacity);
_lblLineOpacity.setText(Messages.Slideout_SegmenterChartOptions_Label_LineOpacity);
_lblLineOpacity.setToolTipText(Messages.Slideout_SegmenterChartOptions_Label_Opacity_Tooltip);
// Spinner:
_spinLineOpacity = new Spinner(parent, SWT.BORDER);
_spinLineOpacity.setMinimum(0);
_spinLineOpacity.setMaximum(100);
_spinLineOpacity.setPageIncrement(10);
_spinLineOpacity.addSelectionListener(_defaultSelectionAdapter);
_spinLineOpacity.addMouseWheelListener(_defaultMouseWheelListener);
}
{
/*
* Checkbox: Show segment marker
*/
_chkShowSegmentMarker = new Button(parent, SWT.CHECK);
GridDataFactory.fillDefaults()//
.span(2, 1)
.applyTo(_chkShowSegmentMarker);
_chkShowSegmentMarker.setText(Messages.Slideout_SegmenterChartOptions_Checkbox_IsShowSegmentMarker);
_chkShowSegmentMarker.addSelectionListener(_defaultSelectionAdapter);
}
{
/*
* Graph opacity
*/
// Label
_lblGraphOpacity = new Label(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.align(SWT.FILL, SWT.CENTER)
.applyTo(_lblGraphOpacity);
_lblGraphOpacity.setText(Messages.Slideout_SegmenterChartOptions_Label_GraphOpacity);
_lblGraphOpacity.setToolTipText(Messages.Slideout_SegmenterChartOptions_Label_Opacity_Tooltip);
// Spinner:
_spinGraphOpacity = new Spinner(parent, SWT.BORDER);
_spinGraphOpacity.setMinimum(0);
_spinGraphOpacity.setMaximum(100);
_spinGraphOpacity.setPageIncrement(10);
_spinGraphOpacity.addSelectionListener(_defaultSelectionAdapter);
_spinGraphOpacity.addMouseWheelListener(_defaultMouseWheelListener);
}
{
/*
* Checkbox: Show segment tooltip
*/
_chkShowSegmentTooltip = new Button(parent, SWT.CHECK);
GridDataFactory.fillDefaults()//
.span(2, 1)
.applyTo(_chkShowSegmentTooltip);
_chkShowSegmentTooltip.setText(Messages.Slideout_SegmenterChartOptions_Checkbox_IsShowSegmentTooltip);
_chkShowSegmentTooltip.addSelectionListener(_defaultSelectionAdapter);
}
}
示例13: createUI_20_TourCache
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_20_TourCache(final Composite parent) {
final int verticalIndent = 20;
final Group group = new Group(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
group.setText(Messages.Pref_Tour_Group_TourCache);
GridLayoutFactory.swtDefaults().numColumns(2).applyTo(group);
{
/*
* label: info
*/
Label label = new Label(group, SWT.WRAP);
GridDataFactory.fillDefaults()//
.hint(_defaultInfoWidth, SWT.DEFAULT)
.grab(true, false)
.span(2, 1)
.applyTo(label);
label.setText(Messages.Pref_Tour_Label_TourCacheSize_Info);
/*
* label: cache size
*/
label = new Label(group, NONE);
GridDataFactory.fillDefaults()//
.indent(0, verticalIndent)
.align(SWT.BEGINNING, SWT.CENTER)
.applyTo(label);
label.setText(Messages.Pref_Tour_Label_TourCacheSize);
// spinner: cache size
_spinnerTourCacheSize = new Spinner(group, SWT.BORDER);
GridDataFactory.fillDefaults()//
.indent(0, verticalIndent)
.hint(_defaultSpinnerWidth, SWT.DEFAULT)
.align(SWT.BEGINNING, SWT.CENTER)
.applyTo(_spinnerTourCacheSize);
_spinnerTourCacheSize.setMinimum(0);
_spinnerTourCacheSize.setMaximum(100000);
_spinnerTourCacheSize.addMouseWheelListener(_defaultMouseWheelListener);
}
}
示例14: createUI_50_Border
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_50_Border(final Composite parent) {
/*
* Checkbox: paint with border
*/
{
_chkPaintWithBorder = new Button(parent, SWT.CHECK);
GridDataFactory.fillDefaults()//
.grab(true, false)
.span(2, 1)
.applyTo(_chkPaintWithBorder);
_chkPaintWithBorder.setText(Messages.pref_map_layout_PaintBorder);
_chkPaintWithBorder.addSelectionListener(_defaultSelectionListener);
}
/*
* border width
*/
{
// label: border width
_lblBorderWidth = new Label(parent, NONE);
GridDataFactory.fillDefaults()//
.indent(_firstColumnIndent, 0)
.applyTo(_lblBorderWidth);
_lblBorderWidth.setText(Messages.pref_map_layout_BorderWidth);
// spinner: border width
_spinnerBorderWidth = new Spinner(parent, SWT.BORDER);
_spinnerBorderWidth.setMinimum(1);
_spinnerBorderWidth.setMaximum(30);
_spinnerBorderWidth.addSelectionListener(_defaultSelectionListener);
_spinnerBorderWidth.addMouseWheelListener(_defaultMouseWheelListener);
}
/*
* Border color
*/
{
// label
_lblBorderColor = new Label(parent, NONE);
GridDataFactory.fillDefaults()//
.indent(_firstColumnIndent, 0)
.align(SWT.FILL, SWT.BEGINNING)
.applyTo(_lblBorderColor);
_lblBorderColor.setText(Messages.Pref_MapLayout_Label_BorderColor);
final Composite containerBorderColor = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.grab(true, false)
.applyTo(containerBorderColor);
GridLayoutFactory.fillDefaults().numColumns(2).applyTo(containerBorderColor);
{
// Radio: darker
_rdoBorderColorDarker = new Button(containerBorderColor, SWT.RADIO);
_rdoBorderColorDarker.setText(Messages.Pref_MapLayout_Checkbox_BorderColor_Darker);
_rdoBorderColorDarker.addSelectionListener(_defaultSelectionListener);
// spinner: border width
_spinnerBorderColorDarker = new Spinner(containerBorderColor, SWT.BORDER);
_spinnerBorderColorDarker.setMinimum(0);
_spinnerBorderColorDarker.setMaximum(100);
_spinnerBorderColorDarker.setPageIncrement(10);
_spinnerBorderColorDarker.addSelectionListener(_defaultSelectionListener);
_spinnerBorderColorDarker.addMouseWheelListener(_defaultMouseWheelListener);
// Radio: color
_rdoBorderColorColor = new Button(containerBorderColor, SWT.RADIO);
_rdoBorderColorColor.setText(Messages.Pref_MapLayout_Checkbox_BorderColor_Color);
_rdoBorderColorColor.addSelectionListener(_defaultSelectionListener);
// border color
_colorBorderColor = new ColorSelector(containerBorderColor);
_colorBorderColor.addListener(_defaultChangePropertyListener);
}
}
}
示例15: createUI_30_Iterations
import org.eclipse.swt.widgets.Spinner; //導入方法依賴的package包/類
private void createUI_30_Iterations(final Composite parent) {
/*
* sync smoothing
*/
{
_chkIsSynchSmoothing = _tk.createButton(
parent,
Messages.TourChart_Smoothing_Checkbox_IsSyncSmoothing,
SWT.CHECK);
GridDataFactory.fillDefaults() //
.align(SWT.FILL, SWT.CENTER)
.span(3, 1)
.indent(0, 10)
.applyTo(_chkIsSynchSmoothing);
_chkIsSynchSmoothing.setToolTipText(Messages.TourChart_Smoothing_Checkbox_IsSyncSmoothing_Tooltip);
_chkIsSynchSmoothing.addSelectionListener(_selectionListener);
}
/*
* repeated smoothing
*/
{
_lblRepeatedSmoothing = _tk.createLabel(parent, Messages.TourChart_Smoothing_Label_RepeatedSmoothing);
GridDataFactory.fillDefaults() //
.align(SWT.FILL, SWT.CENTER)
.span(2, 1)
.indent(0, 10)
.applyTo(_lblRepeatedSmoothing);
_lblRepeatedSmoothing.setToolTipText(Messages.TourChart_Smoothing_Label_RepeatedSmoothing_Tooltip);
/*
* spinner: repeated smoothing
*/
_spinnerRepeatedSmoothing = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.FILL)
.indent(0, 10)
.hint(_hintDefaultSpinnerWidth, SWT.DEFAULT)
.applyTo(_spinnerRepeatedSmoothing);
_spinnerRepeatedSmoothing.setMinimum(0);
_spinnerRepeatedSmoothing.setMaximum(10);
_spinnerRepeatedSmoothing.addSelectionListener(_selectionListener);
_spinnerRepeatedSmoothing.addMouseWheelListener(_spinnerMouseWheelListener);
}
/*
* repeated tau
*/
{
_lblRepeatedTau = _tk.createLabel(parent, Messages.TourChart_Smoothing_Label_RepeatedTau);
GridDataFactory.fillDefaults() //
.align(SWT.FILL, SWT.CENTER)
.span(2, 1)
.applyTo(_lblRepeatedTau);
_lblRepeatedTau.setToolTipText(Messages.TourChart_Smoothing_Label_RepeatedTau_Tooltip);
/*
* spinner: repeated tau
*/
_spinnerRepeatedTau = new Spinner(parent, SWT.BORDER);
GridDataFactory.fillDefaults()//
.align(SWT.BEGINNING, SWT.FILL)
.hint(_hintDefaultSpinnerWidth, SWT.DEFAULT)
.applyTo(_spinnerRepeatedTau);
_spinnerRepeatedTau.setDigits(1);
_spinnerRepeatedTau.setMinimum(1);
_spinnerRepeatedTau.setMaximum(10);
_spinnerRepeatedTau.addSelectionListener(_selectionListener);
_spinnerRepeatedTau.addMouseWheelListener(_spinnerMouseWheelListener);
}
}