picrate 0.0.2-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 (179) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +47 -0
  3. data/.mvn/extensions.xml +9 -0
  4. data/.mvn/wrapper/maven-wrapper.properties +1 -0
  5. data/.travis.yml +10 -0
  6. data/CHANGELOG.md +4 -0
  7. data/LICENSE.md +165 -0
  8. data/README.md +51 -0
  9. data/Rakefile +59 -0
  10. data/bin/picrate +8 -0
  11. data/docs/.gitignore +6 -0
  12. data/docs/_config.yml +30 -0
  13. data/docs/_includes/footer.html +38 -0
  14. data/docs/_includes/head.html +16 -0
  15. data/docs/_includes/header.html +27 -0
  16. data/docs/_includes/icon-github.html +1 -0
  17. data/docs/_includes/icon-github.svg +1 -0
  18. data/docs/_includes/icon-twitter.html +1 -0
  19. data/docs/_includes/icon-twitter.svg +1 -0
  20. data/docs/_includes/navigation.html +24 -0
  21. data/docs/_layouts/default.html +20 -0
  22. data/docs/_layouts/page.html +14 -0
  23. data/docs/_layouts/post.html +15 -0
  24. data/docs/_posts/2018-05-06-getting_started.md +8 -0
  25. data/docs/_posts/2018-05-06-install_jruby.md +35 -0
  26. data/docs/_sass/_base.scss +206 -0
  27. data/docs/_sass/_layout.scss +242 -0
  28. data/docs/_sass/_syntax-highlighting.scss +71 -0
  29. data/docs/about.md +10 -0
  30. data/docs/css/main.scss +38 -0
  31. data/docs/favicon.ico +0 -0
  32. data/docs/feed.xml +30 -0
  33. data/docs/index.html +38 -0
  34. data/lib/picrate.rb +10 -0
  35. data/lib/picrate/app.rb +187 -0
  36. data/lib/picrate/creators/sketch_class.rb +57 -0
  37. data/lib/picrate/creators/sketch_factory.rb +12 -0
  38. data/lib/picrate/creators/sketch_writer.rb +21 -0
  39. data/lib/picrate/helper_methods.rb +214 -0
  40. data/lib/picrate/helpers/numeric.rb +9 -0
  41. data/lib/picrate/library.rb +69 -0
  42. data/lib/picrate/library_loader.rb +53 -0
  43. data/lib/picrate/native_folder.rb +35 -0
  44. data/lib/picrate/native_loader.rb +27 -0
  45. data/lib/picrate/runner.rb +81 -0
  46. data/lib/picrate/version.rb +4 -0
  47. data/library/boids/boids.rb +209 -0
  48. data/library/chooser/chooser.rb +19 -0
  49. data/library/control_panel/control_panel.rb +182 -0
  50. data/library/library_proxy/README.md +99 -0
  51. data/library/library_proxy/library_proxy.rb +14 -0
  52. data/library/slider/slider.rb +42 -0
  53. data/library/vector_utils/vector_utils.rb +69 -0
  54. data/library/video_event/video_event.rb +3 -0
  55. data/license.txt +508 -0
  56. data/picrate.gemspec +35 -0
  57. data/pom.rb +122 -0
  58. data/pom.xml +214 -0
  59. data/src/main/java/japplemenubar/JAppleMenuBar.java +88 -0
  60. data/src/main/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
  61. data/src/main/java/monkstone/ColorUtil.java +115 -0
  62. data/src/main/java/monkstone/MathToolModule.java +236 -0
  63. data/src/main/java/monkstone/PicrateLibrary.java +47 -0
  64. data/src/main/java/monkstone/core/LibraryProxy.java +127 -0
  65. data/src/main/java/monkstone/fastmath/Deglut.java +122 -0
  66. data/src/main/java/monkstone/fastmath/package-info.java +6 -0
  67. data/src/main/java/monkstone/filechooser/Chooser.java +48 -0
  68. data/src/main/java/monkstone/noise/SimplexNoise.java +465 -0
  69. data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +168 -0
  70. data/src/main/java/monkstone/slider/CustomVerticalSlider.java +182 -0
  71. data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +149 -0
  72. data/src/main/java/monkstone/slider/SimpleSlider.java +196 -0
  73. data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +163 -0
  74. data/src/main/java/monkstone/slider/Slider.java +67 -0
  75. data/src/main/java/monkstone/slider/SliderBar.java +277 -0
  76. data/src/main/java/monkstone/slider/SliderGroup.java +78 -0
  77. data/src/main/java/monkstone/slider/WheelHandler.java +35 -0
  78. data/src/main/java/monkstone/vecmath/AppRender.java +87 -0
  79. data/src/main/java/monkstone/vecmath/JRender.java +56 -0
  80. data/src/main/java/monkstone/vecmath/ShapeRender.java +87 -0
  81. data/src/main/java/monkstone/vecmath/package-info.java +20 -0
  82. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +757 -0
  83. data/src/main/java/monkstone/vecmath/vec2/package-info.java +6 -0
  84. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +727 -0
  85. data/src/main/java/monkstone/vecmath/vec3/package-info.java +6 -0
  86. data/src/main/java/monkstone/videoevent/VideoInterface.java +42 -0
  87. data/src/main/java/monkstone/videoevent/package-info.java +20 -0
  88. data/src/main/java/processing/awt/PGraphicsJava2D.java +3098 -0
  89. data/src/main/java/processing/awt/PShapeJava2D.java +401 -0
  90. data/src/main/java/processing/awt/PSurfaceAWT.java +1660 -0
  91. data/src/main/java/processing/core/PApplet.java +17647 -0
  92. data/src/main/java/processing/core/PConstants.java +1033 -0
  93. data/src/main/java/processing/core/PFont.java +1250 -0
  94. data/src/main/java/processing/core/PGraphics.java +9614 -0
  95. data/src/main/java/processing/core/PImage.java +3608 -0
  96. data/src/main/java/processing/core/PMatrix.java +347 -0
  97. data/src/main/java/processing/core/PMatrix2D.java +694 -0
  98. data/src/main/java/processing/core/PMatrix3D.java +1153 -0
  99. data/src/main/java/processing/core/PShape.java +4332 -0
  100. data/src/main/java/processing/core/PShapeOBJ.java +544 -0
  101. data/src/main/java/processing/core/PShapeSVG.java +1987 -0
  102. data/src/main/java/processing/core/PStyle.java +208 -0
  103. data/src/main/java/processing/core/PSurface.java +242 -0
  104. data/src/main/java/processing/core/PSurfaceNone.java +479 -0
  105. data/src/main/java/processing/core/PVector.java +1140 -0
  106. data/src/main/java/processing/data/FloatDict.java +829 -0
  107. data/src/main/java/processing/data/FloatList.java +912 -0
  108. data/src/main/java/processing/data/IntDict.java +796 -0
  109. data/src/main/java/processing/data/IntList.java +913 -0
  110. data/src/main/java/processing/data/JSONArray.java +1260 -0
  111. data/src/main/java/processing/data/JSONObject.java +2282 -0
  112. data/src/main/java/processing/data/JSONTokener.java +435 -0
  113. data/src/main/java/processing/data/Sort.java +46 -0
  114. data/src/main/java/processing/data/StringDict.java +601 -0
  115. data/src/main/java/processing/data/StringList.java +775 -0
  116. data/src/main/java/processing/data/Table.java +4923 -0
  117. data/src/main/java/processing/data/TableRow.java +198 -0
  118. data/src/main/java/processing/data/XML.java +1149 -0
  119. data/src/main/java/processing/event/Event.java +108 -0
  120. data/src/main/java/processing/event/KeyEvent.java +70 -0
  121. data/src/main/java/processing/event/MouseEvent.java +149 -0
  122. data/src/main/java/processing/event/TouchEvent.java +57 -0
  123. data/src/main/java/processing/javafx/PGraphicsFX2D.java +354 -0
  124. data/src/main/java/processing/opengl/FontTexture.java +379 -0
  125. data/src/main/java/processing/opengl/FrameBuffer.java +503 -0
  126. data/src/main/java/processing/opengl/LinePath.java +623 -0
  127. data/src/main/java/processing/opengl/LineStroker.java +685 -0
  128. data/src/main/java/processing/opengl/PGL.java +3366 -0
  129. data/src/main/java/processing/opengl/PGraphics2D.java +615 -0
  130. data/src/main/java/processing/opengl/PGraphics3D.java +281 -0
  131. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13634 -0
  132. data/src/main/java/processing/opengl/PJOGL.java +1966 -0
  133. data/src/main/java/processing/opengl/PShader.java +1478 -0
  134. data/src/main/java/processing/opengl/PShapeOpenGL.java +5234 -0
  135. data/src/main/java/processing/opengl/PSurfaceJOGL.java +1315 -0
  136. data/src/main/java/processing/opengl/Texture.java +1670 -0
  137. data/src/main/java/processing/opengl/VertexBuffer.java +88 -0
  138. data/src/main/java/processing/opengl/cursors/arrow.png +0 -0
  139. data/src/main/java/processing/opengl/cursors/cross.png +0 -0
  140. data/src/main/java/processing/opengl/cursors/hand.png +0 -0
  141. data/src/main/java/processing/opengl/cursors/license.txt +27 -0
  142. data/src/main/java/processing/opengl/cursors/move.png +0 -0
  143. data/src/main/java/processing/opengl/cursors/text.png +0 -0
  144. data/src/main/java/processing/opengl/cursors/wait.png +0 -0
  145. data/src/main/java/processing/opengl/shaders/ColorFrag.glsl +32 -0
  146. data/src/main/java/processing/opengl/shaders/ColorVert.glsl +34 -0
  147. data/src/main/java/processing/opengl/shaders/LightFrag.glsl +33 -0
  148. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +154 -0
  149. data/src/main/java/processing/opengl/shaders/LightVert.glsl +151 -0
  150. data/src/main/java/processing/opengl/shaders/LineFrag.glsl +32 -0
  151. data/src/main/java/processing/opengl/shaders/LineVert.glsl +100 -0
  152. data/src/main/java/processing/opengl/shaders/MaskFrag.glsl +40 -0
  153. data/src/main/java/processing/opengl/shaders/PointFrag.glsl +32 -0
  154. data/src/main/java/processing/opengl/shaders/PointVert.glsl +56 -0
  155. data/src/main/java/processing/opengl/shaders/TexFrag.glsl +37 -0
  156. data/src/main/java/processing/opengl/shaders/TexLightFrag.glsl +37 -0
  157. data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +160 -0
  158. data/src/main/java/processing/opengl/shaders/TexLightVert.glsl +157 -0
  159. data/src/main/java/processing/opengl/shaders/TexVert.glsl +38 -0
  160. data/src/main/resources/icon/icon-1024.png +0 -0
  161. data/src/main/resources/icon/icon-128.png +0 -0
  162. data/src/main/resources/icon/icon-16.png +0 -0
  163. data/src/main/resources/icon/icon-256.png +0 -0
  164. data/src/main/resources/icon/icon-32.png +0 -0
  165. data/src/main/resources/icon/icon-48.png +0 -0
  166. data/src/main/resources/icon/icon-512.png +0 -0
  167. data/src/main/resources/icon/icon-64.png +0 -0
  168. data/src/main/resources/license.txt +508 -0
  169. data/test/create_test.rb +68 -0
  170. data/test/deglut_spec_test.rb +24 -0
  171. data/test/helper_methods_test.rb +58 -0
  172. data/test/math_tool_test.rb +75 -0
  173. data/test/respond_to_test.rb +215 -0
  174. data/test/sketches/key_event.rb +37 -0
  175. data/test/sketches/library/my_library/my_library.rb +32 -0
  176. data/test/test_helper.rb +3 -0
  177. data/test/vecmath_spec_test.rb +522 -0
  178. data/vendors/Rakefile +127 -0
  179. metadata +289 -0
