-
Notifications
You must be signed in to change notification settings - Fork 2
/
mxMouseEvent.d.ts
180 lines (162 loc) · 3.51 KB
/
mxMouseEvent.d.ts
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
/**
* Copyright (c) 2006-2015, JGraph Ltd
* Copyright (c) 2006-2015, Gaudenz Alder
*/
/**
* Class: mxMouseEvent
*
* Base class for all mouse events in mxGraph. A listener for this event should
* implement the following methods:
*
* (code)
* graph.addMouseListener(
* {
* mouseDown: function(sender, evt)
* {
* mxLog.debug('mouseDown');
* },
* mouseMove: function(sender, evt)
* {
* mxLog.debug('mouseMove');
* },
* mouseUp: function(sender, evt)
* {
* mxLog.debug('mouseUp');
* }
* });
* (end)
*
* Constructor: mxMouseEvent
*
* Constructs a new event object for the given arguments.
*
* Parameters:
*
* evt - Native mouse event.
* state - Optional <mxCellState> under the mouse.
*
*/
declare namespace mxgraph {
export class mxMouseEvent {
constructor(evt: Event, state: mxCellState);
/**
* Variable: consumed
*
* Holds the consumed state of this event.
*/
consumed: boolean;
/**
* Variable: evt
*
* Holds the inner event object.
*/
evt: Event;
/**
* Variable: graphX
*
* Holds the x-coordinate of the event in the graph. This value is set in
* <mxGraph.fireMouseEvent>.
*/
graphX: number;
/**
* Variable: graphY
*
* Holds the y-coordinate of the event in the graph. This value is set in
* <mxGraph.fireMouseEvent>.
*/
graphY: number;
/**
* Variable: state
*
* Holds the optional <mxCellState> associated with this event.
*/
state: mxCellState;
/**
* Variable: sourceState
*
* Holds the <mxCellState> that was passed to the constructor. This can be
* different from <state> depending on the result of <mxGraph.getEventState>.
*/
sourceState: mxCellState;
/**
* Function: getEvent
*
* Returns <evt>.
*/
getEvent(): Event
/**
* Function: getSource
*
* Returns the target DOM element using <mxEvent.getSource> for <evt>.
*/
getSource(): Element;
/**
* Function: isSource
*
* Returns true if the given <mxShape> is the source of <evt>.
*/
isSource(shape: mxShape): boolean;
/**
* Function: getX
*
* Returns <evt.clientX>.
*/
getX(): number;
/**
* Function: getY
*
* Returns <evt.clientY>.
*/
getY(): number;
/**
* Function: getGraphX
*
* Returns <graphX>.
*/
getGraphX(): number;
/**
* Function: getGraphY
*
* Returns <graphY>.
*/
getGraphY(): number;
/**
* Function: getState
*
* Returns <state>.
*/
getState(): mxCellState;
/**
* Function: getCell
*
* Returns the <mxCell> in <state> is not null.
*/
getCell(): mxCell;
/**
* Function: isPopupTrigger
*
* Returns true if the event is a popup trigger.
*/
isPopupTrigger(): boolean;
/**
* Function: isConsumed
*
* Returns <consumed>.
*/
isConsumed(): boolean;
/**
* Function: consume
*
* Sets <consumed> to true and invokes preventDefault on the native event
* if such a method is defined. This is used mainly to avoid the cursor from
* being changed to a text cursor in Webkit. You can use the preventDefault
* flag to disable this functionality.
*
* Parameters:
*
* preventDefault - Specifies if the native event should be canceled. Default
* is true.
*/
consume(preventDefault: boolean): void;
}
}