propane 3.4.2-java → 3.8.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.mvn/extensions.xml +1 -1
- data/.mvn/wrapper/MavenWrapperDownloader.java +2 -2
- data/.mvn/wrapper/maven-wrapper.properties +2 -2
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -1
- data/Gemfile +2 -0
- data/README.md +7 -10
- data/Rakefile +10 -11
- data/bin/propane +3 -1
- data/lib/propane.rb +4 -2
- data/lib/propane/app.rb +5 -1
- data/lib/propane/creators/sketch_class.rb +7 -1
- data/lib/propane/creators/sketch_factory.rb +4 -2
- data/lib/propane/creators/sketch_writer.rb +1 -0
- data/lib/propane/helper_methods.rb +22 -23
- data/lib/propane/helpers/numeric.rb +2 -0
- data/lib/propane/helpers/version_error.rb +1 -0
- data/lib/propane/library.rb +5 -1
- data/lib/propane/library_loader.rb +2 -0
- data/lib/propane/native_folder.rb +10 -9
- data/lib/propane/native_loader.rb +3 -0
- data/lib/propane/runner.rb +20 -14
- data/lib/propane/version.rb +2 -1
- data/library/boids/boids.rb +21 -11
- data/library/color_group/color_group.rb +2 -0
- data/library/control_panel/control_panel.rb +8 -5
- data/library/dxf/dxf.rb +2 -0
- data/library/file_chooser/chooser.rb +10 -9
- data/library/file_chooser/file_chooser.rb +10 -9
- data/library/library_proxy/library_proxy.rb +2 -0
- data/library/net/net.rb +2 -0
- data/library/slider/slider.rb +23 -22
- data/library/vector_utils/vector_utils.rb +4 -0
- data/library/video_event/video_event.rb +2 -0
- data/pom.rb +37 -36
- data/pom.xml +7 -7
- data/propane.gemspec +13 -9
- data/src/main/java/japplemenubar/JAppleMenuBar.java +3 -3
- data/src/main/java/monkstone/ColorUtil.java +1 -3
- data/src/main/java/monkstone/MathToolModule.java +1 -1
- data/src/main/java/monkstone/PropaneLibrary.java +2 -2
- data/src/main/java/monkstone/fastmath/DegLutTables.java +111 -0
- data/src/main/java/monkstone/fastmath/Deglut.java +6 -56
- data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
- data/src/main/java/monkstone/noise/Noise.java +116 -0
- data/src/main/java/monkstone/noise/NoiseGenerator.java +63 -0
- data/src/main/java/monkstone/noise/NoiseMode.java +15 -0
- data/src/main/java/monkstone/noise/SimplexNoise.java +137 -103
- data/src/main/java/monkstone/noise/ValueNoise.java +170 -0
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
- data/src/main/java/monkstone/vecmath/package-info.java +1 -1
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -2
- data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
- data/src/main/java/monkstone/videoevent/package-info.java +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +781 -285
- data/src/main/java/processing/awt/PImageAWT.java +377 -0
- data/src/main/java/processing/awt/PShapeJava2D.java +56 -52
- data/src/main/java/processing/awt/PSurfaceAWT.java +308 -208
- data/src/main/java/processing/awt/ShimAWT.java +581 -0
- data/src/main/java/processing/core/PApplet.java +13142 -13883
- data/src/main/java/processing/core/PConstants.java +477 -447
- data/src/main/java/processing/core/PFont.java +914 -880
- data/src/main/java/processing/core/PGraphics.java +152 -136
- data/src/main/java/processing/core/PImage.java +275 -372
- data/src/main/java/processing/core/PMatrix.java +172 -159
- data/src/main/java/processing/core/PMatrix2D.java +478 -415
- data/src/main/java/processing/core/PMatrix3D.java +762 -735
- data/src/main/java/processing/core/PShape.java +2887 -2651
- data/src/main/java/processing/core/PShapeOBJ.java +97 -92
- data/src/main/java/processing/core/PShapeSVG.java +1705 -1490
- data/src/main/java/processing/core/PStyle.java +40 -37
- data/src/main/java/processing/core/PSurface.java +139 -97
- data/src/main/java/processing/core/PSurfaceNone.java +296 -218
- data/src/main/java/processing/core/PVector.java +995 -963
- data/src/main/java/processing/core/ThinkDifferent.java +12 -8
- data/src/main/java/processing/data/DoubleDict.java +756 -710
- data/src/main/java/processing/data/DoubleList.java +749 -696
- data/src/main/java/processing/data/FloatDict.java +748 -702
- data/src/main/java/processing/data/FloatList.java +751 -697
- data/src/main/java/processing/data/IntDict.java +720 -673
- data/src/main/java/processing/data/IntList.java +699 -633
- data/src/main/java/processing/data/JSONArray.java +931 -873
- data/src/main/java/processing/data/JSONObject.java +1262 -1165
- data/src/main/java/processing/data/JSONTokener.java +351 -341
- data/src/main/java/processing/data/LongDict.java +710 -663
- data/src/main/java/processing/data/LongList.java +701 -635
- data/src/main/java/processing/data/Sort.java +37 -41
- data/src/main/java/processing/data/StringDict.java +525 -486
- data/src/main/java/processing/data/StringList.java +626 -580
- data/src/main/java/processing/data/Table.java +3690 -3510
- data/src/main/java/processing/data/TableRow.java +182 -183
- data/src/main/java/processing/data/XML.java +957 -883
- data/src/main/java/processing/event/Event.java +87 -67
- data/src/main/java/processing/event/KeyEvent.java +48 -41
- data/src/main/java/processing/event/MouseEvent.java +88 -113
- data/src/main/java/processing/event/TouchEvent.java +10 -6
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +20 -345
- data/src/main/java/processing/javafx/PSurfaceFX.java +149 -121
- data/src/main/java/processing/net/Client.java +20 -20
- data/src/main/java/processing/net/Server.java +9 -9
- data/src/main/java/processing/opengl/FontTexture.java +286 -266
- data/src/main/java/processing/opengl/FrameBuffer.java +389 -377
- data/src/main/java/processing/opengl/LinePath.java +132 -89
- data/src/main/java/processing/opengl/LineStroker.java +588 -581
- data/src/main/java/processing/opengl/PGL.java +660 -567
- data/src/main/java/processing/opengl/PGraphics2D.java +408 -315
- data/src/main/java/processing/opengl/PGraphics3D.java +107 -72
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12378 -12075
- data/src/main/java/processing/opengl/PJOGL.java +1753 -1670
- data/src/main/java/processing/opengl/PShader.java +369 -461
- data/src/main/java/processing/opengl/PShapeOpenGL.java +4678 -4580
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +1114 -1027
- data/src/main/java/processing/opengl/Texture.java +1492 -1401
- data/src/main/java/processing/opengl/VertexBuffer.java +57 -55
- data/test/create_test.rb +21 -20
- data/test/deglut_spec_test.rb +4 -2
- data/test/helper_methods_test.rb +49 -20
- data/test/math_tool_test.rb +39 -32
- data/test/native_folder.rb +47 -0
- data/test/respond_to_test.rb +3 -2
- data/test/sketches/key_event.rb +2 -2
- data/test/sketches/library/my_library/my_library.rb +3 -0
- data/test/test_helper.rb +2 -0
- data/test/vecmath_spec_test.rb +35 -22
- data/vendors/Rakefile +35 -40
- metadata +47 -23
- data/library/simplex_noise/simplex_noise.rb +0 -3
- data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
- data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
- data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
@@ -1,3 +1,5 @@
|
|
1
|
+
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
|
+
|
1
3
|
/*
|
2
4
|
Part of the Processing project - http://processing.org
|
3
5
|
|
@@ -16,90 +18,108 @@
|
|
16
18
|
Public License along with this library; if not, write to the
|
17
19
|
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
18
20
|
Boston, MA 02111-1307 USA
|
19
|
-
|
21
|
+
*/
|
22
|
+
|
20
23
|
package processing.event;
|
21
24
|
|
25
|
+
|
22
26
|
public class Event {
|
27
|
+
protected Object nativeObject;
|
28
|
+
|
29
|
+
protected long millis;
|
30
|
+
protected int action;
|
31
|
+
|
32
|
+
// These correspond to the java.awt.Event modifiers (not to be confused with
|
33
|
+
// the newer getModifiersEx), though they're not guaranteed to in the future.
|
34
|
+
static public final int SHIFT = 1 << 0;
|
35
|
+
static public final int CTRL = 1 << 1;
|
36
|
+
static public final int META = 1 << 2;
|
37
|
+
static public final int ALT = 1 << 3;
|
38
|
+
protected int modifiers;
|
39
|
+
|
40
|
+
// Types of events. As with all constants in Processing, brevity's preferred.
|
41
|
+
static public final int KEY = 1;
|
42
|
+
static public final int MOUSE = 2;
|
43
|
+
static public final int TOUCH = 3;
|
44
|
+
protected int flavor;
|
45
|
+
|
46
|
+
|
47
|
+
public Event(Object nativeObject, long millis, int action, int modifiers) {
|
48
|
+
this.nativeObject = nativeObject;
|
49
|
+
this.millis = millis;
|
50
|
+
this.action = action;
|
51
|
+
this.modifiers = modifiers;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
public int getFlavor() {
|
56
|
+
return flavor;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Get the platform-native event object. This might be the java.awt event
|
62
|
+
* on the desktop, though if you're using OpenGL on the desktop it'll be a
|
63
|
+
* NEWT event that JOGL uses. Android events are something else altogether.
|
64
|
+
* Bottom line, use this only if you know what you're doing, and don't make
|
65
|
+
* assumptions about the class type.
|
66
|
+
*/
|
67
|
+
public Object getNative() {
|
68
|
+
return nativeObject;
|
69
|
+
}
|
23
70
|
|
24
|
-
protected Object nativeObject;
|
25
|
-
|
26
|
-
protected long millis;
|
27
|
-
protected int action;
|
28
|
-
|
29
|
-
// These correspond to the java.awt.Event modifiers (not to be confused with
|
30
|
-
// the newer getModifiersEx), though they're not guaranteed to in the future.
|
31
|
-
static public final int SHIFT = 1;
|
32
|
-
static public final int CTRL = 1 << 1;
|
33
|
-
static public final int META = 1 << 2;
|
34
|
-
static public final int ALT = 1 << 3;
|
35
|
-
protected int modifiers;
|
36
|
-
|
37
|
-
// Types of events. As with all constants in Processing, brevity's preferred.
|
38
|
-
static public final int KEY = 1;
|
39
|
-
static public final int MOUSE = 2;
|
40
|
-
static public final int TOUCH = 3;
|
41
|
-
protected int flavor;
|
42
|
-
|
43
|
-
public Event(Object nativeObject, long millis, int action, int modifiers) {
|
44
|
-
this.nativeObject = nativeObject;
|
45
|
-
this.millis = millis;
|
46
|
-
this.action = action;
|
47
|
-
this.modifiers = modifiers;
|
48
|
-
}
|
49
|
-
|
50
|
-
public int getFlavor() {
|
51
|
-
return flavor;
|
52
|
-
}
|
53
|
-
|
54
|
-
/**
|
55
|
-
* Get the platform-native event object.This might be the java.awt event on
|
56
|
-
the desktop, though if you're using OpenGL on the desktop it'll be a NEWT
|
57
|
-
event that JOGL uses. Android events are something else altogether.
|
58
|
-
Bottom line, use this only if you know what you're doing, and don't make
|
59
|
-
assumptions about the class type.
|
60
|
-
* @return
|
61
|
-
*/
|
62
|
-
public Object getNative() {
|
63
|
-
return nativeObject;
|
64
|
-
}
|
65
71
|
|
66
72
|
// public void setNative(Object nativeObject) {
|
67
73
|
// this.nativeObject = nativeObject;
|
68
74
|
// }
|
69
|
-
|
70
|
-
|
71
|
-
|
75
|
+
|
76
|
+
|
77
|
+
public long getMillis() {
|
78
|
+
return millis;
|
79
|
+
}
|
80
|
+
|
72
81
|
|
73
82
|
// public void setMillis(long millis) {
|
74
83
|
// this.millis = millis;
|
75
84
|
// }
|
76
|
-
|
77
|
-
|
78
|
-
|
85
|
+
|
86
|
+
|
87
|
+
public int getAction() {
|
88
|
+
return action;
|
89
|
+
}
|
90
|
+
|
79
91
|
|
80
92
|
// public void setAction(int action) {
|
81
93
|
// this.action = action;
|
82
94
|
// }
|
83
|
-
|
84
|
-
|
85
|
-
|
95
|
+
|
96
|
+
|
97
|
+
public int getModifiers() {
|
98
|
+
return modifiers;
|
99
|
+
}
|
100
|
+
|
86
101
|
|
87
102
|
// public void setModifiers(int modifiers) {
|
88
103
|
// this.modifiers = modifiers;
|
89
104
|
// }
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
105
|
+
|
106
|
+
|
107
|
+
public boolean isShiftDown() {
|
108
|
+
return (modifiers & SHIFT) != 0;
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
public boolean isControlDown() {
|
113
|
+
return (modifiers & CTRL) != 0;
|
114
|
+
}
|
115
|
+
|
116
|
+
|
117
|
+
public boolean isMetaDown() {
|
118
|
+
return (modifiers & META) != 0;
|
119
|
+
}
|
120
|
+
|
121
|
+
|
122
|
+
public boolean isAltDown() {
|
123
|
+
return (modifiers & ALT) != 0;
|
124
|
+
}
|
125
|
+
}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
|
+
|
1
3
|
/*
|
2
4
|
Part of the Processing project - http://processing.org
|
3
5
|
|
@@ -16,48 +18,53 @@
|
|
16
18
|
Public License along with this library; if not, write to the
|
17
19
|
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
18
20
|
Boston, MA 02111-1307 USA
|
19
|
-
|
21
|
+
*/
|
22
|
+
|
20
23
|
package processing.event;
|
21
24
|
|
25
|
+
|
22
26
|
public class KeyEvent extends Event {
|
27
|
+
static public final int PRESS = 1;
|
28
|
+
static public final int RELEASE = 2;
|
29
|
+
static public final int TYPE = 3;
|
30
|
+
|
31
|
+
char key;
|
32
|
+
int keyCode;
|
33
|
+
|
34
|
+
boolean isAutoRepeat;
|
35
|
+
|
36
|
+
|
37
|
+
public KeyEvent(Object nativeObject,
|
38
|
+
long millis, int action, int modifiers,
|
39
|
+
char key, int keyCode) {
|
40
|
+
super(nativeObject, millis, action, modifiers);
|
41
|
+
this.flavor = KEY;
|
42
|
+
this.key = key;
|
43
|
+
this.keyCode = keyCode;
|
44
|
+
}
|
45
|
+
|
46
|
+
public KeyEvent(Object nativeObject,
|
47
|
+
long millis, int action, int modifiers,
|
48
|
+
char key, int keyCode, boolean isAutoRepeat) {
|
49
|
+
super(nativeObject, millis, action, modifiers);
|
50
|
+
this.flavor = KEY;
|
51
|
+
this.key = key;
|
52
|
+
this.keyCode = keyCode;
|
53
|
+
this.isAutoRepeat = isAutoRepeat;
|
54
|
+
}
|
55
|
+
|
56
|
+
|
57
|
+
public char getKey() {
|
58
|
+
return key;
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
public int getKeyCode() {
|
63
|
+
return keyCode;
|
64
|
+
}
|
65
|
+
|
23
66
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
char key;
|
29
|
-
int keyCode;
|
30
|
-
|
31
|
-
boolean isAutoRepeat;
|
32
|
-
|
33
|
-
public KeyEvent(Object nativeObject,
|
34
|
-
long millis, int action, int modifiers,
|
35
|
-
char key, int keyCode) {
|
36
|
-
super(nativeObject, millis, action, modifiers);
|
37
|
-
this.flavor = KEY;
|
38
|
-
this.key = key;
|
39
|
-
this.keyCode = keyCode;
|
40
|
-
}
|
41
|
-
|
42
|
-
public KeyEvent(Object nativeObject,
|
43
|
-
long millis, int action, int modifiers,
|
44
|
-
char key, int keyCode, boolean isAutoRepeat) {
|
45
|
-
super(nativeObject, millis, action, modifiers);
|
46
|
-
this.flavor = KEY;
|
47
|
-
this.key = key;
|
48
|
-
this.keyCode = keyCode;
|
49
|
-
this.isAutoRepeat = isAutoRepeat;
|
50
|
-
}
|
51
|
-
|
52
|
-
public char getKey() {
|
53
|
-
return key;
|
54
|
-
}
|
55
|
-
|
56
|
-
public int getKeyCode() {
|
57
|
-
return keyCode;
|
58
|
-
}
|
59
|
-
|
60
|
-
public boolean isAutoRepeat() {
|
61
|
-
return isAutoRepeat;
|
62
|
-
}
|
63
|
-
}
|
67
|
+
public boolean isAutoRepeat() {
|
68
|
+
return isAutoRepeat;
|
69
|
+
}
|
70
|
+
}
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
|
+
|
1
3
|
/*
|
2
4
|
Part of the Processing project - http://processing.org
|
3
5
|
|
@@ -16,124 +18,97 @@
|
|
16
18
|
Public License along with this library; if not, write to the
|
17
19
|
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
18
20
|
Boston, MA 02111-1307 USA
|
19
|
-
|
21
|
+
*/
|
22
|
+
|
20
23
|
package processing.event;
|
21
24
|
|
22
25
|
//import processing.core.PConstants;
|
23
|
-
public class MouseEvent extends Event {
|
24
|
-
|
25
|
-
static public final int PRESS = 1;
|
26
|
-
static public final int RELEASE = 2;
|
27
|
-
static public final int CLICK = 3;
|
28
|
-
static public final int DRAG = 4;
|
29
|
-
static public final int MOVE = 5;
|
30
|
-
static public final int ENTER = 6;
|
31
|
-
static public final int EXIT = 7;
|
32
|
-
static public final int WHEEL = 8;
|
33
|
-
|
34
|
-
protected int x, y;
|
35
|
-
protected int button;
|
36
|
-
// protected int clickCount;
|
37
|
-
// protected float amount;
|
38
|
-
protected int count;
|
39
|
-
|
40
|
-
// public MouseEvent(int x, int y) {
|
41
|
-
// this(null,
|
42
|
-
// System.currentTimeMillis(), PRESSED, 0,
|
43
|
-
// x, y, PConstants.LEFT, 1);
|
44
|
-
// }
|
45
|
-
public MouseEvent(Object nativeObject,
|
46
|
-
long millis, int action, int modifiers,
|
47
|
-
int x, int y, int button, int count) { //float amount) { //int clickCount) {
|
48
|
-
super(nativeObject, millis, action, modifiers);
|
49
|
-
this.flavor = MOUSE;
|
50
|
-
this.x = x;
|
51
|
-
this.y = y;
|
52
|
-
this.button = button;
|
53
|
-
//this.clickCount = clickCount;
|
54
|
-
//this.amount = amount;
|
55
|
-
this.count = count;
|
56
|
-
}
|
57
|
-
|
58
|
-
public int getX() {
|
59
|
-
return x;
|
60
|
-
}
|
61
|
-
|
62
|
-
public int getY() {
|
63
|
-
return y;
|
64
|
-
}
|
65
26
|
|
66
|
-
/**
|
67
|
-
* Which button was pressed, either LEFT, CENTER, or RIGHT.
|
68
|
-
*/
|
69
|
-
public int getButton() {
|
70
|
-
return button;
|
71
|
-
}
|
72
|
-
|
73
|
-
// public void setButton(int button) {
|
74
|
-
// this.button = button;
|
75
|
-
// }
|
76
|
-
/**
|
77
|
-
* Do not use, getCount() is the correct method.
|
78
|
-
*/
|
79
|
-
@Deprecated
|
80
|
-
public int getClickCount() {
|
81
|
-
//return (int) amount; //clickCount;
|
82
|
-
return count;
|
83
|
-
}
|
84
|
-
|
85
|
-
/**
|
86
|
-
* Do not use, getCount() is the correct method.
|
87
|
-
*/
|
88
|
-
@Deprecated
|
89
|
-
public float getAmount() {
|
90
|
-
//return amount;
|
91
|
-
return count;
|
92
|
-
}
|
93
27
|
|
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
|
-
|
28
|
+
public class MouseEvent extends Event {
|
29
|
+
static public final int PRESS = 1;
|
30
|
+
static public final int RELEASE = 2;
|
31
|
+
static public final int CLICK = 3;
|
32
|
+
static public final int DRAG = 4;
|
33
|
+
static public final int MOVE = 5;
|
34
|
+
static public final int ENTER = 6;
|
35
|
+
static public final int EXIT = 7;
|
36
|
+
static public final int WHEEL = 8;
|
37
|
+
|
38
|
+
protected int x, y;
|
39
|
+
protected int button;
|
40
|
+
protected int count;
|
41
|
+
|
42
|
+
|
43
|
+
public MouseEvent(Object nativeObject,
|
44
|
+
long millis, int action, int modifiers,
|
45
|
+
int x, int y, int button, int count) {
|
46
|
+
super(nativeObject, millis, action, modifiers);
|
47
|
+
this.flavor = MOUSE;
|
48
|
+
this.x = x;
|
49
|
+
this.y = y;
|
50
|
+
this.button = button;
|
51
|
+
this.count = count;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
public int getX() {
|
56
|
+
return x;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
public int getY() {
|
61
|
+
return y;
|
62
|
+
}
|
63
|
+
|
64
|
+
|
65
|
+
/** Which button was pressed, either LEFT, CENTER, or RIGHT.
|
66
|
+
* @return */
|
67
|
+
public int getButton() {
|
68
|
+
return button;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Number of clicks for mouse button events, or the number of steps (positive
|
74
|
+
* or negative depending on direction) for a mouse wheel event.Wheel events follow Java (see <a href="http://docs.oracle.com/javase/6/docs/api/java/awt/event/MouseWheelEvent.html#getWheelRotation()">here</a>), so
|
75
|
+
getAmount() will return "negative values if the mouse wheel was rotated
|
76
|
+
up or away from the user" and positive values in the other direction.
|
77
|
+
* On Mac OS X, this will be reversed when "natural" scrolling is enabled
|
78
|
+
in System Preferences &rarr Mouse.
|
79
|
+
* @return
|
80
|
+
*/
|
81
|
+
public int getCount() {
|
82
|
+
return count;
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
private String actionString() {
|
87
|
+
switch (action) {
|
88
|
+
default:
|
89
|
+
return "UNKNOWN";
|
90
|
+
case CLICK:
|
91
|
+
return "CLICK";
|
92
|
+
case DRAG:
|
93
|
+
return "DRAG";
|
94
|
+
case ENTER:
|
95
|
+
return "ENTER";
|
96
|
+
case EXIT:
|
97
|
+
return "EXIT";
|
98
|
+
case MOVE:
|
99
|
+
return "MOVE";
|
100
|
+
case PRESS:
|
101
|
+
return "PRESS";
|
102
|
+
case RELEASE:
|
103
|
+
return "RELEASE";
|
104
|
+
case WHEEL:
|
105
|
+
return "WHEEL";
|
132
106
|
}
|
107
|
+
}
|
133
108
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
109
|
+
@Override
|
110
|
+
public String toString() {
|
111
|
+
return String.format("<MouseEvent %s@%d,%d count:%d button:%d>",
|
112
|
+
actionString(), x, y, count, button);
|
113
|
+
}
|
139
114
|
}
|