Java 类org.eclipse.swt.events.MouseWheelListener 实例源码

项目:mytourbook    文件:SlideoutMapBookmarks.java   
private void initUI(final Composite parent) {

        _pc = new PixelConverter(parent);

        _defaultSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onChangeUI();
            }
        };

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                UI.adjustSpinnerValueOnMouseScroll(event);
                onChangeUI();
            }
        };

    }
项目:mytourbook    文件:SmoothingUI_Initial.java   
private void createUI_0_init(final Composite parent) {

        if (_tk == null) {
            _tk = new FormToolkit(parent.getDisplay());
        }

        _defaultSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent event) {
                if (_isUpdateUI) {
                    return;
                }
                onChangeProperty();
            }
        };

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                UI.adjustSpinnerValueOnMouseScroll(event);
                onChangeProperty();
            }
        };
    }
项目:mytourbook    文件:SmoothingUI_Jamet.java   
private void initUI(final Composite parent) {

        _pc = new PixelConverter(parent);
        _hintDefaultSpinnerWidth = _isLinux ? SWT.DEFAULT : _pc.convertWidthInCharsToPixels(_isOSX ? 10 : 5);

        _selectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (_isUpdateUI) {
                    return;
                }
                onModifySmoothing(e.widget, true);
            }
        };

        _spinnerMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                Util.adjustSpinnerValueOnMouseScroll(event);
                if (_isUpdateUI) {
                    return;
                }
                onModifySmoothing(event.widget, true);
            }
        };
    }
项目:mytourbook    文件:SlideoutHRVOptions.java   
private void initUI(final Composite parent) {

        _defaultSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onChangeUI();
            }
        };

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                net.tourbook.common.UI.adjustSpinnerValueOnMouseScroll(event);
                onChangeUI();
            }
        };
    }
项目:mytourbook    文件:ChartOptions_Grid.java   
private void initUI(final Composite parent) {

        _gridLineListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onSelectGridLine();
            }
        };

        _defaultSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onChangeUI();
            }
        };

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                net.tourbook.common.UI.adjustSpinnerValueOnMouseScroll(event);
                onChangeUI();
            }
        };
    }
项目:mytourbook    文件:PrefPageAppearance.java   
private void initUITools(final Composite parent) {

        _pc = new PixelConverter(parent);
        _hintDefaultSpinnerWidth = _isLinux ? SWT.DEFAULT : _pc.convertWidthInCharsToPixels(_isOSX ? 10 : 5);

        _defaultSelectionAdapter = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onChangeProperty();
                enableControls();
            }
        };

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                UI.adjustSpinnerValueOnMouseScroll(event);
                onChangeProperty();
            }
        };
    }
项目:mytourbook    文件:ChartOptions_TourFrequency.java   
private void initUI(final Composite parent) {

        _defaultSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onChangeUI();
            }
        };

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                net.tourbook.common.UI.adjustSpinnerValueOnMouseScroll(event);
                onChangeUI();
            }
        };
    }
项目:neoscada    文件:ChartAreaRenderer.java   
@Override
public void removeMouseWheelListener ( final MouseWheelListener listener )
{
    if ( !this.control.isDisposed () )
    {
        this.control.removeMouseWheelListener ( listener );
    }
}
项目:Hydrograph    文件:MouseWheelScrollingOnComposite.java   
public static  void installMouseWheelScrollRecursively( ScrolledComposite scrollable) {
    MouseWheelListener scroller = createMouseWheelScroller(scrollable);
    if (scrollable.getParent() != null)
    {   
     scrollable.getParent().addMouseWheelListener(scroller);
    }   
    installMouseWheelScrollRecursively(scroller, scrollable);
}
项目:Hydrograph    文件:MouseWheelScrollingOnComposite.java   
public static   MouseWheelListener createMouseWheelScroller(final ScrolledComposite scrollable) {
    return new MouseWheelListener() {

        @Override
        public void mouseScrolled(MouseEvent e) {
            Point currentScroll = scrollable.getOrigin();
            scrollable.setOrigin(currentScroll.x, currentScroll.y - (e.count * 5));
        }
    };
}
项目:Hydrograph    文件:MouseWheelScrollingOnComposite.java   
public static  void installMouseWheelScrollRecursively(MouseWheelListener scroller, Control c) {
    c.addMouseWheelListener(scroller);
    if (c instanceof Composite) {
        Composite comp = (Composite) c;
        for (Control child : comp.getChildren()) {
            installMouseWheelScrollRecursively(scroller, child);
        }
    }
}
项目:Hydrograph    文件:DebugDataViewer.java   
/**
 * make wheel scrolling available by installing a wheel listener on this scrollable's parent and hierarchy of
 * children
 * 
 * @param scrollable
 *            the scrolledComposite to wheel-scroll
 */
