org.eclipse.swt.events.MouseEvent.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.eclipse.swt.events.MouseEvent.<init>()方法的一些代码示例,展示了MouseEvent.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MouseEvent.<init>()方法的具体详情如下:
包路径:org.eclipse.swt.events.MouseEvent
类名称:MouseEvent
方法名:<init>

MouseEvent.<init>介绍

[英]Constructs a new instance of this class based on the information in the given untyped event.
[中]基于给定的非类型化事件中的信息构造此类的新实例。

代码示例

代码示例来源:origin: Renanse/Ardor3D

  1. @Before
  2. public void setup() throws Exception {
  3. control = createMock("control", SwtCanvas.class);
  4. wrapper = new SwtMouseWrapper(control);
  5. final Event event = new Event();
  6. event.widget = control;
  7. e1 = new MouseEvent(event);
  8. e2 = new MouseEvent(event);
  9. mocks = new Object[] { control };
  10. }

代码示例来源:origin: com.metsci.glimpse/glimpse-extras-swt

  1. protected MouseEvent toLocalCoords( MouseEvent e, GlimpseTargetStack stack )
  2. {
  3. if ( stack == null ) return null;
  4. GlimpseBounds bounds = stack.getBounds( );
  5. if ( bounds == null ) return null;
  6. if ( ! ( e.getSource( ) instanceof Control ) ) return null;
  7. Rectangle parentBounds = ( ( Control ) e.getSource( ) ).getBounds( );
  8. int parentHeight = parentBounds.height;
  9. Event localEvent = new Event( );
  10. localEvent.x = e.x - bounds.getX( );
  11. localEvent.y = e.y - ( parentHeight - ( bounds.getY( ) + bounds.getHeight( ) ) );
  12. localEvent.button = e.button;
  13. localEvent.count = e.count;
  14. localEvent.display = e.display;
  15. localEvent.stateMask = e.stateMask;
  16. localEvent.time = e.time;
  17. localEvent.widget = e.widget;
  18. // store the GlimpseTargetStack in the data field (marked as for application use)
  19. localEvent.data = stack;
  20. return new MouseEvent( localEvent );
  21. }

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

  1. public static void processMouseEvents( Control control ) {
  2. if( WidgetLCAUtil.wasEventSent( control, JSConst.EVENT_MOUSE_DOWN ) ) {
  3. MouseEvent event = new MouseEvent( control, MouseEvent.MOUSE_DOWN );
  4. event.button = readIntParam( JSConst.EVENT_MOUSE_DOWN_BUTTON );
  5. Point point = readXYParams( control, JSConst.EVENT_MOUSE_DOWN_X, JSConst.EVENT_MOUSE_DOWN_Y );
  6. MouseEvent event = new MouseEvent( control, MouseEvent.MOUSE_DOUBLE_CLICK );
  7. event.button = readIntParam( JSConst.EVENT_MOUSE_DOUBLE_CLICK_BUTTON );
  8. Point point = readXYParams( control,
  9. MouseEvent event = new MouseEvent( control, MouseEvent.MOUSE_UP );
  10. event.button = readIntParam( JSConst.EVENT_MOUSE_UP_BUTTON );
  11. Point point = readXYParams( control, JSConst.EVENT_MOUSE_UP_X, JSConst.EVENT_MOUSE_UP_Y );

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

  1. ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
  2. break;
  3. ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
  4. break;
  5. ((MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
  6. break;
  7. ((MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
  8. break;
  9. ((MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
  10. break;
  11. ((MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
  12. return;
  13. ((MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
  14. return;
  15. ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
  16. break;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

  1. ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
  2. break;
  3. ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
  4. break;
  5. ((MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
  6. break;
  7. ((MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
  8. break;
  9. ((MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
  10. break;
  11. ((MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
  12. return;
  13. ((MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
  14. return;
  15. ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
  16. break;

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

  1. ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
  2. break;
  3. ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
  4. break;
  5. ((MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
  6. break;
  7. ((MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
  8. break;
  9. ((MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
  10. break;
  11. ((MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
  12. return;
  13. ((MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
  14. return;
  15. ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
  16. break;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

  1. ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
  2. break;
  3. ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
  4. break;
  5. ((MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
  6. break;
  7. ((MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
  8. break;
  9. ((MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
  10. break;
  11. ((MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
  12. return;
  13. ((MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
  14. return;
  15. ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
  16. break;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

  1. ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
  2. break;
  3. ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
  4. break;
  5. ((MouseTrackListener) eventListener).mouseEnter (new MouseEvent (e));
  6. break;
  7. ((MouseTrackListener) eventListener).mouseExit (new MouseEvent (e));
  8. break;
  9. ((MouseTrackListener) eventListener).mouseHover (new MouseEvent (e));
  10. break;
  11. ((MouseMoveListener) eventListener).mouseMove(new MouseEvent(e));
  12. return;
  13. ((MouseWheelListener) eventListener).mouseScrolled(new MouseEvent(e));
  14. return;
  15. ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
  16. break;

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

  1. ((MouseListener) eventListener).mouseDown(new MouseEvent(e));
  2. break;
  3. ((MouseListener) eventListener).mouseDoubleClick(new MouseEvent(e));
  4. break;
  5. ((MouseListener) eventListener).mouseUp(new MouseEvent(e));
  6. break;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

  1. case SWT.MouseDoubleClick:
  2. case SWT.MouseWheel:
  3. case SWT.MouseHover: toString += new MouseEvent (event).toString (); break;
  4. case SWT.Paint: toString += new PaintEvent (event).toString (); break;
  5. case SWT.Move:

相关文章