本文整理汇总了Java中org.eclipse.swt.events.MouseWheelListener类的典型用法代码示例。如果您正苦于以下问题:Java MouseWheelListener类的具体用法?Java MouseWheelListener怎么用?Java MouseWheelListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MouseWheelListener类属于org.eclipse.swt.events包,在下文中一共展示了MouseWheelListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initUI
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}
示例2: createUI_0_init
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}
示例3: initUI
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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);
}
};
}
示例4: initUI
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}
示例5: initUI
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}
示例6: initUITools
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}
示例7: removeMouseWheelListener
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
@Override
public void removeMouseWheelListener ( final MouseWheelListener listener )
{
if ( !this.control.isDisposed () )
{
this.control.removeMouseWheelListener ( listener );
}
}
示例8: installMouseWheelScrollRecursively
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
public static void installMouseWheelScrollRecursively( ScrolledComposite scrollable) {
MouseWheelListener scroller = createMouseWheelScroller(scrollable);
if (scrollable.getParent() != null)
{
scrollable.getParent().addMouseWheelListener(scroller);
}
installMouseWheelScrollRecursively(scroller, scrollable);
}
示例9: createMouseWheelScroller
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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));
}
};
}
示例10: installMouseWheelScrollRecursively
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
/**
* 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);
}
示例11: createMouseWheelScroller
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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));
}
};
}
示例12: fromMouseWheelListener
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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);
}
示例13: initUI
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}
示例14: createUI_48_SegmenterBy_MinAltitude
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的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;
}
示例15: initUI
import org.eclipse.swt.events.MouseWheelListener; //导入依赖的package包/类
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();
}
};
}