private void installMouseWheelScrollRecursively(final ScrolledComposite scrollable) {
    MouseWheelListener scroller = createMouseWheelScroller(scrollable);
    if (scrollable.getParent() != null){
        scrollable.getParent().addMouseWheelListener(scroller);
    }           
    installMouseWheelScrollRecursively(scroller, scrollable);
}
项目:Hydrograph    文件:DebugDataViewer.java   
private MouseWheelListener createMouseWheelScroller(final ScrolledComposite scrollable) {
    return new MouseWheelListener() {

        @Override
        public void mouseScrolled(MouseEvent e) {
            Point currentScroll = scrollable.getOrigin();
            scrollable.setOrigin(currentScroll.x, currentScroll.y - (e.count * 5));
        }
    };
}
项目:Hydrograph    文件:DebugDataViewer.java   
private void installMouseWheelScrollRecursively(MouseWheelListener scroller, Control c) {
    c.addMouseWheelListener(scroller);
    if (c instanceof Composite) {
        Composite comp = (Composite) c;
        for (Control child : comp.getChildren()) {
            installMouseWheelScrollRecursively(scroller, child);
        }
    }
}
项目:rxswt    文件:SwtObservers.java   
public static Observable<MouseEvent> fromMouseWheelListener(Control control) {
    Observable<MouseEvent> observable = Observable.create(subscriber -> {
        MouseWheelListener wheelListener = e -> subscriber.onNext(e);
        control.addMouseWheelListener(wheelListener);
        subscriber.setDisposable(Disposables.fromAction(() -> control.removeMouseWheelListener(wheelListener)));
    });
    return wrap(control, observable);
}
项目:mytourbook    文件:TrainingView.java   
private void initUI(final Composite parent) {

        _pc = new PixelConverter(parent);
        _tk = new FormToolkit(parent.getDisplay());
        _fontItalic = JFaceResources.getFontRegistry().getItalic(JFaceResources.DIALOG_FONT);

        _defaultSpinnerModifyListener = new ModifyListener() {
            @Override
            public void modifyText(final ModifyEvent e) {
                if (_isUpdateUI) {
                    return;
                }
                onModifyHrBorder();
            }
        };

        _defaultSpinnerSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (_isUpdateUI) {
                    return;
                }
                onModifyHrBorder();
            }
        };

        _defaultSpinnerMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                Util.adjustSpinnerValueOnMouseScroll(event);
                if (_isUpdateUI) {
                    return;
                }
                onModifyHrBorder();
            }
        };

    }
项目:mytourbook    文件:TourSegmenterView.java   
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;
    }
项目:mytourbook    文件:HeartRateVariabilityView.java   
private void initUI(final Composite parent) {

        _tk = new FormToolkit(parent.getDisplay());

        _defaultSpinnerModifyListener = new ModifyListener() {
            @Override
            public void modifyText(final ModifyEvent e) {
                if (_isUpdateUI) {
                    return;
                }
                onModifyMinMaxTime();
            }
        };

        _defaultSpinnerSelectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (_isUpdateUI) {
                    return;
                }
                onModifyMinMaxTime();
            }
        };

        _defaultSpinnerMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                Util.adjustSpinnerValueOnMouseScroll(event);
                if (_isUpdateUI) {
                    return;
                }
                onModifyMinMaxTime();
            }
        };
    }
项目:mytourbook    文件:SlideoutViewSettings.java   
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);
        }
    }
项目:mytourbook    文件:PrefPageComputedValues.java   
private void initUI(final Composite parent) {

        _pc = new PixelConverter(parent);

        DEFAULT_DESCRIPTION_WIDTH = _pc.convertWidthInCharsToPixels(80);
        DEFAULT_V_DISTANCE_PARAGRAPH = _pc.convertVerticalDLUsToPixels(4);

        _selectionListener = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                if (_isUpdateUI) {
                    return;
                }
                onModifyBreakTime();
            }
        };

        _spinnerMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                if (_isUpdateUI) {
                    return;
                }
                Util.adjustSpinnerValueOnMouseScroll(event);
                onModifyBreakTime();
            }
        };
    }
