propane 3.10.0-java → 3.11.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  3. data/CHANGELOG.md +2 -0
  4. data/README.md +7 -7
  5. data/lib/propane/app.rb +2 -5
  6. data/lib/propane/helper_methods.rb +6 -6
  7. data/lib/propane/version.rb +1 -1
  8. data/lib/{propane-3.10.0.jar → propane-3.11.0.jar} +0 -0
  9. data/pom.rb +6 -6
  10. data/pom.xml +6 -6
  11. data/propane.gemspec +3 -3
  12. data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
  13. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -13
  14. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +14 -28
  15. data/src/main/java/processing/awt/PImageAWT.java +6 -4
  16. data/src/main/java/processing/core/PApplet.java +71 -59
  17. data/src/main/java/processing/core/PImage.java +14 -14
  18. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
  19. data/src/main/java/processing/opengl/PShader.java +1 -6
  20. data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
  21. data/{lib/java/processing/opengl → src/main/resources}/cursors/arrow.png +0 -0
  22. data/{lib/java/processing/opengl → src/main/resources}/cursors/cross.png +0 -0
  23. data/{lib/java/processing/opengl → src/main/resources}/cursors/hand.png +0 -0
  24. data/{lib/java/processing/opengl → src/main/resources}/cursors/license.txt +0 -0
  25. data/{lib/java/processing/opengl → src/main/resources}/cursors/move.png +0 -0
  26. data/{lib/java/processing/opengl → src/main/resources}/cursors/text.png +0 -0
  27. data/{lib/java/processing/opengl → src/main/resources}/cursors/wait.png +0 -0
  28. data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorFrag.glsl +0 -0
  29. data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorVert.glsl +0 -0
  30. data/{lib/java/processing/opengl → src/main/resources}/shaders/LightFrag.glsl +0 -0
  31. data/{lib/java/processing/opengl → src/main/resources}/shaders/LightVert.glsl +0 -0
  32. data/{lib/java/processing/opengl → src/main/resources}/shaders/LineFrag.glsl +0 -0
  33. data/{lib/java/processing/opengl → src/main/resources}/shaders/LineVert.glsl +0 -0
  34. data/{lib/java/processing/opengl → src/main/resources}/shaders/MaskFrag.glsl +0 -0
  35. data/{lib/java/processing/opengl → src/main/resources}/shaders/PointFrag.glsl +0 -0
  36. data/{lib/java/processing/opengl → src/main/resources}/shaders/PointVert.glsl +0 -0
  37. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexFrag.glsl +0 -0
  38. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightFrag.glsl +0 -0
  39. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightVert.glsl +0 -0
  40. data/{lib/java/processing/opengl → src/main/resources}/shaders/TexVert.glsl +0 -0
  41. data/test/test_helper.rb +1 -0
  42. data/vendors/Rakefile +1 -1
  43. metadata +29 -155
  44. data/lib/java/japplemenubar/JAppleMenuBar.java +0 -88
  45. data/lib/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
  46. data/lib/java/monkstone/ColorUtil.java +0 -127
  47. data/lib/java/monkstone/MathToolModule.java +0 -287
  48. data/lib/java/monkstone/PropaneLibrary.java +0 -46
  49. data/lib/java/monkstone/core/LibraryProxy.java +0 -136
  50. data/lib/java/monkstone/fastmath/DegLutTables.java +0 -111
  51. data/lib/java/monkstone/fastmath/Deglut.java +0 -71
  52. data/lib/java/monkstone/fastmath/package-info.java +0 -6
  53. data/lib/java/monkstone/filechooser/Chooser.java +0 -39
  54. data/lib/java/monkstone/noise/FastTerrain.java +0 -874
  55. data/lib/java/monkstone/noise/Noise.java +0 -90
  56. data/lib/java/monkstone/noise/NoiseGenerator.java +0 -75
  57. data/lib/java/monkstone/noise/NoiseMode.java +0 -28
  58. data/lib/java/monkstone/noise/OpenSimplex2F.java +0 -881
  59. data/lib/java/monkstone/noise/OpenSimplex2S.java +0 -1106
  60. data/lib/java/monkstone/noise/SmoothTerrain.java +0 -1099
  61. data/lib/java/monkstone/slider/CustomHorizontalSlider.java +0 -164
  62. data/lib/java/monkstone/slider/CustomVerticalSlider.java +0 -178
  63. data/lib/java/monkstone/slider/SimpleHorizontalSlider.java +0 -145
  64. data/lib/java/monkstone/slider/SimpleSlider.java +0 -166
  65. data/lib/java/monkstone/slider/SimpleVerticalSlider.java +0 -157
  66. data/lib/java/monkstone/slider/Slider.java +0 -61
  67. data/lib/java/monkstone/slider/SliderBar.java +0 -245
  68. data/lib/java/monkstone/slider/SliderGroup.java +0 -56
  69. data/lib/java/monkstone/slider/WheelHandler.java +0 -35
  70. data/lib/java/monkstone/vecmath/GfxRender.java +0 -86
  71. data/lib/java/monkstone/vecmath/JRender.java +0 -56
  72. data/lib/java/monkstone/vecmath/ShapeRender.java +0 -87
  73. data/lib/java/monkstone/vecmath/package-info.java +0 -20
  74. data/lib/java/monkstone/vecmath/vec2/Vec2.java +0 -802
  75. data/lib/java/monkstone/vecmath/vec2/package-info.java +0 -6
  76. data/lib/java/monkstone/vecmath/vec3/Vec3.java +0 -727
  77. data/lib/java/monkstone/vecmath/vec3/package-info.java +0 -6
  78. data/lib/java/monkstone/videoevent/CaptureEvent.java +0 -27
  79. data/lib/java/monkstone/videoevent/MovieEvent.java +0 -32
  80. data/lib/java/monkstone/videoevent/package-info.java +0 -20
  81. data/lib/java/processing/awt/PGraphicsJava2D.java +0 -3040
  82. data/lib/java/processing/awt/PImageAWT.java +0 -377
  83. data/lib/java/processing/awt/PShapeJava2D.java +0 -387
  84. data/lib/java/processing/awt/PSurfaceAWT.java +0 -1581
  85. data/lib/java/processing/awt/ShimAWT.java +0 -581
  86. data/lib/java/processing/core/PApplet.java +0 -15156
  87. data/lib/java/processing/core/PConstants.java +0 -523
  88. data/lib/java/processing/core/PFont.java +0 -1126
  89. data/lib/java/processing/core/PGraphics.java +0 -8600
  90. data/lib/java/processing/core/PImage.java +0 -3377
  91. data/lib/java/processing/core/PMatrix.java +0 -208
  92. data/lib/java/processing/core/PMatrix2D.java +0 -562
  93. data/lib/java/processing/core/PMatrix3D.java +0 -890
  94. data/lib/java/processing/core/PShape.java +0 -3561
  95. data/lib/java/processing/core/PShapeOBJ.java +0 -483
  96. data/lib/java/processing/core/PShapeSVG.java +0 -2016
  97. data/lib/java/processing/core/PStyle.java +0 -63
  98. data/lib/java/processing/core/PSurface.java +0 -198
  99. data/lib/java/processing/core/PSurfaceNone.java +0 -431
  100. data/lib/java/processing/core/PVector.java +0 -1066
  101. data/lib/java/processing/core/ThinkDifferent.java +0 -115
  102. data/lib/java/processing/data/DoubleDict.java +0 -850
  103. data/lib/java/processing/data/DoubleList.java +0 -928
  104. data/lib/java/processing/data/FloatDict.java +0 -847
  105. data/lib/java/processing/data/FloatList.java +0 -936
  106. data/lib/java/processing/data/IntDict.java +0 -807
  107. data/lib/java/processing/data/IntList.java +0 -936
  108. data/lib/java/processing/data/JSONArray.java +0 -1260
  109. data/lib/java/processing/data/JSONObject.java +0 -2282
  110. data/lib/java/processing/data/JSONTokener.java +0 -435
  111. data/lib/java/processing/data/LongDict.java +0 -802
  112. data/lib/java/processing/data/LongList.java +0 -937
  113. data/lib/java/processing/data/Sort.java +0 -46
  114. data/lib/java/processing/data/StringDict.java +0 -613
  115. data/lib/java/processing/data/StringList.java +0 -800
  116. data/lib/java/processing/data/Table.java +0 -4936
  117. data/lib/java/processing/data/TableRow.java +0 -198
  118. data/lib/java/processing/data/XML.java +0 -1156
  119. data/lib/java/processing/dxf/RawDXF.java +0 -404
  120. data/lib/java/processing/event/Event.java +0 -125
  121. data/lib/java/processing/event/KeyEvent.java +0 -70
  122. data/lib/java/processing/event/MouseEvent.java +0 -114
  123. data/lib/java/processing/event/TouchEvent.java +0 -57
  124. data/lib/java/processing/javafx/PGraphicsFX2D.java +0 -32
  125. data/lib/java/processing/javafx/PSurfaceFX.java +0 -173
  126. data/lib/java/processing/net/Client.java +0 -744
  127. data/lib/java/processing/net/Server.java +0 -388
  128. data/lib/java/processing/opengl/FontTexture.java +0 -378
  129. data/lib/java/processing/opengl/FrameBuffer.java +0 -513
  130. data/lib/java/processing/opengl/LinePath.java +0 -627
  131. data/lib/java/processing/opengl/LineStroker.java +0 -681
  132. data/lib/java/processing/opengl/PGL.java +0 -3483
  133. data/lib/java/processing/opengl/PGraphics2D.java +0 -615
  134. data/lib/java/processing/opengl/PGraphics3D.java +0 -281
  135. data/lib/java/processing/opengl/PGraphicsOpenGL.java +0 -13753
  136. data/lib/java/processing/opengl/PJOGL.java +0 -2008
  137. data/lib/java/processing/opengl/PShader.java +0 -1484
  138. data/lib/java/processing/opengl/PShapeOpenGL.java +0 -5269
  139. data/lib/java/processing/opengl/PSurfaceJOGL.java +0 -1385
  140. data/lib/java/processing/opengl/Texture.java +0 -1696
  141. data/lib/java/processing/opengl/VertexBuffer.java +0 -88
  142. data/lib/java/processing/pdf/PGraphicsPDF.java +0 -581
  143. data/lib/java/processing/svg/PGraphicsSVG.java +0 -378
  144. data/src/main/java/processing/opengl/cursors/arrow.png +0 -0
  145. data/src/main/java/processing/opengl/cursors/cross.png +0 -0
  146. data/src/main/java/processing/opengl/cursors/hand.png +0 -0
  147. data/src/main/java/processing/opengl/cursors/license.txt +0 -27
  148. data/src/main/java/processing/opengl/cursors/move.png +0 -0
  149. data/src/main/java/processing/opengl/cursors/text.png +0 -0
  150. data/src/main/java/processing/opengl/cursors/wait.png +0 -0
  151. data/src/main/java/processing/opengl/shaders/ColorFrag.glsl +0 -32
  152. data/src/main/java/processing/opengl/shaders/ColorVert.glsl +0 -34
  153. data/src/main/java/processing/opengl/shaders/LightFrag.glsl +0 -33
  154. data/src/main/java/processing/opengl/shaders/LightVert.glsl +0 -151
  155. data/src/main/java/processing/opengl/shaders/LineFrag.glsl +0 -32
  156. data/src/main/java/processing/opengl/shaders/LineVert.glsl +0 -100
  157. data/src/main/java/processing/opengl/shaders/MaskFrag.glsl +0 -40
  158. data/src/main/java/processing/opengl/shaders/PointFrag.glsl +0 -32
  159. data/src/main/java/processing/opengl/shaders/PointVert.glsl +0 -56
  160. data/src/main/java/processing/opengl/shaders/TexFrag.glsl +0 -37
  161. data/src/main/java/processing/opengl/shaders/TexLightFrag.glsl +0 -37
  162. data/src/main/java/processing/opengl/shaders/TexLightVert.glsl +0 -157
  163. data/src/main/java/processing/opengl/shaders/TexVert.glsl +0 -38