@@ -0,0 +1,208 @@
1
+ /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
+
3
+ /*
4
+ Part of the Processing project - http://processing.org
5
+
6
+ Copyright (c) 2008 Ben Fry and Casey Reas
7
+
8
+ This library is free software; you can redistribute it and/or
9
+ modify it under the terms of the GNU Lesser General Public
10
+ License as published by the Free Software Foundation; either
11
+ version 2.1 of the License, or (at your option) any later version.
12
+
13
+ This library is distributed in the hope that it will be useful,
14
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
+ Lesser General Public License for more details.
17
+
18
+ You should have received a copy of the GNU Lesser General
19
+ Public License along with this library; if not, write to the
20
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21
+ Boston, MA 02111-1307 USA
22
+ */
23
+
24
+ package processing.core;
25
+
26
+ /**
27
+ *
28
+ * @author tux
29
+ */
30
+ public class PStyle implements PConstants {
31
+
32
+ /**
33
+ *
34
+ */
35
+ public int imageMode;
36
+
37
+ /**
38
+ *
39
+ */
40
+ public int rectMode;
41
+
42
+ /**
43
+ *
44
+ */
45
+ public int ellipseMode;
46
+
47
+ /**
48
+ *
49
+ */
50
+ public int shapeMode;
51
+
52
+ /**
53
+ *
54
+ */
55
+ public int blendMode;
56
+
57
+ /**
58
+ *
59
+ */
60
+ public int colorMode;
61
+
62
+ /**
63
+ *
64
+ */
65
+ public float colorModeX;
66
+
67
+ /**
68
+ *
69
+ */
70
+ public float colorModeY;
71
+
72
+ /**
73
+ *
74
+ */
75
+ public float colorModeZ;
76
+
77
+ /**
78
+ *
79
+ */
80
+ public float colorModeA;
81
+
82
+ /**
83
+ *
84
+ */
85
+ public boolean tint;
86
+
87
+ /**
88
+ *
89
+ */
90
+ public int tintColor;
91
+
92
+ /**
93
+ *
94
+ */
95
+ public boolean fill;
96
+
97
+ /**
98
+ *
99
+ */
100
+ public int fillColor;
101
+
102
+ /**
103
+ *
104
+ */
105
+ public boolean stroke;
106
+
107
+ /**
108
+ *
109
+ */
110
+ public int strokeColor;
111
+
112
+ /**
113
+ *
114
+ */
115
+ public float strokeWeight;
116
+
117
+ /**
118
+ *
119
+ */
120
+ public int strokeCap;
121
+
122
+ /**
123
+ *
124
+ */
125
+ public int strokeJoin;
126
+
127
+ // TODO these fellas are inconsistent, and may need to go elsewhere
128
+
129
+ /**
130
+ *
131
+ */
132
+ public float ambientR,
133
+
134
+ /**
135
+ *
136
+ */
137
+ ambientG,
138
+
139
+ /**
140
+ *
141
+ */
142
+ ambientB;
143
+
144
+ /**
145
+ *
146
+ */
147
+ public float specularR,
148
+
149
+ /**
150
+ *
151
+ */
152
+ specularG,
153
+
154
+ /**
155
+ *
156
+ */
157
+ specularB;
158
+
159
+ /**
160
+ *
161
+ */
162
+ public float emissiveR,
163
+
164
+ /**
165
+ *
166
+ */
167
+ emissiveG,
168
+
169
+ /**
170
+ *
171
+ */
172
+ emissiveB;
173
+
174
+ /**
175
+ *
176
+ */
177
+ public float shininess;
178
+
179
+ /**
180
+ *
181
+ */
182
+ public PFont textFont;
183
+
184
+ /**
185
+ *
186
+ */
187
+ public int textAlign;
188
+
189
+ /**
190
+ *
191
+ */
192
+ public int textAlignY;
193
+
194
+ /**
195
+ *
196
+ */
197
+ public int textMode;
198
+
199
+ /**
200
+ *
201
+ */
202
+ public float textSize;
203
+
204
+ /**
205
+ *
206
+ */
207
+ public float textLeading;
208
+ }
@@ -0,0 +1,242 @@
1
+ /* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
+
3
+ /*
4
+ Part of the Processing project - http://processing.org
5
+
6
+ Copyright (c) 2014-15 The Processing Foundation
7
+
8
+ This library is free software; you can redistribute it and/or
9
+ modify it under the terms of the GNU Lesser General Public
10
+ License as published by the Free Software Foundation, version 2.1.
11
+
12
+ This library is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ Lesser General Public License for more details.
16
+
17
+ You should have received a copy of the GNU Lesser General
18
+ Public License along with this library; if not, write to the
19
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20
+ Boston, MA 02111-1307 USA
21
+ */
22
+
23
+ package processing.core;
24
+
25
+ /**
26
+ *
27
+ * @author tux
28
+ */
29
+ public interface PSurface {
30
+ /**
31
+ * Minimum dimensions for the window holding an applet. This varies between
32
+ * platforms, Mac OS X 10.3 (confirmed with 10.7 and Java 6) can do any
33
+ * height but requires at least 128 pixels width. Windows XP has another
34
+ * set of limitations. And for all I know, Linux probably allows window
35
+ * sizes to be negative numbers.
36
+ */
37
+ static public final int MIN_WINDOW_WIDTH = 128;
38
+
39
+ /**
40
+ *
41
+ */
42
+ static public final int MIN_WINDOW_HEIGHT = 128;
43
+
44
+ // renderer that doesn't draw to the screen
45
+
46
+ /**
47
+ *
48
+ * @param sketch
49
+ */
50
+ public void initOffscreen(PApplet sketch);
51
+
52
+ // considering removal in favor of separate Component classes for appropriate renderers
53
+ // (i.e. for Java2D or a generic Image surface, but not PDF, debatable for GL or FX)
54
+ //public Component initComponent(PApplet sketch);
55
+
56
+ //public Frame initFrame(PApplet sketch, Color backgroundColor,
57
+ // public void initFrame(PApplet sketch, int backgroundColor,
58
+ // int deviceIndex, boolean fullScreen, boolean spanDisplays);
59
+
60
+ /**
61
+ *
62
+ * @param sketch
63
+ */
64
+ public void initFrame(PApplet sketch);
65
+
66
+ /**
67
+ * Get the native window object associated with this drawing surface.
68
+ * For Java2D, this will be an AWT Frame object. For OpenGL, the window.
69
+ * The data returned here is subject to the whims of the renderer,
70
+ * and using this method means you're willing to deal with underlying
71
+ * implementation changes and that you won't throw a fit like a toddler
72
+ * if your code breaks sometime in the future.
73
+ * @return
74
+ */
75
+ public Object getNative();
76
+
77
+ //
78
+
79
+ // Just call these on an AWT Frame object stored in PApplet.
80
+ // Silly, but prevents a lot of rewrite and extra methods for little benefit.
81
+ // However, maybe prevents us from having to document the 'frame' variable?
82
+
83
+ /** Set the window (and dock, or whatever necessary) title.
84
+ * @param title */
85
+ public void setTitle(String title);
86
+
87
+ /** Show or hide the window.
88
+ * @param visible */
89
+ public void setVisible(boolean visible);
90
+
91
+ /** Set true if we want to resize things (default is not resizable)
92
+ * @param resizable */
93
+ public void setResizable(boolean resizable);
94
+
95
+ /** Dumb name, but inherited from Frame and no better ideas.
96
+ * @param always */
97
+ public void setAlwaysOnTop(boolean always);
98
+
99
+ /**
100
+ *
101
+ * @param icon
102
+ */
103
+ public void setIcon(PImage icon);
104
+
105
+ //
106
+
107
+ // public void placeWindow(int[] location);
108
+
109
+ /**
110
+ *
111
+ * @param location
112
+ * @param editorLocation
113
+ */
114
+
115
+ public void placeWindow(int[] location, int[] editorLocation);
116
+
117
+ //public void placeFullScreen(boolean hideStop);
118
+
119
+ /**
120
+ *
121
+ * @param stopColor
122
+ */
123
+ public void placePresent(int stopColor);
124
+
125
+ // Sketch is running from the PDE, set up messaging back to the PDE
126
+
127
+ /**
128
+ *
129
+ */
130
+ public void setupExternalMessages();
131
+
132
+ //
133
+
134
+ // sets displayWidth/Height inside PApplet
135
+ //public void checkDisplaySize();
136
+
137
+ /**
138
+ *
139
+ * @param x
140
+ * @param y
141
+ */
142
+
143
+ public void setLocation(int x, int y);
144
+
145
+ /**
146
+ *
147
+ * @param width
148
+ * @param height
149
+ */
150
+ public void setSize(int width, int height);
151
+
152
+ // /**
153
+ // * Called by {@link PApplet#createGraphics} to initialize the
154
+ // * {@link PGraphics#image} object with an image that's compatible with this
155
+ // * drawing surface/display/hardware.
156
+ // * @param gr PGraphics object whose image will be set
157
+ // * @param wide
158
+ // * @param high
159
+ // */
160
+ // create pixel buffer (pulled out for offscreen graphics)
161
+ //public void initImage(PGraphics gr, int wide, int high);
162
+ // create pixel buffer, called from allocate() to produce a compatible image for rendering efficiently
163
+ // public void initImage(PGraphics gr);
164
+
165
+ //public Component getComponent();
166
+
167
+ // /**
168
+ // * Sometimes smoothing must be set at the drawing surface level
169
+ // * not just inside the renderer itself.
170
+ // */
171
+ // public void setSmooth(int level);
172
+
173
+ /**
174
+ *
175
+ * @param fps
176
+ */
177
+
178
+ public void setFrameRate(float fps);
179
+
180
+ // // called on the first frame so that the now-visible drawing surface can
181
+ // // receive key and mouse events
182
+ // public void requestFocus();
183
+
184
+ // // finish rendering to the screen (called by PApplet)
185
+ // public void blit();
186
+
187
+ //
188
+
189
+ /**
190
+ *
191
+ * @param kind
192
+ */
193
+
194
+ public void setCursor(int kind);
195
+
196
+ /**
197
+ *
198
+ * @param image
199
+ * @param hotspotX
200
+ * @param hotspotY
201
+ */
202
+ public void setCursor(PImage image, int hotspotX, int hotspotY);
203
+
204
+ /**
205
+ *
206
+ */
207
+ public void showCursor();
208
+
209
+ /**
210
+ *
211
+ */
212
+ public void hideCursor();
213
+
214
+ //
215
+
216
+ /** Start the animation thread */
217
+ public void startThread();
218
+
219
+ /**
220
+ * On the next trip through the animation thread, things should go sleepy-bye.
221
+ * Does not pause the thread immediately because that needs to happen on the
222
+ * animation thread itself, so fires on the next trip through draw().
223
+ */
224
+ public void pauseThread();
225
+
226
+ /**
227
+ *
228
+ */
229
+ public void resumeThread();
230
+
231
+ /**
232
+ * Stop the animation thread (set it null)
233
+ * @return false if already stopped
234
+ */
235
+ public boolean stopThread();
236
+
237
+ /**
238
+ *
239
+ * @return
240
+ */
241
+ public boolean isStopped();
242
+ }