项目:mytourbook    文件:PrefPagePeople.java   
/**
     * 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);
    }
项目:mytourbook    文件:PrefPagePeople.java   
/**
     * 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);
    }
项目:mytourbook    文件:PrefPageTour.java   
private void initUI(final Composite parent) {

        _pc = new PixelConverter(parent);

        _defaultSpinnerWidth = _isLinux ? SWT.DEFAULT : _pc.convertWidthInCharsToPixels(_isOSX ? 14 : 7);
        _defaultInfoWidth = _pc.convertWidthInCharsToPixels(50);

        _defaultMouseWheelListener = new MouseWheelListener() {
            @Override
            public void mouseScrolled(final MouseEvent event) {
                UI.adjustSpinnerValueOnMouseScroll(event);
            }
        };
    }
项目:mytourbook    文件:GalleryActionBar.java   
/**
 * spinner: thumb size
 */
private void createUI_20_ImageSize(final Composite parent) {

    _spinnerThumbSize = new Spinner(parent, SWT.BORDER);
    GridDataFactory.fillDefaults() //
            .align(SWT.BEGINNING, SWT.FILL)
            .applyTo(_spinnerThumbSize);
    _spinnerThumbSize.setMinimum(ImageGallery.MIN_GALLERY_ITEM_WIDTH);
    _spinnerThumbSize.setMaximum(ImageGallery.MAX_GALLERY_ITEM_WIDTH);
    _spinnerThumbSize.setIncrement(1);
    _spinnerThumbSize.setPageIncrement(50);
    _spinnerThumbSize.setToolTipText(UI.IS_OSX
            ? Messages.Pic_Dir_Spinner_ThumbnailSize_Tooltip_OSX
            : Messages.Pic_Dir_Spinner_ThumbnailSize_Tooltip);
    _spinnerThumbSize.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            _imageGallery.setThumbnailSize(_spinnerThumbSize.getSelection());
        }
    });
    _spinnerThumbSize.addMouseWheelListener(new MouseWheelListener() {
        public void mouseScrolled(final MouseEvent event) {
            Util.adjustSpinnerValueOnMouseScroll(event);
            _imageGallery.setThumbnailSize(_spinnerThumbSize.getSelection());
        }
    });
}
项目:neoscada    文件:ChartAreaRenderer.java   
@Override
public void addMouseWheelListener ( final MouseWheelListener listener )
{
    this.control.addMouseWheelListener ( listener );
}
项目:neoscada    文件:FigureRenderer.java   
@Override
public void addMouseWheelListener ( final MouseWheelListener listener )
{
}
项目:neoscada    文件:FigureRenderer.java   
@Override
public void removeMouseWheelListener ( final MouseWheelListener listener )
{
}
项目:dockerfoundry    文件:DockerFoundryServiceWizardPageLeftPanel.java   
private Composite createFilterComp(Composite parent) {

        Composite filterComp = new Composite(parent, SWT.NONE);
        GridLayout layout = new GridLayout();
        layout.numColumns = 3;
        layout.marginHeight = 0;
        layout.marginWidth = 0;
//      layout.horizontalSpacing = convertHorizontalDLUsToPixels(comp, 4);
//      layout.verticalSpacing = convertHorizontalDLUsToPixels(comp, 4);
        filterComp.setLayout(layout);

        final Label filterLabel = new Label(filterComp, SWT.NONE);
        filterLabel.setText(Messages.DockerFoundryServiceWizardPageLeftPanel_FILTER_TITLE);
        GridData data = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
        filterLabel.setLayoutData(data);

        filterText = new Text(filterComp, SWT.SEARCH);
        filterText.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
        filterText.setMessage(Messages.DockerFoundryServiceWizardPageLeftPanel_DEFAULT_FILTER_TEXT);

        filterText.addModifyListener(new ModifyListener() {
            @Override
            public void modifyText(ModifyEvent e) {

                String text = filterText.getText();
                if (Messages.DockerFoundryServiceWizardPageLeftPanel_DEFAULT_FILTER_TEXT.equals(text)) {
                    filterTerm = null;
                }
                else {
                    filterTerm = filterText.getText().trim();
                }
                updateServiceList();
            }
        });

        MouseWheelListener mwl = new MouseWheelListener() {

            public void mouseScrolled(MouseEvent event) {
                scrollComp.setFocus();
            }
        };

        filterText.addMouseWheelListener(mwl);      
        filterText.addTraverseListener(traverseListener);

        return filterComp;

    }
