propane 3.4.1-java → 3.7.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +1 -1
  3. data/.mvn/wrapper/MavenWrapperDownloader.java +2 -2
  4. data/.mvn/wrapper/maven-wrapper.properties +2 -2
  5. data/.travis.yml +1 -1
  6. data/CHANGELOG.md +9 -1
  7. data/Gemfile +2 -0
  8. data/README.md +9 -5
  9. data/Rakefile +10 -11
  10. data/bin/propane +3 -1
  11. data/lib/propane.rb +4 -2
  12. data/lib/propane/app.rb +2 -1
  13. data/lib/propane/creators/sketch_class.rb +7 -1
  14. data/lib/propane/creators/sketch_factory.rb +4 -2
  15. data/lib/propane/creators/sketch_writer.rb +1 -0
  16. data/lib/propane/helper_methods.rb +22 -23
  17. data/lib/propane/helpers/numeric.rb +2 -0
  18. data/lib/propane/helpers/version_error.rb +1 -0
  19. data/lib/propane/library.rb +5 -1
  20. data/lib/propane/library_loader.rb +2 -0
  21. data/lib/propane/native_folder.rb +10 -9
  22. data/lib/propane/native_loader.rb +3 -0
  23. data/lib/propane/runner.rb +20 -14
  24. data/lib/propane/version.rb +2 -1
  25. data/library/boids/boids.rb +21 -11
  26. data/library/color_group/color_group.rb +2 -0
  27. data/library/control_panel/control_panel.rb +8 -5
  28. data/library/dxf/dxf.rb +2 -0
  29. data/library/file_chooser/chooser.rb +10 -9
  30. data/library/file_chooser/file_chooser.rb +10 -9
  31. data/library/library_proxy/library_proxy.rb +2 -0
  32. data/library/net/net.rb +2 -0
  33. data/library/simplex_noise/simplex_noise.rb +2 -0
  34. data/library/slider/slider.rb +23 -22
  35. data/library/vector_utils/vector_utils.rb +4 -0
  36. data/library/video_event/video_event.rb +2 -0
  37. data/pom.rb +37 -36
  38. data/pom.xml +6 -6
  39. data/propane.gemspec +12 -10
  40. data/src/main/java/japplemenubar/JAppleMenuBar.java +3 -3
  41. data/src/main/java/monkstone/ColorUtil.java +1 -3
  42. data/src/main/java/monkstone/MathToolModule.java +10 -9
  43. data/src/main/java/monkstone/PropaneLibrary.java +2 -2
  44. data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
  45. data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
  46. data/src/main/java/monkstone/noise/SimplexNoise.java +2 -2
  47. data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
  48. data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
  49. data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
  50. data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
  51. data/src/main/java/monkstone/slider/SliderBar.java +1 -1
  52. data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
  53. data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
  54. data/src/main/java/monkstone/vecmath/package-info.java +1 -1
  55. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
  56. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -2
  57. data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
  58. data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
  59. data/src/main/java/monkstone/videoevent/package-info.java +1 -1
  60. data/src/main/java/processing/awt/PGraphicsJava2D.java +781 -285
  61. data/src/main/java/processing/awt/PImageAWT.java +377 -0
  62. data/src/main/java/processing/awt/PShapeJava2D.java +56 -52
  63. data/src/main/java/processing/awt/PSurfaceAWT.java +308 -208
  64. data/src/main/java/processing/awt/ShimAWT.java +581 -0
  65. data/src/main/java/processing/core/PApplet.java +4225 -4855
  66. data/src/main/java/processing/core/PConstants.java +477 -447
  67. data/src/main/java/processing/core/PFont.java +914 -880
  68. data/src/main/java/processing/core/PGraphics.java +150 -134
  69. data/src/main/java/processing/core/PImage.java +275 -372
  70. data/src/main/java/processing/core/PMatrix.java +172 -159
  71. data/src/main/java/processing/core/PMatrix2D.java +478 -415
  72. data/src/main/java/processing/core/PMatrix3D.java +762 -735
  73. data/src/main/java/processing/core/PShape.java +2887 -2651
  74. data/src/main/java/processing/core/PShapeOBJ.java +97 -92
  75. data/src/main/java/processing/core/PShapeSVG.java +1705 -1490
  76. data/src/main/java/processing/core/PStyle.java +40 -37
  77. data/src/main/java/processing/core/PSurface.java +139 -97
  78. data/src/main/java/processing/core/PSurfaceNone.java +296 -218
  79. data/src/main/java/processing/core/PVector.java +995 -963
  80. data/src/main/java/processing/core/ThinkDifferent.java +12 -8
  81. data/src/main/java/processing/data/DoubleDict.java +756 -710
  82. data/src/main/java/processing/data/DoubleList.java +749 -696
  83. data/src/main/java/processing/data/FloatDict.java +748 -702
  84. data/src/main/java/processing/data/FloatList.java +751 -697
  85. data/src/main/java/processing/data/IntDict.java +720 -673
  86. data/src/main/java/processing/data/IntList.java +699 -633
  87. data/src/main/java/processing/data/JSONArray.java +931 -873
  88. data/src/main/java/processing/data/JSONObject.java +1262 -1165
  89. data/src/main/java/processing/data/JSONTokener.java +351 -341
  90. data/src/main/java/processing/data/LongDict.java +710 -663
  91. data/src/main/java/processing/data/LongList.java +701 -635
  92. data/src/main/java/processing/data/Sort.java +37 -41
  93. data/src/main/java/processing/data/StringDict.java +525 -486
  94. data/src/main/java/processing/data/StringList.java +626 -580
  95. data/src/main/java/processing/data/Table.java +3690 -3510
  96. data/src/main/java/processing/data/TableRow.java +182 -183
  97. data/src/main/java/processing/data/XML.java +957 -883
  98. data/src/main/java/processing/event/Event.java +87 -67
  99. data/src/main/java/processing/event/KeyEvent.java +48 -41
  100. data/src/main/java/processing/event/MouseEvent.java +88 -113
  101. data/src/main/java/processing/event/TouchEvent.java +10 -6
  102. data/src/main/java/processing/javafx/PGraphicsFX2D.java +20 -345
  103. data/src/main/java/processing/javafx/PSurfaceFX.java +149 -121
  104. data/src/main/java/processing/net/Client.java +20 -20
  105. data/src/main/java/processing/net/Server.java +9 -9
  106. data/src/main/java/processing/opengl/FontTexture.java +286 -266
  107. data/src/main/java/processing/opengl/FrameBuffer.java +389 -377
  108. data/src/main/java/processing/opengl/LinePath.java +132 -89
  109. data/src/main/java/processing/opengl/LineStroker.java +588 -581
  110. data/src/main/java/processing/opengl/PGL.java +660 -567
  111. data/src/main/java/processing/opengl/PGraphics2D.java +408 -315
  112. data/src/main/java/processing/opengl/PGraphics3D.java +107 -72
  113. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12378 -12075
  114. data/src/main/java/processing/opengl/PJOGL.java +1753 -1670
  115. data/src/main/java/processing/opengl/PShader.java +369 -461
  116. data/src/main/java/processing/opengl/PShapeOpenGL.java +4678 -4580
  117. data/src/main/java/processing/opengl/PSurfaceJOGL.java +1114 -1027
  118. data/src/main/java/processing/opengl/Texture.java +1492 -1401
  119. data/src/main/java/processing/opengl/VertexBuffer.java +57 -55
  120. data/test/create_test.rb +21 -20
  121. data/test/deglut_spec_test.rb +4 -2
  122. data/test/helper_methods_test.rb +49 -20
  123. data/test/math_tool_test.rb +39 -32
  124. data/test/native_folder.rb +47 -0
  125. data/test/respond_to_test.rb +3 -2
  126. data/test/sketches/key_event.rb +2 -2
  127. data/test/sketches/library/my_library/my_library.rb +3 -0
  128. data/test/test_helper.rb +2 -0
  129. data/test/vecmath_spec_test.rb +35 -22
  130. data/vendors/Rakefile +35 -40
  131. metadata +42 -22
  132. data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
  133. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
  134. data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
  135. 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
