Last change
on this file since 1097 was 1097, checked in by davidb, 6 years ago |
Newly structured files from Corey's work on logic/graphics separation
|
File size:
762 bytes
|
Line | |
---|
1 | package org.expeditee.gio.gesture.data;
|
---|
2 |
|
---|
3 | import org.expeditee.core.Point;
|
---|
4 | import org.expeditee.gio.EcosystemManager;
|
---|
5 |
|
---|
6 | public class GestureData {
|
---|
7 |
|
---|
8 | /** All gestures have a position. */
|
---|
9 | protected Point _position = null;
|
---|
10 |
|
---|
11 | public GestureData()
|
---|
12 | {
|
---|
13 | // Use the current mouse position
|
---|
14 | _position = EcosystemManager.getInputManager().getCursorPosition();
|
---|
15 | }
|
---|
16 |
|
---|
17 | public GestureData(Point position)
|
---|
18 | {
|
---|
19 | if (position != null) _position = position.clone();
|
---|
20 | }
|
---|
21 |
|
---|
22 | public GestureData(GestureData other)
|
---|
23 | {
|
---|
24 | if (other != null && other._position != null) _position = other._position.clone();
|
---|
25 | }
|
---|
26 |
|
---|
27 | public Point getPosition()
|
---|
28 | {
|
---|
29 | if (_position == null) return null;
|
---|
30 |
|
---|
31 | return _position.clone();
|
---|
32 | }
|
---|
33 |
|
---|
34 | public GestureData clone()
|
---|
35 | {
|
---|
36 | return new GestureData(this);
|
---|
37 | }
|
---|
38 |
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.