项目:mytourbook    文件:DialogPhotoProperties.java   
private void createUI_20_ImageSize(final Composite parent) {

        final Composite container = new Composite(parent, SWT.NONE);
//      GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
        GridLayoutFactory.fillDefaults().numColumns(1).applyTo(container);
        {
            /*
             * label: displayed photos
             */
            final Label label = new Label(container, SWT.NO_FOCUS);
            GridDataFactory.fillDefaults()//
//                  .align(SWT.CENTER, SWT.BEGINNING)
                    .applyTo(label);

            label.setText(Messages.Photo_Properties_Label_Size);
            label.setToolTipText(Messages.Photo_Properties_Label_ThumbnailSize_Tooltip);

            /*
             * spinner: size
             */
            _spinnerImageSize = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults() //
                    .align(SWT.BEGINNING, SWT.FILL)
                    .applyTo(_spinnerImageSize);
            _spinnerImageSize.setMinimum(MIN_IMAGE_WIDTH);
            _spinnerImageSize.setMaximum(MAX_IMAGE_WIDTH);
            _spinnerImageSize.setIncrement(1);
            _spinnerImageSize.setPageIncrement(10);
            _spinnerImageSize.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    onSelectImageSize();
                }
            });
            _spinnerImageSize.addMouseWheelListener(new MouseWheelListener() {
                @Override
                public void mouseScrolled(final MouseEvent event) {
                    Util.adjustSpinnerValueOnMouseScroll(event);
                    onSelectImageSize();
                }
            });

        }
    }
项目:mytourbook    文件:TourSegmenterView.java   
private Composite createUI_46_SegmenterBy_Distance(final Composite parent) {

        final Composite container = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
        GridLayoutFactory.fillDefaults().numColumns(3).applyTo(container);
        {

            // label: distance
            final Label label = new Label(container, SWT.NONE);
            label.setText(Messages.tour_segmenter_segType_byDistance_label);

            // spinner: distance
            _spinnerDistance = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults().applyTo(_spinnerDistance);
            _spinnerDistance.setMinimum(1); // 0.1
            _spinnerDistance.setMaximum(_maxDistanceSpinner);
            _spinnerDistance.setPageIncrement(_spinnerDistancePage);
            _spinnerDistance.setDigits(1);
            _spinnerDistance.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    onSelect_Distance();
                }
            });
            _spinnerDistance.addMouseWheelListener(new MouseWheelListener() {
                @Override
                public void mouseScrolled(final MouseEvent event) {
                    UI.adjustSpinnerValueOnMouseScroll(event);
                    onSelect_Distance();
                }
            });

            // text: distance value
            _lblDistanceValue = new Label(container, SWT.NONE);
            _lblDistanceValue.setText(Messages.tour_segmenter_segType_byDistance_defaultDistance);
            GridDataFactory.fillDefaults()//
                    .align(SWT.FILL, SWT.CENTER)
                    .grab(true, false)
                    .applyTo(_lblDistanceValue);
        }

        return container;
    }
项目:mytourbook    文件:TourSegmenterView.java   
private Composite createUI_54_BreakBy_AvgSpeed(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
            _spinnerBreak_MinAvgSpeed = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults().hint(_spinnerWidth, SWT.DEFAULT).applyTo(_spinnerBreak_MinAvgSpeed);
            _spinnerBreak_MinAvgSpeed.setMinimum(0); // 0.0 km/h
            _spinnerBreak_MinAvgSpeed.setMaximum(PrefPageComputedValues.BREAK_MAX_SPEED_KM_H); // 10.0 km/h
            _spinnerBreak_MinAvgSpeed.setDigits(1);
            _spinnerBreak_MinAvgSpeed.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    onSelect_BreakTime();
                }
            });
            _spinnerBreak_MinAvgSpeed.addMouseWheelListener(new MouseWheelListener() {
                @Override
                public void mouseScrolled(final MouseEvent event) {
                    UI.adjustSpinnerValueOnMouseScroll(event);
                    onSelect_BreakTime();
                }
            });

            // label: km/h
            label = new Label(container, SWT.NONE);
            label.setText(net.tourbook.common.UI.UNIT_LABEL_SPEED);
        }

        return container;
    }
