diff options
Diffstat (limited to 'src/newt/classes/com/jogamp')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/event/MouseEvent.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java index 4e13d63fe..fd5e27bdd 100644 --- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java +++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java @@ -66,18 +66,28 @@ public class MouseEvent extends InputEvent /** Type of pointer devices */ public static enum PointerType implements InputEvent.InputType { - /** {@link PointerClass#Offscreen} mouse. */ + /** {@link PointerClass#Offscreen} mouse. Ordinal 0. */ Mouse(PointerClass.Offscreen), - /** {@link PointerClass#Offscreen} touch pad, usually using fingers. */ + /** {@link PointerClass#Offscreen} touch pad, usually using fingers. Ordinal 1. */ TouchPad(PointerClass.Offscreen), - /** {@link PointerClass#Onscreen} touch screen, usually using fingers. */ + /** {@link PointerClass#Onscreen} touch screen, usually using fingers. Ordinal 2. */ TouchScreen(PointerClass.Onscreen), - /** {@link PointerClass#Onscreen} pen on screen ?. */ + /** {@link PointerClass#Onscreen} pen usually on screen? Ordinal 3. FIXME*/ Pen(PointerClass.Onscreen), + /** {@link PointerClass#Undefined} ?. Ordinal 4. */ Undefined(PointerClass.Undefined); public PointerClass getPointerClass() { return pc; } + public static PointerType valueOf(int i) { + // ordinal = enumValue.ordinal(), reverse: enumValue = EnumClass.values()[ordinal] + final PointerType[] all = PointerType.values(); + if( 0 <= i && i < all.length ) { + return all[i]; + } + return null; + } + private PointerType(PointerClass pc) { this.pc = pc; } |