-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathMouseEvent.java
More file actions
72 lines (55 loc) · 1.78 KB
/
MouseEvent.java
File metadata and controls
72 lines (55 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package snap.webapi;
/**
* This class is a wrapper for Web API MouseEvent (https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent).
*/
public class MouseEvent extends UIEvent {
// Constants for types
public static final String CLICK = "click";
public static final String MOUSEDOWN = "mousedown";
public static final String MOUSEUP = "mouseup";
public static final String MOUSEOVER = "mouseover";
public static final String MOUSEMOVE = "mousemove";
public static final String MOUSEOUT = "mouseout";
// Constants for buttons
public static final short LEFT_BUTTON = 0;
public static final short MIDDLE_BUTTON = 1;
public static final short RIGHT_BUTTON = 2;
/**
* Constructor.
*/
public MouseEvent(Object eventJS)
{
super(eventJS);
}
/**
* MouseEvent method: getClientX().
*/
public int getClientX() { return getMemberInt("clientX"); }
/**
* MouseEvent method: getClientY().
*/
public int getClientY() { return getMemberInt("clientY"); }
/**
* MouseEvent method: getPageX().
*/
public int getPageX() { return getMemberInt("pageX"); }
/**
* MouseEvent method: getPageY().
*/
public int getPageY() { return getMemberInt("pageY"); }
/**
* MouseEvent method: getScreenX().
*/
public int getScreenX() { return getMemberInt("screenX"); }
/**
* MouseEvent method: getScreenY().
*/
public int getScreenY() { return getMemberInt("screenY"); }
public int getButton() { return getMemberInt("button"); }
public int getButtons() { return getMemberInt("buttons"); }
//int getOffsetX();
//int getOffsetY();
//EventTarget getRelatedTarget();
//double getMovementX();
//double getMovementY();
}