项目:mytourbook    文件:TourSegmenterView.java   
private Composite createUI_55_BreakBy_SliceSpeed(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_BLUE));
        {
            /*
             * minimum speed
             */

            // label: minimum speed
            Label label = new Label(container, SWT.NONE);
            label.setText(Messages.Compute_BreakTime_Label_MinimumSliceSpeed);
            _firstColBreakTime.add(label);

            // spinner: minimum speed
            _spinnerBreak_MinSliceSpeed = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults().hint(_spinnerWidth, SWT.DEFAULT).applyTo(_spinnerBreak_MinSliceSpeed);
            _spinnerBreak_MinSliceSpeed.setMinimum(0); // 0.0 km/h
            _spinnerBreak_MinSliceSpeed.setMaximum(PrefPageComputedValues.BREAK_MAX_SPEED_KM_H); // 10.0 km/h
            _spinnerBreak_MinSliceSpeed.setDigits(1);
            _spinnerBreak_MinSliceSpeed.addSelectionListener(new SelectionAdapter() {
                @Override
                public void widgetSelected(final SelectionEvent e) {
                    onSelect_BreakTime();
                }
            });
            _spinnerBreak_MinSliceSpeed.addMouseWheelListener(new MouseWheelListener() {
                @Override
                public void mouseScrolled(final MouseEvent event) {
                    UI.adjustSpinnerValueOnMouseScroll(event);
                    onSelect_BreakTime();
                }
            });

            // label: km/h
            label = new Label(container, SWT.NONE);
            label.setText(net.tourbook.common.UI.UNIT_LABEL_SPEED);
        }

        return container;
    }
项目:mytourbook    文件:SlideoutTourMarkerFilter.java   
private void createUI_20_LatLonDigits(final Composite parent) {

        final SelectionListener _selectionAdapterLatLonDigits = new SelectionAdapter() {
            @Override
            public void widgetSelected(final SelectionEvent e) {
                onSelect_LatLonDigits();
            }
        };

        /*
         * Lat/lon digits
         */
        {
            // checkbox: lat/lon digits
            _chkLatLonDigits = new Button(parent, SWT.CHECK);
            GridDataFactory
                    .fillDefaults()//
                    .span(2, 1)
                    .applyTo(_chkLatLonDigits);
            _chkLatLonDigits.setText(Messages.Slideout_TourMarkerFilter_Checkbox_IsReduceLatLonDigits);
            _chkLatLonDigits.setToolTipText(Messages.Slideout_TourMarkerFilter_Checkbox_IsReduceLatLonDigits_Tooltip);
            _chkLatLonDigits.addSelectionListener(_selectionAdapterLatLonDigits);

            // 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);
        }
    }
项目:mytourbook    文件:PrefPagePeople.java   
/**
     * field: resting hr
     */
    private void createUI_62_RestingHR(final Composite parent) {

        Label label = new Label(parent, SWT.NONE);
        label.setText(Messages.Pref_People_Label_RestingHR);

        final Composite container = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults()//
//              .span(2, 1)
                .applyTo(container);
        GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
        {
            // spinner: weight
            _spinnerRestingHR = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults() //
                    .align(SWT.BEGINNING, SWT.FILL)
//                  .hint(_spinnerWidth, SWT.DEFAULT)
                    .applyTo(_spinnerRestingHR);
            _spinnerRestingHR.setMinimum(10);
            _spinnerRestingHR.setMaximum(200);
            _spinnerRestingHR.addSelectionListener(_defaultSelectionListener);
            _spinnerRestingHR.addMouseWheelListener(new MouseWheelListener() {
                @Override
                public void mouseScrolled(final MouseEvent event) {
                    UI.adjustSpinnerValueOnMouseScroll(event);
                    onModifyPerson();
                }
            });

            // label: unit
            label = new Label(container, SWT.NONE);
            label.setText(net.tourbook.common.Messages.Graph_Label_Heartbeat_Unit);
        }

        final Composite containerAge = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults()//
                .grab(true, false)
                .align(SWT.END, SWT.FILL)
                .applyTo(containerAge);
        GridLayoutFactory.fillDefaults().numColumns(2).applyTo(containerAge);
//      containerAge.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
        {
            /*
             * label: age
             */
            label = new Label(containerAge, SWT.NONE);
            GridDataFactory.fillDefaults()//
                    .grab(true, true)
                    .align(SWT.END, SWT.CENTER)
                    .applyTo(label);
            label.setText(Messages.Pref_People_Label_Age);

            /*
             * label: age years
             */
            _lblAgeHr = new Label(containerAge, SWT.NONE);
            GridDataFactory.fillDefaults()//
//                  .hint(convertHeightInCharsToPixels(4), SWT.DEFAULT)
                    .grab(true, true)
                    .align(SWT.END, SWT.CENTER)
                    .applyTo(_lblAgeHr);
        }
    }
