Top Description Fields Constructors Methods
jogamp.newt.awt.event

public Class AWTNewtEventFactory

extends Object
Class Inheritance
Imports
com.jogamp.nativewindow.NativeSurface, .NativeSurfaceHolder, com.jogamp.newt.event.MouseEvent

AWT Event Modifier Mapping
   Modifier       AWT Constant                     AWT Bit  AWT Ex  NEWT Constant              NEWT Bit
   -------------  -------------------------------  -------  ------  -------------------------  --------
   Shift          Event.SHIFT_MASK                 0
   Ctrl           Event.CTRL_MASK                  1
   Meta           Event.META_MASK                  2
   Alt            Event.ALT_MASK                   3
   Button1        InputEvent.BUTTON1_MASK          4
   Button2        InputEvent.BUTTON2_MASK          3
   Button3        InputEvent.BUTTON3_MASK          2
   Shift Down     InputEvent.SHIFT_DOWN_MASK       6        *       InputEvent.SHIFT_MASK      0
   Ctrl Down      InputEvent.CTRL_DOWN_MASK        7        *       InputEvent.CTRL_MASK       1
   Meta Down      InputEvent.META_DOWN_MASK        8        *       InputEvent.META_MASK       2
   Alt Down       InputEvent.ALT_DOWN_MASK         9        *       InputEvent.ALT_MASK        3
   Button1 Down   InputEvent.BUTTON1_DOWN_MASK     10       *       InputEvent.BUTTON1_MASK    5
   Button2 Down   InputEvent.BUTTON2_DOWN_MASK     11       *       InputEvent.BUTTON2_MASK    6
   Button3 Down   InputEvent.BUTTON3_DOWN_MASK     12       *       InputEvent.BUTTON3_MASK    7
   AltGraph Down  InputEvent.ALT_GRAPH_DOWN_MASK   13       *       InputEvent.ALT_GRAPH_MASK  4
   Button4 Down   --                               14       *       InputEvent.BUTTON4_MASK    8
   Button5 Down   --                               15       *       InputEvent.BUTTON5_MASK    9
   Button6 Down   --                               16       *       InputEvent.BUTTON6_MASK    10
   Button7 Down   --                               17       *       InputEvent.BUTTON7_MASK    11
   Button8 Down   --                               18       *       InputEvent.BUTTON8_MASK    12
   Button9 Down   --                               19       *       InputEvent.BUTTON9_MASK    13
   Button10 Down  --                               20       *                                  14
   Button11 Down  --                               21       *                                  15
   Button12 Down  --                               22       *                                  16
   Button13 Down  --                               23       *                                  17
   Button14 Down  --                               24       *                                  18
   Button15 Down  --                               25       *                                  19
   Button16 Down  --                               26       *       InputEvent.BUTTONLAST_MASK 20
   Button17 Down  --                               27       *
   Button18 Down  --                               28       *
   Button19 Down  --                               29       *
   Button20 Down  --                               30       *
   Autorepeat     --                               -                InputEvent.AUTOREPEAT_MASK 29
   Confined       --                               -                InputEvent.CONFINED_MASK   30
   Invisible      --                               -                InputEvent.INVISIBLE_MASK  31

Field Summary

Modifier and TypeField and Description
private static int[]
awtButtonDownMasks

zero-based AWT button mask array filled by getAWTButtonDownMask(int), allowing fast lookup.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final short
awtButton2Newt(final int awtButton)

public static short
awtKeyCode2NewtKeyCode(final int awtKeyCode)

public static final int
awtModifiers2Newt(final int
The AWT event modifiers.
awtMods
,
final int
The AWT extended event modifiers. AWT passes mouse button specific bits here and are the preferred way check the mouse button state.
awtModsEx
)

Converts the specified set of AWT event modifiers and extended event modifiers to the equivalent NEWT event modifiers.

public static final KeyEvent
createKeyEvent(final KeyEvent event, final NativeSurfaceHolder sourceHolder)

public static final KeyEvent
createKeyEvent(final short newtType, final KeyEvent event, final NativeSurfaceHolder sourceHolder)

public static final MouseEvent
createMouseEvent(final MouseEvent event, final NativeSurfaceHolder sourceHolder)

public static final WindowEvent
createWindowEvent(final WindowEvent event, final NativeSurfaceHolder sourceHolder)

public static final WindowEvent
createWindowEvent(final ComponentEvent event, final NativeSurfaceHolder sourceHolder)

public static final WindowEvent
createWindowEvent(final FocusEvent event, final NativeSurfaceHolder sourceHolder)

public static final short
eventTypeAWT2NEWT(final int awtType)

public static int
private static int
getAWTButtonDownMaskImpl(final int button)

public static int
newtKeyCode2AWTKeyCode(final short newtKeyCode)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

awtButtonDownMasksback to summary
private static int[] awtButtonDownMasks

zero-based AWT button mask array filled by getAWTButtonDownMask(int), allowing fast lookup.

Constructor Detail

AWTNewtEventFactoryback to summary
public AWTNewtEventFactory()

Method Detail

awtButton2Newtback to summary
public static final short awtButton2Newt(final int awtButton)
awtKeyCode2NewtKeyCodeback to summary
public static short awtKeyCode2NewtKeyCode(final int awtKeyCode)
awtModifiers2Newtback to summary
public static final int awtModifiers2Newt(final int awtMods, final int awtModsEx)

Converts the specified set of AWT event modifiers and extended event modifiers to the equivalent NEWT event modifiers.

See AWT event modifier mapping details.

Parameters
awtMods:int

The AWT event modifiers.

awtModsEx:int

The AWT extended event modifiers. AWT passes mouse button specific bits here and are the preferred way check the mouse button state.

createKeyEventback to summary
public static final KeyEvent createKeyEvent(final KeyEvent event, final NativeSurfaceHolder sourceHolder)
createKeyEventback to summary
public static final KeyEvent createKeyEvent(final short newtType, final KeyEvent event, final NativeSurfaceHolder sourceHolder)
createMouseEventback to summary
public static final MouseEvent createMouseEvent(final MouseEvent event, final NativeSurfaceHolder sourceHolder)
createWindowEventback to summary
public static final WindowEvent createWindowEvent(final WindowEvent event, final NativeSurfaceHolder sourceHolder)
createWindowEventback to summary
public static final WindowEvent createWindowEvent(final ComponentEvent event, final NativeSurfaceHolder sourceHolder)
createWindowEventback to summary
public static final WindowEvent createWindowEvent(final FocusEvent event, final NativeSurfaceHolder sourceHolder)
eventTypeAWT2NEWTback to summary
public static final short eventTypeAWT2NEWT(final int awtType)
getAWTButtonDownMaskback to summary
public static int getAWTButtonDownMask(final int button)

See AWT event modifier mapping details.

getAWTButtonDownMaskImplback to summary
private static int getAWTButtonDownMaskImpl(final int button)
newtKeyCode2AWTKeyCodeback to summary
public static int newtKeyCode2AWTKeyCode(final short newtKeyCode)