source: main/trunk/model-sites-dev/von-sparql/js/paper/docs/classes/ToolEvent.html@ 28914

Last change on this file since 28914 was 28914, checked in by ak19, 10 years ago

Supporting javascript libraries and bespoke code written by Steffan to support the von-sparql user interface

File size: 6.5 KB
Line 
1<!DOCTYPE html>
2<html>
3<head>
4<meta charset="UTF-8">
5<title>ToolEvent</title>
6<base target="class-frame">
7<link href="../assets/css/docs.css" rel="stylesheet" type="text/css">
8<script src="../assets/js/paper.js"></script>
9<script src="../assets/js/jquery.js"></script>
10<script src="../assets/js/codemirror.js"></script>
11<script src="../assets/js/docs.js"></script>
12</head>
13<body class="reference">
14<div class="reference-class">
15<h1>ToolEvent</h1>
16
17<p> Extends <b><a href="../classes/Event.html"><tt>Event</tt></a></b></p>
18
19<p>ToolEvent The ToolEvent object is received by the <a href="../classes/Tool.html"><tt>Tool</tt></a>'s mouse
20event handlers <a href="../classes/Tool.html#onmousedown"><tt>tool.onMouseDown</tt></a>, <a href="../classes/Tool.html#onmousedrag"><tt>tool.onMouseDrag</tt></a>,
21<a href="../classes/Tool.html#onmousemove"><tt>tool.onMouseMove</tt></a> and <a href="../classes/Tool.html#onmouseup"><tt>tool.onMouseUp</tt></a>. The ToolEvent
22object is the only parameter passed to these functions and contains
23information about the mouse event.</p>
24
25</div>
26
27
28
29
30
31 <div class="reference-members"><h2>Properties</h2>
32
33
34<div id="type" class="member">
35<div class="member-link">
36<a name="type" href="#type"><tt><b>type</b></tt></a>
37</div>
38<div class="member-description hidden">
39
40<div class="member-text">
41 <p>The type of tool event.</p>
42
43
44 <ul><b>Type:</b>
45 <li>
46 <tt>String('mousedown', 'mouseup', 'mousemove', 'mousedrag')</tt>
47 </li>
48 </ul>
49
50
51</div>
52
53</div>
54</div>
55
56
57<div id="point" class="member">
58<div class="member-link">
59<a name="point" href="#point"><tt><b>point</b></tt></a>
60</div>
61<div class="member-description hidden">
62
63<div class="member-text">
64 <p>The position of the mouse in project coordinates when the event was
65fired.</p>
66
67
68 <ul><b>Type:</b>
69 <li>
70 <a href="../classes/Point.html"><tt>Point</tt></a>
71 </li>
72 </ul>
73
74 <p>
75<b>Example</b>
76</p>
77
78
79<pre class="code">function onMouseDrag(event) {
80 // the position of the mouse when it is dragged
81 console.log(event.point);
82}
83
84function onMouseUp(event) {
85 // the position of the mouse when it is released
86 console.log(event.point);
87}</pre>
88
89</div>
90
91</div>
92</div>
93
94
95<div id="lastpoint" class="member">
96<div class="member-link">
97<a name="lastpoint" href="#lastpoint"><tt><b>lastPoint</b></tt></a>
98</div>
99<div class="member-description hidden">
100
101<div class="member-text">
102 <p>The position of the mouse in project coordinates when the previous
103event was fired.</p>
104
105
106 <ul><b>Type:</b>
107 <li>
108 <a href="../classes/Point.html"><tt>Point</tt></a>
109 </li>
110 </ul>
111
112
113</div>
114
115</div>
116</div>
117
118
119<div id="downpoint" class="member">
120<div class="member-link">
121<a name="downpoint" href="#downpoint"><tt><b>downPoint</b></tt></a>
122</div>
123<div class="member-description hidden">
124
125<div class="member-text">
126 <p>The position of the mouse in project coordinates when the mouse button
127was last clicked.</p>
128
129
130 <ul><b>Type:</b>
131 <li>
132 <a href="../classes/Point.html"><tt>Point</tt></a>
133 </li>
134 </ul>
135
136
137</div>
138
139</div>
140</div>
141
142
143<div id="middlepoint" class="member">
144<div class="member-link">
145<a name="middlepoint" href="#middlepoint"><tt><b>middlePoint</b></tt></a>
146</div>
147<div class="member-description hidden">
148
149<div class="member-text">
150 <p>The point in the middle between <a href="../classes/ToolEvent.html#lastpoint" onclick="return toggleMember('lastpoint', true);"><tt>lastPoint</tt></a> and
151<a href="../classes/ToolEvent.html#point" onclick="return toggleMember('point', true);"><tt>point</tt></a>. This is a useful position to use when creating
152artwork based on the moving direction of the mouse, as returned by
153<a href="../classes/ToolEvent.html#delta" onclick="return toggleMember('delta', true);"><tt>delta</tt></a>.</p>
154
155
156 <ul><b>Type:</b>
157 <li>
158 <a href="../classes/Point.html"><tt>Point</tt></a>
159 </li>
160 </ul>
161
162
163</div>
164
165</div>
166</div>
167
168
169<div id="delta" class="member">
170<div class="member-link">
171<a name="delta" href="#delta"><tt><b>delta</b></tt></a>
172</div>
173<div class="member-description hidden">
174
175<div class="member-text">
176 <p>The difference between the current position and the last position of the
177mouse when the event was fired. In case of the mouseup event, the
178difference to the mousedown position is returned.</p>
179
180
181 <ul><b>Type:</b>
182 <li>
183 <a href="../classes/Point.html"><tt>Point</tt></a>
184 </li>
185 </ul>
186
187
188</div>
189
190</div>
191</div>
192
193
194<div id="count" class="member">
195<div class="member-link">
196<a name="count" href="#count"><tt><b>count</b></tt></a>
197</div>
198<div class="member-description hidden">
199
200<div class="member-text">
201 <p>The number of times the mouse event was fired.</p>
202
203
204 <ul><b>Type:</b>
205 <li>
206 <tt>Number</tt>
207 </li>
208 </ul>
209
210
211</div>
212
213</div>
214</div>
215
216
217<div id="item" class="member">
218<div class="member-link">
219<a name="item" href="#item"><tt><b>item</b></tt></a>
220</div>
221<div class="member-description hidden">
222
223<div class="member-text">
224 <p>The item at the position of the mouse (if any).</p>
225<p>If the item is contained within one or more <a href="../classes/Group.html"><tt>Group</tt></a> or
226<a href="../classes/CompoundPath.html"><tt>CompoundPath</tt></a> items, the most top level group or compound path
227that it is contained within is returned.</p>
228
229
230 <ul><b>Type:</b>
231 <li>
232 <a href="../classes/Item.html"><tt>Item</tt></a>
233 </li>
234 </ul>
235
236
237</div>
238
239</div>
240</div>
241
242 </div>
243
244
245
246<!-- ============================== methods ================================ -->
247 <div class="reference-members"><h2>Methods</h2>
248
249
250<div id="tostring" class="member">
251<div class="member-link">
252<a name="tostring" href="#tostring"><tt><b>toString</b>()</tt></a>
253</div>
254<div class="member-description hidden">
255<div class="member-text">
256
257
258
259 <ul><b>Returns:</b>
260
261 <li>
262<tt><tt>String</tt></tt>&nbsp;&mdash;&nbsp;a string representation of the tool event
263</li>
264
265 </ul>
266
267
268
269</div>
270</div>
271</div>
272
273 </div>
274
275
276
277
278<!-- =========================== inherited properties ====================== -->
279<div class="reference-members"><h2>Properties inherited from <a href="../classes/Event.html"><tt>Event</tt></a></h2>
280
281
282<div id="modifiers" class="member">
283<div class="member-link">
284<a name="modifiers" href="#modifiers"><tt><b>modifiers</b></tt></a>
285</div>
286<div class="member-description hidden">
287
288<div class="member-text">
289
290
291 <p>Read only.</p>
292
293
294 <ul><b>Type:</b>
295 <li>
296 <tt>object</tt>
297 </li>
298 </ul>
299
300
301</div>
302
303</div>
304</div>
305
306</div>
307
308
309
310
311<!-- =========================== copyright notice ========================= -->
312<p class="footer">Copyright &#169; 2011 <a href="http://www.lehni.org" target="_blank">J&uuml;rg Lehni</a> &amp; <a href="http://www.jonathanpuckey.com" target="_blank">Jonathan Puckey</a>. All Rights Reserved.</p>
313<div class="content-end"></div>
314
315</body>
Note: See TracBrowser for help on using the repository browser.