List of usage examples for java.awt.event MouseEvent hashCode
@HotSpotIntrinsicCandidate public native int hashCode();
From source file:SWTUtils.java
/** * Creates an AWT <code>MouseEvent</code> from a swt event. * This method helps passing SWT mouse event to awt components. * @param event The swt event.//from w w w. jav a 2s. co m * @return A AWT mouse event based on the given SWT event. */ public static MouseEvent toAwtMouseEvent(org.eclipse.swt.events.MouseEvent event) { int button = MouseEvent.NOBUTTON; switch (event.button) { case 1: button = MouseEvent.BUTTON1; break; case 2: button = MouseEvent.BUTTON2; break; case 3: button = MouseEvent.BUTTON3; break; } int modifiers = 0; if ((event.stateMask & SWT.CTRL) != 0) { modifiers |= InputEvent.CTRL_DOWN_MASK; } if ((event.stateMask & SWT.SHIFT) != 0) { modifiers |= InputEvent.SHIFT_DOWN_MASK; } if ((event.stateMask & SWT.ALT) != 0) { modifiers |= InputEvent.ALT_DOWN_MASK; } MouseEvent awtMouseEvent = new MouseEvent(DUMMY_PANEL, event.hashCode(), event.time, modifiers, event.x, event.y, 1, false, button); return awtMouseEvent; }