项目:mytourbook    文件:PrefPageImportFit.java   
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;
    }
项目:mytourbook    文件:PrefPageImportFit.java   
private Composite createUI_70_SplitTour(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);
        {
            // checkbox
            {
                _chkRemoveExceededDuration = new Button(container, SWT.CHECK);
                GridDataFactory.fillDefaults().span(3, 1).applyTo(_chkRemoveExceededDuration);
                _chkRemoveExceededDuration.setText(Messages.PrefPage_Fit_Checkbox_ReplaceTimeSlice);
                _chkRemoveExceededDuration.addSelectionListener(_defaultSelectionListener);
            }

            // label: info
            {
                _lblSplitTour_Info = createUI_InfoLabel(container, 3);
                _lblSplitTour_Info.setText(Messages.PrefPage_Fit_Label_ReplaceTimeSlice_Info);
            }

            // label: duration
            {
                _lblSplitTour_Duration = new Label(container, SWT.NONE);
                _lblSplitTour_Duration.setText(Messages.PrefPage_Fit_Label_ReplaceTimeSlice_Duration);
            }

            // spinner
            {
                _spinnerExceededDuration = new Spinner(container, SWT.BORDER);
                GridDataFactory
                        .fillDefaults() //
                        .align(SWT.BEGINNING, SWT.FILL)
                        .applyTo(_spinnerExceededDuration);
                _spinnerExceededDuration.setMinimum(0);
                _spinnerExceededDuration.setMaximum(Integer.MAX_VALUE);
                _spinnerExceededDuration.setPageIncrement(3600); // 60*60 = 1 hour
                _spinnerExceededDuration.addMouseWheelListener(new MouseWheelListener() {
                    @Override
                    public void mouseScrolled(final MouseEvent event) {
                        Util.adjustSpinnerValueOnMouseScroll(event);
                        updateUI_SplitTour();
                    }
                });
                _spinnerExceededDuration.addSelectionListener(new SelectionAdapter() {
                    @Override
                    public void widgetSelected(final SelectionEvent e) {
                        updateUI_SplitTour();
                    }
                });
            }

            // label: duration in year/months/days/...
            {
                _lblSplitTour_DurationUnit = new Label(container, SWT.NONE);
                GridDataFactory
                        .fillDefaults()//
                        .grab(true, false)
                        .align(SWT.FILL, SWT.CENTER)
                        .applyTo(_lblSplitTour_DurationUnit);
            }
        }

        return container;
    }
项目:mytourbook    文件:PrefPagePolar.java   
private void createUI20HorizontalAdjustment(final Composite parent) {

        _groupSliceAdjustment = new Group(parent, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, false).applyTo(_groupSliceAdjustment);
        _groupSliceAdjustment.setText(Messages.PrefPage_Polar_Group_HorizontalAdjustment);
        GridLayoutFactory.swtDefaults().numColumns(3).applyTo(_groupSliceAdjustment);
        {
            /*
             * label: slice adjustment
             */
            Label label = new Label(_groupSliceAdjustment, SWT.NONE);
            GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(label);
            label.setText(Messages.PrefPage_Polar_Label_SliceAdjustment);

            /*
             * spinner: slice adjustment
             */
            _spinnerSliceAdjustment = new Spinner(_groupSliceAdjustment, SWT.BORDER);
            _spinnerSliceAdjustment.setMinimum(-DialogAdjustAltitude.MAX_ADJUST_GEO_POS_SLICES);
            _spinnerSliceAdjustment.setMaximum(DialogAdjustAltitude.MAX_ADJUST_GEO_POS_SLICES);
            _spinnerSliceAdjustment.addMouseWheelListener(new MouseWheelListener() {
                public void mouseScrolled(final MouseEvent event) {
                    UI.adjustSpinnerValueOnMouseScroll(event);
                }
            });

            /*
             * label: slice adjustment
             */
            label = new Label(_groupSliceAdjustment, SWT.NONE);
            GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(label);
            label.setText(Messages.PrefPage_Polar_Label_Slices);

            /*
             * label: info
             */
            label = new Label(_groupSliceAdjustment, SWT.WRAP);
            GridDataFactory
                    .fillDefaults()
                    .span(3, 1)
                    .grab(true, false)
                    .indent(0, 10)
                    .hint(400, SWT.DEFAULT)
                    .applyTo(label);
            label.setText(Messages.PrefPage_Polar_Label_AdjustmentInfo);
        }
    }
