6 |
* This class exists because of the strange behaviour of |
* This class exists because of the strange behaviour of |
7 |
* java.awt.MouseEvent (i.e. aliasing BUTTON2 and ALT etc.). |
* java.awt.MouseEvent (i.e. aliasing BUTTON2 and ALT etc.). |
8 |
* It also allows our OpenGL code to never depend on AWT classes. |
* It also allows our OpenGL code to never depend on AWT classes. |
9 |
|
* <p> |
10 |
|
* Limitation: we do not allow mouse button chords. |
11 |
*/ |
*/ |
12 |
public class VobMouseEvent { |
public class VobMouseEvent { |
13 |
public final static int MOUSE_PRESSED = 1827; |
public final static int MOUSE_PRESSED = 1827; |
16 |
public final static int MOUSE_DRAGGED = 1830; |
public final static int MOUSE_DRAGGED = 1830; |
17 |
public final static int MOUSE_WHEEL = 1831; |
public final static int MOUSE_WHEEL = 1831; |
18 |
|
|
19 |
|
// DO NOT CHANGE WITHOUT CHANGING OPENGL CODE AS WELL |
20 |
public final static int SHIFT_MASK = 1; |
public final static int SHIFT_MASK = 1; |
21 |
public final static int CONTROL_MASK = 2; |
public final static int CONTROL_MASK = 2; |
22 |
public final static int ALT_MASK = 4; |
public final static int ALT_MASK = 4; |
36 |
*/ |
*/ |
37 |
public int getButton() { return this.button; } |
public int getButton() { return this.button; } |
38 |
|
|
39 |
|
/** Create a new vob mouse event. |
40 |
|
* @param type MOUSE_PRESSED, MOUSE_RELEASED, MOUSE_CLICKED, MOUSE_DRAGGED, or MOUSE_WHEEL |
41 |
|
* @param x,y The coordinates |
42 |
|
* @param wheelDelta The wheel movement |
43 |
|
* @param modifiers Bitwise or of SHIFT_MASK, CONTROL_MASK, ALT_MASK |
44 |
|
* @param button The mouse button being pressed. |
45 |
|
*/ |
46 |
public VobMouseEvent( |
public VobMouseEvent( |
47 |
int type, |
int type, |
48 |
int x, |
int x, |
58 |
this.button = button; |
this.button = button; |
59 |
} |
} |
60 |
|
|
61 |
|
public String toString() { |
62 |
|
return "[VobMouseEvent: "+type+" "+x+" "+y+" " |
63 |
|
+wheelDelta+" "+modifiers+" "+button+"]"; |
64 |
|
} |
65 |
|
|
66 |
} |
} |