- public long getMillis() {
70
- return millis;
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
- public int getAction() {
77
- return action;
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
- public int getModifiers() {
84
- return modifiers;
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
- public boolean isShiftDown() {
91
- return (modifiers & SHIFT) != 0;
92
- }
93
-
94
- public boolean isControlDown() {
95
- return (modifiers & CTRL) != 0;
96
- }
97
-
98
- public boolean isMetaDown() {
99
- return (modifiers & META) != 0;
100
- }
101
-
102
- public boolean isAltDown() {
103
- return (modifiers & ALT) != 0;
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
- static public final int PRESS = 1;
25
- static public final int RELEASE = 2;
26
- static public final int TYPE = 3;
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
- * Number of clicks for mouse button events, or the number of steps
96
- * (positive or negative depending on direction) for a mouse wheel event.
97
- * Wheel events follow Java (see
98
- * <a href="http://docs.oracle.com/javase/6/docs/api/java/awt/event/MouseWheelEvent.html#getWheelRotation()">here</a>),
99
- * so getAmount() will return "negative values if the mouse wheel was
100
- * rotated up or away from the user" and positive values in the other
101
- * direction. On Mac OS X, this will be reversed when "natural" scrolling is
102
- * enabled in System Preferences &rarr Mouse.
103
- */
104
- public int getCount() {
105
- return count;
106
- }
107
-
108
- // public void setClickCount(int clickCount) {
109
- // this.clickCount = clickCount;
110
- // }
111
- private String actionString() {
112
- switch (action) {
113
- default:
114
- return "UNKNOWN";
115
- case CLICK:
116
- return "CLICK";
117
- case DRAG:
118
- return "DRAG";
119
- case ENTER:
120
- return "ENTER";
121
- case EXIT:
122
- return "EXIT";
123
- case MOVE:
124
- return "MOVE";
125
- case PRESS:
126
- return "PRESS";
127
- case RELEASE:
128
- return "RELEASE";
129
- case WHEEL:
130
- return "WHEEL";
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
- @Override
135
- public String toString() {
136
- return String.format("<MouseEvent %s@%d,%d count:%d button:%d>",
137
- actionString(), x, y, count, button);
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
  }