项目:mytourbook    文件:PrefPageImportHAC45.java   
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);
                    }
                });
            }
        }
    }
项目:mytourbook    文件:FullScreenPhotoGallery.java   
private void createUI_20_ActionBar(final Composite parent) {

        GridLayoutFactory.fillDefaults().applyTo(parent);

        final Composite container = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
        GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
//      container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
        {
            /*
             * create gallery toolbar
             */
            _galleryToolbarControl = new ToolBar(container, SWT.FLAT);
            GridDataFactory.fillDefaults()//
                    .align(SWT.END, SWT.FILL)
                    .grab(true, false)
                    .applyTo(_galleryToolbarControl);

            /*
             * spinner: resize image
             */
            _spinnerResizeImage = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults() //
                    .applyTo(_spinnerResizeImage);
            _spinnerResizeImage.setMinimum(GALLERY_MIN_IMAGE_SIZE);
            _spinnerResizeImage.setMaximum(GALLERY_MAX_IMAGE_SIZE);
            _spinnerResizeImage.setToolTipText(UI.IS_OSX
                    ? Messages.FullScreen_ImageViewer_Spinner_ResizeImage_Tooltip_OSX
                    : Messages.FullScreen_ImageViewer_Spinner_ResizeImage_Tooltip);

            _spinnerResizeImage.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(final SelectionEvent e) {
                    onSelectResizeImage();
                }
            });
            _spinnerResizeImage.addMouseWheelListener(new MouseWheelListener() {
                public void mouseScrolled(final MouseEvent event) {
                    Util.adjustSpinnerValueOnMouseScroll(event);
                    onSelectResizeImage();
                }
            });

        }
    }
项目:mytourbook    文件:PrefPagePhotoDirectory.java   
private void createUI_16_MinSizeBorder(final Composite parent) {

        /*
         * label: display text when thumbnail min size
         */
        Label label = new Label(parent, SWT.NONE);
        GridDataFactory.fillDefaults()//
                .align(SWT.BEGINNING, SWT.CENTER)
                .applyTo(label);
        label.setText(Messages.PrefPage_Photo_Viewer_Label_MinSizeBorder);

        final Composite container = new Composite(parent, SWT.NONE);
        GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
        GridLayoutFactory.fillDefaults().numColumns(2).applyTo(container);
//      container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
        {
            /*
             * spinner: thumbnail size
             */
            _spinnerImageBorderSize = new Spinner(container, SWT.BORDER);
            GridDataFactory.fillDefaults() //
                    .align(SWT.BEGINNING, SWT.FILL)
                    .hint(convertWidthInCharsToPixels(5), SWT.DEFAULT)
                    .applyTo(_spinnerImageBorderSize);
            _spinnerImageBorderSize.setMinimum(BORDER_MIN_SIZE);
            _spinnerImageBorderSize.setMaximum(BORDER_MAX_SIZE);
            _spinnerImageBorderSize.setToolTipText(Messages.PrefPage_Photo_Viewer_Label_MinSizeBorder_Tooltip);

            _spinnerImageBorderSize.addSelectionListener(_viewerUISelectionListener);
            _spinnerImageBorderSize.addMouseWheelListener(new MouseWheelListener() {
                @Override
                public void mouseScrolled(final MouseEvent event) {
                    Util.adjustSpinnerValueOnMouseScroll(event);
                    _isImageViewerUIModified = true;
                }
            });

            /*
             * label: unit
             */
            label = new Label(container, SWT.NONE);
            GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(label);
            label.setText(Messages.App_Unit_Pixel);
        }
    }