@@ -400,10 +400,8 @@ public final class Vec2 extends RubyObject {
400
400
 
401
401
  public IRubyObject set_mag(ThreadContext context, IRubyObject scalar, Block block) {
402
402
  double new_mag = scalar.toJava(Double.class);
403
- if (block.isGiven()) {
404
- if (!(boolean) block.yield(context, scalar).toJava(Boolean.class)) {
405
- return this;
406
- }
403
+ if (block.isGiven() && !block.yield(context, scalar).toJava(Boolean.class)) {
404
+ return this;
407
405
  }
408
406
  double current = 0;
409
407
  if (Math.abs(jx) > EPSILON && Math.abs(jy) > EPSILON) {
@@ -559,9 +557,9 @@ public final class Vec2 extends RubyObject {
559
557
  throw runtime.newSyntaxError("Check syntax");
560
558
  }
561
559
  Vec2 vec = (Vec2) args[0].toJava(Vec2.class);
562
- double scalar = (args[1] instanceof RubyFloat)
560
+ double scalar = args[1] instanceof RubyFloat
563
561
  ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
564
- assert (scalar >= 0 && scalar < 1.0) :
562
+ assert scalar >= 0 && scalar < 1.0 :
565
563
  "Lerp value " + scalar + " out of range 0..1.0";
566
564
  return Vec2.rbNew(context, this.getMetaClass(), new IRubyObject[]{
567
565
  runtime.newFloat(jx + (vec.jx - jx) * scalar),
@@ -583,7 +581,7 @@ public final class Vec2 extends RubyObject {
583
581
  Vec2 vec = (Vec2) args[0].toJava(Vec2.class);
584
582
  double scalar = args[1] instanceof RubyFloat
585
583
  ? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
586
- assert (scalar >= 0 && scalar < 1.0) :
584
+ assert scalar >= 0 && scalar < 1.0 :
587
585
  "Lerp value " + scalar + " out of range 0..1.0";
588
586
  jx += (vec.jx - jx) * scalar;
589
587
  jy += (vec.jy - jy) * scalar;
@@ -744,10 +742,8 @@ public final class Vec2 extends RubyObject {
744
742
  }
745
743
  if (obj instanceof Vec2) {
746
744
  final Vec2 other = (Vec2) obj;
747
- if ((Double.compare(jx, (Double) other.jx) == 0)
748
- && (Double.compare(jy, (Double) other.jy) == 0)) {
749
- return true;
750
- }
745
+ return Double.compare(jx, (Double) other.jx) == 0
746
+ && Double.compare(jy, (Double) other.jy) == 0;
751
747
  }
752
748
  return false;
753
749
  }
@@ -793,8 +789,7 @@ public final class Vec2 extends RubyObject {
793
789
  double diff = jx - v.jx;
794
790
  if ((diff < 0 ? -diff : diff) > Vec2.EPSILON) {
795
791
  return runtime.newBoolean(false);
796
- } else {
797
- }
792
+ }
798
793
  diff = jy - v.jy;
799
794
  return runtime.newBoolean((diff < 0 ? -diff : diff) < Vec2.EPSILON);
800
795
  }
@@ -147,11 +147,7 @@ public final class Vec3 extends RubyObject {
147
147
  */
148
148
  @JRubyMethod(name = "x=")
149
149
  public IRubyObject setX(ThreadContext context, IRubyObject other) {
150
- if (other instanceof RubyFloat) {
151
- jx = ((RubyFloat) other).getValue();
152
- } else {
153
- jx = ((RubyFixnum) other).getDoubleValue();
154
- }
150
+ jx = other instanceof RubyFloat ? ((RubyFloat) other).getValue() : ((RubyFixnum) other).getDoubleValue();
155
151
  return other;
156
152
  }
157
153
 
@@ -163,11 +159,7 @@ public final class Vec3 extends RubyObject {
163
159
  */
164
160
  @JRubyMethod(name = "y=")
165
161
  public IRubyObject setY(ThreadContext context, IRubyObject other) {
166
- if (other instanceof RubyFloat) {
167
- jy = ((RubyFloat) other).getValue();
168
- } else {
169
- jy = ((RubyFixnum) other).getDoubleValue();
170
- }
162
+ jy = other instanceof RubyFloat ? ((RubyFloat) other).getValue() : ((RubyFixnum) other).getDoubleValue();
171
163
  return other;
172
164
  }
173
165
 
@@ -179,11 +171,7 @@ public final class Vec3 extends RubyObject {
179
171
  */
180
172
  @JRubyMethod(name = "z=")
181
173
  public IRubyObject setZ(ThreadContext context, IRubyObject other) {
182
- if (other instanceof RubyFloat) {
183
- jz = ((RubyFloat) other).getValue();
184
- } else {
185
- jz = ((RubyFixnum) other).getDoubleValue();
186
- }
174
+ jz = other instanceof RubyFloat ? ((RubyFloat) other).getValue() : ((RubyFixnum) other).getDoubleValue();
187
175
  return other;
188
176
  }
189
177
 
@@ -222,13 +210,13 @@ public final class Vec3 extends RubyObject {
222
210
  Ruby runtime = context.runtime;
223
211
  if (key instanceof RubySymbol) {
224
212
  if (key == RubySymbol.newSymbol(runtime, "x")) {
225
- jx = (value instanceof RubyFloat)
213
+ jx = value instanceof RubyFloat
226
214
  ? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
227
215
  } else if (key == RubySymbol.newSymbol(runtime, "y")) {
228
- jy = (value instanceof RubyFloat)
216
+ jy = value instanceof RubyFloat
229
217
  ? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
230
218
  } else if (key == RubySymbol.newSymbol(runtime, "z")) {
231
- jz = (value instanceof RubyFloat)
219
+ jz = value instanceof RubyFloat
232
220
  ? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
233
221
  } else {
234
222
  throw runtime.newIndexError("invalid key");
@@ -368,7 +356,7 @@ public final class Vec3 extends RubyObject {
368
356
  @JRubyMethod(name = "*", required = 1)
369
357
  public IRubyObject op_mul(ThreadContext context, IRubyObject scalar) {
370
358
  Ruby runtime = context.runtime;
371
- double multi = (scalar instanceof RubyFloat)
359
+ double multi = scalar instanceof RubyFloat
372
360
  ? ((RubyFloat) scalar).getValue() : ((RubyFixnum) scalar).getDoubleValue();
373
361
  return Vec3.rbNew(context, this.getMetaClass(), new IRubyObject[]{
374
362
  runtime.newFloat(jx * multi),
@@ -385,7 +373,7 @@ public final class Vec3 extends RubyObject {
385
373
  @JRubyMethod(name = "/", required = 1)
386
374
  public IRubyObject op_div(ThreadContext context, IRubyObject scalar) {
387
375
  Ruby runtime = context.runtime;
388
- double divisor = (scalar instanceof RubyFloat)
376
+ double divisor = scalar instanceof RubyFloat
389
377
  ? ((RubyFloat) scalar).getValue() : ((RubyFixnum) scalar).getDoubleValue();
390
378
  if (Math.abs(divisor) < Vec3.EPSILON) {
391
379
  return this;
@@ -427,12 +415,10 @@ public final class Vec3 extends RubyObject {
427
415
  */
428
416
  @JRubyMethod(name = "set_mag")
429
417
  public IRubyObject set_mag(ThreadContext context, IRubyObject scalar, Block block) {
430
- if (block.isGiven()) {
431
- if (!(boolean) block.yield(context, scalar).toJava(Boolean.class)) {
432
- return this;
433
- }
418
+ if (block.isGiven() && !block.yield(context, scalar).toJava(Boolean.class)) {
419
+ return this;
434
420
  }
435
- double new_mag = (scalar instanceof RubyFloat)
421
+ double new_mag = scalar instanceof RubyFloat
436
422
  ? ((RubyFloat) scalar).getValue() : ((RubyFixnum) scalar).getDoubleValue();
437
423
  double current = Math.sqrt(jx * jx + jy * jy + jz * jz);
438
424
  if (current > EPSILON) {
@@ -686,9 +672,9 @@ public final class Vec3 extends RubyObject {
686
672
  }
687
673
  if (other instanceof Vec3) {
688
674
  Vec3 v = (Vec3) other.toJava(Vec3.class);
689
- if ((Double.compare(jx, (Double) v.jx) == 0)
690
- && (Double.compare(jy, (Double) v.jy) == 0)
691
- && (Double.compare(jz, (Double) v.jz) == 0)) {
675
+ if (Double.compare(jx, (Double) v.jx) == 0
676
+ && Double.compare(jy, (Double) v.jy) == 0
677
+ && Double.compare(jz, (Double) v.jz) == 0) {
692
678
  return runtime.newBoolean(true);
693
679
  }
694
680
 
@@ -118,6 +118,7 @@ public class PImageAWT extends PImage {
118
118
 
119
119
  /**
120
120
  * Returns a native BufferedImage from this PImage.
121
+ * @return
121
122
  */
122
123
  @Override
123
124
  public Object getNative() { // ignore
@@ -259,11 +260,12 @@ public class PImageAWT extends PImage {
259
260
 
260
261
 
261
262
  /**
262
- * Use ImageIO functions from Java 1.4 and later to handle image save.
263
- * Various formats are supported, typically jpeg, png, bmp, and wbmp.
264
- * To get a list of the supported formats for writing, use: <BR>
265
- * <TT>println(javax.imageio.ImageIO.getReaderFormatNames())</TT>
263
+ * Use ImageIO functions from Java 1.4 and later to handle image save.Various formats are supported, typically jpeg, png, bmp, and wbmp.To get a list of the supported formats for writing, use: <BR>
264
+ <code>println(javax.imageio.ImageIO.getReaderFormatNames())</code>
266
265
  *
266
+ * @param path
267
+ * @return
268
+ * @throws java.io.IOException
267
269
  * @path The path to which the file should be written.
268
270
  */
269
271
  protected boolean saveImageIO(String path) throws IOException {
@@ -1337,17 +1337,19 @@ public class PApplet implements PConstants {
1337
1337
  * @param target the target object that should receive the event
1338
1338
  */
1339
1339
  public void registerMethod(String methodName, Object target) {
1340
- if (methodName.equals("mouseEvent")) {
1341
- registerWithArgs("mouseEvent", target, new Class[]{processing.event.MouseEvent.class});
1342
-
1343
- } else if (methodName.equals("keyEvent")) {
1344
- registerWithArgs("keyEvent", target, new Class[]{processing.event.KeyEvent.class});
1345
-
1346
- } else if (methodName.equals("touchEvent")) {
1347
- registerWithArgs("touchEvent", target, new Class[]{processing.event.TouchEvent.class});
1348
-
1349
- } else {
1350
- registerNoArgs(methodName, target);
1340
+ switch (methodName) {
1341
+ case "mouseEvent":
1342
+ registerWithArgs("mouseEvent", target, new Class[]{processing.event.MouseEvent.class});
1343
+ break;
1344
+ case "keyEvent":
1345
+ registerWithArgs("keyEvent", target, new Class[]{processing.event.KeyEvent.class});
1346
+ break;
1347
+ case "touchEvent":
1348
+ registerWithArgs("touchEvent", target, new Class[]{processing.event.TouchEvent.class});
1349
+ break;
1350
+ default:
1351
+ registerNoArgs(methodName, target);
1352
+ break;
1351
1353
  }
1352
1354
  }
1353
1355
 
@@ -2086,7 +2088,7 @@ public class PApplet implements PConstants {
2086
2088
  + " renderer is not in the class path.");
2087
2089
  }
2088
2090
 
2089
- } catch (Exception e) {
2091
+ } catch (IllegalAccessException | IllegalArgumentException | InstantiationException | NoSuchMethodException | SecurityException e) {
2090
2092
  if ((e instanceof IllegalArgumentException)
2091
2093
  || (e instanceof NoSuchMethodException)
2092
2094
  || (e instanceof IllegalAccessException)) {
@@ -2116,6 +2118,7 @@ public class PApplet implements PConstants {
2116
2118
  /**
2117
2119
  * Create default renderer, likely to be resized, but needed for surface
2118
2120
  * init.
2121
+ * @return
2119
2122
  */
2120
2123
  protected PGraphics createPrimaryGraphics() {
2121
2124
  return makeGraphics(sketchWidth(), sketchHeight(),
@@ -2125,9 +2128,9 @@ public class PApplet implements PConstants {
2125
2128
  /**
2126
2129
  * ( begin auto-generated from createImage.xml )
2127
2130
  *
2128
- * Creates a new PImage (the datatype for storing images). This provides a
2129
- * fresh buffer of pixels to play with. Set the size of the buffer with the
2130
- * <b>width</b> and <b>height</b> parameters. The <b>format</b> parameter
2131
+ * Creates a new PImage (the datatype for storing images).This provides a
2132
+ fresh buffer of pixels to play with. Set the size of the buffer with the
2133
+ <b>width</b> and <b>height</b> parameters. The <b>format</b> parameter
2131
2134
  * defines how the pixels are stored. See the PImage reference for more
2132
2135
  * information.
2133
2136
  *
@@ -2143,6 +2146,7 @@ public class PApplet implements PConstants {
2143
2146
  * to the parent PApplet is included, which makes save() work without
2144
2147
  * needing an absolute path.
2145
2148
  *
2149
+ * @return
2146
2150
  * @webref image
2147
2151
  * @param w width in pixels
2148
2152
  * @param h height in pixels
@@ -2401,6 +2405,7 @@ public class PApplet implements PConstants {
2401
2405
  /**
2402
2406
  * Add an event to the internal event queue, or process it immediately if
2403
2407
  * the sketch is not currently looping.
2408
+ * @param pe
2404
2409
  */
2405
2410
  public void postEvent(processing.event.Event pe) {
2406
2411
  eventQueue.add(pe);
@@ -3187,14 +3192,14 @@ public class PApplet implements PConstants {
3187
3192
  /**
3188
3193
  * ( begin auto-generated from launch.xml )
3189
3194
  *
3190
- * Attempts to open an application or file using your platform's launcher.
3191
- * The <b>file</b> parameter is a String specifying the file name and
3192
- * location. The location parameter must be a full path name, or the name of
3193
- * an executable in the system's PATH. In most cases, using a full path is
3194
- * the best option, rather than relying on the system PATH. Be sure to make
3195
- * the file executable before attempting to open it (chmod +x).
3196
- *
3197
- * The <b>args</b> parameter is a String or String array which is passed to
3195
+ * Attempts to open an application or file using your platform's launcher.The <b>file</b> parameter is a String specifying the file name and
3196
+ location.
3197
+ * The location parameter must be a full path name, or the name of
3198
+ an executable in the system's PATH. In most cases, using a full path is
3199
+ the best option, rather than relying on the system PATH. Be sure to make
3200
+ the file executable before attempting to open it (chmod +x).
3201
+
3202
+ The <b>args</b> parameter is a String or String array which is passed to
3198
3203
  * the command line. If you have multiple parameters, e.g. an application
3199
3204
  * and a document, or a command with multiple switches, use the version that
3200
3205
  * takes a String array, and place each individual item in a separate
@@ -3219,6 +3224,7 @@ public class PApplet implements PConstants {
3219
3224
  *
3220
3225
  * ( end auto-generated )
3221
3226
  *
3227
+ * @return
3222
3228
  * @webref input:files
3223
3229
  * @param args arguments to the launcher, eg. a filename.
3224
3230
  * @usage Application
@@ -3226,42 +3232,44 @@ public class PApplet implements PConstants {
3226
3232
  static public Process launch(String... args) {
3227
3233
  String[] params = null;
3228
3234
 
3229
- if (platform == WINDOWS) {
3230
- // just launching the .html file via the shell works
3231
- // but make sure to chmod +x the .html files first
3232
- // also place quotes around it in case there's a space
3233
- // in the user.dir part of the url
3234
- params = new String[]{"cmd", "/c"};
3235
-
3236
- } else if (platform == MACOS) {
3237
- params = new String[]{"open"};
3238
-
3239
- } else if (platform == LINUX) {
3240
- // xdg-open is in the Free Desktop Specification and really should just
3241
- // work on desktop Linux. Not risking it though.
3242
- final String[] launchers = {"xdg-open", "gnome-open", "kde-open"};
3243
- for (String launcher : launchers) {
3244
- if (openLauncher != null) {
3245
- break;
3246
- }
3247
- try {
3248
- Process p = Runtime.getRuntime().exec(new String[]{launcher});
3249
- /*int result =*/ p.waitFor();
3250
- // Not installed will throw an IOException (JDK 1.4.2, Ubuntu 7.04)
3251
- openLauncher = launcher;
3252
- } catch (Exception e) {
3235
+ switch (platform) {
3236
+ case WINDOWS:
3237
+ // just launching the .html file via the shell works
3238
+ // but make sure to chmod +x the .html files first
3239
+ // also place quotes around it in case there's a space
3240
+ // in the user.dir part of the url
3241
+ params = new String[]{"cmd", "/c"};
3242
+ break;
3243
+ case MACOS:
3244
+ params = new String[]{"open"};
3245
+ break;
3246
+ case LINUX:
3247
+ // xdg-open is in the Free Desktop Specification and really should just
3248
+ // work on desktop Linux. Not risking it though.
3249
+ final String[] launchers = {"xdg-open", "gnome-open", "kde-open"};
3250
+ for (String launcher : launchers) {
3251
+ if (openLauncher != null) {
3252
+ break;
3253
+ }
3254
+ try {
3255
+ Process p = Runtime.getRuntime().exec(new String[]{launcher});
3256
+ /*int result =*/ p.waitFor();
3257
+ // Not installed will throw an IOException (JDK 1.4.2, Ubuntu 7.04)
3258
+ openLauncher = launcher;
3259
+ } catch (Exception e) {
3260
+ }
3261
+ } if (openLauncher == null) {
3262
+ System.err.println("Could not find xdg-open, gnome-open, or kde-open: "
3263
+ + "the open() command may not work.");
3264
+ } if (openLauncher != null) {
3265
+ params = new String[]{openLauncher};
3253
3266
  }
3254
- }
3255
- if (openLauncher == null) {
3256
- System.err.println("Could not find xdg-open, gnome-open, or kde-open: "
3257
- + "the open() command may not work.");
3258
- }
3259
- if (openLauncher != null) {
3260
- params = new String[]{openLauncher};
3261
- }
3262
- //} else { // give up and just pass it to Runtime.exec()
3263
- //open(new String[] { filename });
3264
- //params = new String[] { filename };
3267
+ //} else { // give up and just pass it to Runtime.exec()
3268
+ //open(new String[] { filename });
3269
+ //params = new String[] { filename };
3270
+ break;
3271
+ default:
3272
+ break;
3265
3273
  }
3266
3274
  if (params != null) {
3267
3275
  // If the 'open', 'gnome-open' or 'cmd' are already included
@@ -7135,7 +7143,7 @@ public class PApplet implements PConstants {
7135
7143
  * from a server, or marked in-use if running from a local file system. With
7136
7144
  * this in mind, saving to the data path doesn't make sense anyway. If you
7137
7145
  * know you're running locally, and want to save to the data folder, use
7138
- * <TT>saveXxxx("data/blah.dat")</TT>.
7146
+ * <code>saveXxxx("data/blah.dat")</code>.
7139
7147
  */
7140
7148
  public String savePath(String where) {
7141
7149
  if (where == null) {
@@ -7527,6 +7535,7 @@ public class PApplet implements PConstants {
7527
7535
  }
7528
7536
 
7529
7537
  /**
7538
+ * @param array
7530
7539
  * @nowebref
7531
7540
  */
7532
7541
  static public Object expand(Object array) {
@@ -9649,6 +9658,7 @@ public class PApplet implements PConstants {
9649
9658
  * All parameters *after* the sketch class name are passed to the sketch
9650
9659
  * itself and available from its 'args' array while the sketch is running.
9651
9660
  *
9661
+ * @param args
9652
9662
  * @see PApplet#args
9653
9663
  * </PRE>
9654
9664
  */
@@ -9659,6 +9669,8 @@ public class PApplet implements PConstants {
9659
9669
  /**
9660
9670
  * Convenience method so that PApplet.main(YourSketch.class) launches a
9661
9671
  * sketch, rather than having to call getName() on it.
9672
+ * @param mainClass
9673
+ * @param args
9662
9674
  */
9663
9675
  static public void main(final Class<?> mainClass, String... args) {
9664
9676
  main(mainClass.getName(), args);
@@ -1567,24 +1567,24 @@ public class PImage implements PConstants, Cloneable {
1567
1567
  * Sometimes called "Normal" or "Copy" in other software.
1568
1568
  *
1569
1569
  * <LI>BLEND - linear interpolation of colours:
1570
- * <TT>C = A*factor + B</TT>
1570
+ * <code>C = A*factor + B</code>
1571
1571
  *
1572
1572
  * <LI>ADD - additive blending with white clip:
1573
- * <TT>C = min(A*factor + B, 255)</TT>.
1573
+ * <code>C = min(A*factor + B, 255)</code>.
1574
1574
  * Clipped to 0..255, Photoshop calls this "Linear Burn",
1575
1575
  * and Director calls it "Add Pin".
1576
1576
  *
1577
1577
  * <LI>SUBTRACT - substractive blend with black clip:
1578
- * <TT>C = max(B - A*factor, 0)</TT>.
1578
+ * <code>C = max(B - A*factor, 0)</code>.
1579
1579
  * Clipped to 0..255, Photoshop calls this "Linear Dodge",
1580
1580
  * and Director calls it "Subtract Pin".
1581
1581
  *
1582
1582
  * <LI>DARKEST - only the darkest colour succeeds:
1583
- * <TT>C = min(A*factor, B)</TT>.
1583
+ * <code>C = min(A*factor, B)</code>.
1584
1584
  * Illustrator calls this "Darken".
1585
1585
  *
1586
1586
  * <LI>LIGHTEST - only the lightest colour succeeds:
1587
- * <TT>C = max(A*factor, B)</TT>.
1587
+ * <code>C = max(A*factor, B)</code>.
1588
1588
  * Illustrator calls this "Lighten".
1589
1589
  *
1590
1590
  * <LI>DIFFERENCE - subtract colors from underlying image.
@@ -1615,12 +1615,12 @@ public class PImage implements PConstants, Cloneable {
1615
1615
  * <P>It is important to note that Processing uses "fast" code, not
1616
1616
  * necessarily "correct" code. No biggie, most software does. A nitpicker
1617
1617
  * can find numerous "off by 1 division" problems in the blend code where
1618
- * <TT>&gt;&gt;8</TT> or <TT>&gt;&gt;7</TT> is used when strictly speaking
1619
- * <TT>/255.0</TT> or <TT>/127.0</TT> should have been used.</P>
1618
+ * <code>&gt;&gt;8</code> or <code>&gt;&gt;7</code> is used when strictly speaking
1619
+ * <code>/255.0</code> or <code>/127.0</code> should have been used.</P>
1620
1620
  * <P>For instance, exclusion (not intended for real-time use) reads
1621
- * <TT>r1 + r2 - ((2 * r1 * r2) / 255)</TT> because <TT>255 == 1.0</TT>
1622
- * not <TT>256 == 1.0</TT>. In other words, <TT>(255*255)>>8</TT> is not
1623
- * the same as <TT>(255*255)/255</TT>. But for real-time use the shifts
1621
+ * <code>r1 + r2 - ((2 * r1 * r2) / 255)</code> because <code>255 == 1.0</code>
1622
+ * not <code>256 == 1.0</code>. In other words, <code>(255*255)>>8</code> is not
1623
+ * the same as <code>(255*255)/255</code>. But for real-time use the shifts
1624
1624
  * are preferrable, and the difference is insignificant for applications
1625
1625
  * built with Processing.</P>
1626
1626
  *
@@ -3130,9 +3130,9 @@ int testFunction(int dst, int src) {
3130
3130
  * </p>
3131
3131
  * Starting with revision 0092, the format setting is taken into account:
3132
3132
  * <UL>
3133
- * <LI><TT>ALPHA</TT> images written as 8bit grayscale (uses lowest byte)
3134
- * <LI><TT>RGB</TT> &rarr; 24 bits
3135
- * <LI><TT>ARGB</TT> &rarr; 32 bits
3133
+ * <LI><code>ALPHA</code> images written as 8bit grayscale (uses lowest byte)
3134
+ * <LI><code>RGB</code> &rarr; 24 bits
3135
+ * <LI><code>ARGB</code> &rarr; 32 bits
3136
3136
  * </UL>
3137
3137
  * All versions are RLE compressed.
3138
3138
  *
@@ -3307,7 +3307,7 @@ int testFunction(int dst, int src) {
3307
3307
  * and the extension used is supported (usually png, jpg, jpeg, bmp,
3308
3308
  * and tiff), then those methods will be used to write the image.
3309
3309
  * To get a list of the supported formats for writing, use: <BR>
3310
- * <TT>println(javax.imageio.ImageIO.getReaderFormatNames())</TT>
3310
+ * <code>println(javax.imageio.ImageIO.getReaderFormatNames())</code>
3311
3311
  * <p>
3312
3312
  * To use the original built-in image writers, use .tga or .tif as the
3313
3313
  * extension, or don't include an extension. When no extension is used,
@@ -181,32 +181,32 @@ public class PGraphicsOpenGL extends PGraphics {
181
181
  // Shaders
182
182
 
183
183
  static protected URL defColorShaderVertURL =
184
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/ColorVert.glsl");
184
+ PGraphicsOpenGL.class.getResource("/shaders/ColorVert.glsl");
185
185
  static protected URL defTextureShaderVertURL =
186
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexVert.glsl");
186
+ PGraphicsOpenGL.class.getResource("/shaders/TexVert.glsl");
187
187
  static protected URL defLightShaderVertURL =
188
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LightVert.glsl");
188
+ PGraphicsOpenGL.class.getResource("/shaders/LightVert.glsl");
189
189
  static protected URL defTexlightShaderVertURL =
190
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexLightVert.glsl");
190
+ PGraphicsOpenGL.class.getResource("/shaders/TexLightVert.glsl");
191
191
  static protected URL defColorShaderFragURL =
192
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/ColorFrag.glsl");
192
+ PGraphicsOpenGL.class.getResource("/shaders/ColorFrag.glsl");
193
193
  static protected URL defTextureShaderFragURL =
194
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexFrag.glsl");
194
+ PGraphicsOpenGL.class.getResource("/shaders/TexFrag.glsl");
195
195
  static protected URL defLightShaderFragURL =
196
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LightFrag.glsl");
196
+ PGraphicsOpenGL.class.getResource("/shaders/LightFrag.glsl");
197
197
  static protected URL defTexlightShaderFragURL =
198
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexLightFrag.glsl");
198
+ PGraphicsOpenGL.class.getResource("/shaders/TexLightFrag.glsl");
199
199
 
200
200
  static protected URL defLineShaderVertURL =
201
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LineVert.glsl");
201
+ PGraphicsOpenGL.class.getResource("/shaders/LineVert.glsl");
202
202
  static protected URL defLineShaderFragURL =
203
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LineFrag.glsl");
203
+ PGraphicsOpenGL.class.getResource("/shaders/LineFrag.glsl");
204
204
  static protected URL defPointShaderVertURL =
205
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/PointVert.glsl");
205
+ PGraphicsOpenGL.class.getResource("/shaders/PointVert.glsl");
206
206
  static protected URL defPointShaderFragURL =
207
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/PointFrag.glsl");
207
+ PGraphicsOpenGL.class.getResource("/shaders/PointFrag.glsl");
208
208
  static protected URL maskShaderFragURL =
209
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/MaskFrag.glsl");
209
+ PGraphicsOpenGL.class.getResource("/shaders/MaskFrag.glsl");
210
210
 
211
211
  protected PShader defColorShader;
212
212
  protected PShader defTextureShader;
@@ -988,7 +988,7 @@ public class PShader implements PConstants {
988
988
 
989
989
 
990
990
  /**
991
- * @return
991
+ * @return
992
992
  */
993
993
  protected boolean compileFragmentShader() {
994
994
  pgl.shaderSource(glFragment, PApplet.join(fragmentShaderSource, "\n"));
@@ -1137,11 +1137,6 @@ public class PShader implements PConstants {
1137
1137
  specularLoc = getAttributeLoc("specular");
1138
1138
  emissiveLoc = getAttributeLoc("emissive");
1139
1139
  shininessLoc = getAttributeLoc("shininess");
1140
-
1141
- directionLoc = getAttributeLoc("direction");
1142
-
1143
- offsetLoc = getAttributeLoc("offset");
1144
-
1145
1140
  directionLoc = getAttributeLoc("direction");
1146
1141
  offsetLoc = getAttributeLoc("offset");
1147
1142
 
@@ -184,10 +184,10 @@ public class PSurfaceJOGL implements PSurface {
184
184
  boolean hide = (sketch != null) &&
185
185
  (PApplet.platform == PConstants.WINDOWS);
186
186
  if (hide) setVisible(false);
187
-
187
+
188
188
  ShimAWT.selectFolderImpl(prompt, callbackMethod, file,
189
189
  callbackObject, null);
190
-
190
+
191
191
  if (hide) setVisible(true);
192
192
  });
193
193
  }
@@ -273,7 +273,7 @@ public class PSurfaceJOGL implements PSurface {
273
273
  case 2:
274
274
  try {
275
275
  profile = GLProfile.getGL2ES2();
276
-
276
+
277
277
  // workaround for https://jogamp.org/bugzilla/show_bug.cgi?id=1347
278
278
  if (!profile.isHardwareRasterizer()) {
279
279
  GLProfile hardware = GLProfile.getMaxProgrammable(true);
@@ -281,7 +281,7 @@ public class PSurfaceJOGL implements PSurface {
281
281
  profile = hardware;
282
282
  }
283
283
  }
284
-
284
+
285
285
  } catch (GLException ex) {
286
286
  profile = GLProfile.getMaxProgrammable(true);
287
287
  } break;
@@ -657,7 +657,7 @@ public class PSurfaceJOGL implements PSurface {
657
657
  stream = new FileInputStream(filename);
658
658
  stream.close();
659
659
  return filename;
660
-
660
+
661
661
  } catch (IOException e1) { }
662
662
 
663
663
  } catch (SecurityException se) { } // online, whups
@@ -1309,7 +1309,7 @@ public class PSurfaceJOGL implements PSurface {
1309
1309
  String name = cursorNames.get(kind);
1310
1310
  if (name != null) {
1311
1311
  ImageIcon icon =
1312
- new ImageIcon(getClass().getResource("cursors/" + name + ".png"));
1312
+ new ImageIcon(getClass().getResource("/cursors/" + name + ".png"));
1313
1313
  PImage img = new PImageAWT(icon.getImage());
1314
1314
  // Most cursors just use the center as the hotspot...
1315
1315
  int x = img.width / 2;