picrate 2.0.0.pre-java → 2.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +1 -1
  3. data/.mvn/wrapper/MavenWrapperDownloader.java +1 -1
  4. data/.mvn/wrapper/maven-wrapper.properties +2 -2
  5. data/CHANGELOG.md +10 -0
  6. data/README.md +11 -9
  7. data/Rakefile +9 -8
  8. data/docs/_config.yml +1 -1
  9. data/docs/_editors/geany.md +1 -0
  10. data/docs/_gems/gems/gems.md +1 -1
  11. data/docs/_methods/alternative_methods.md +2 -1
  12. data/docs/_posts/2018-05-06-getting_started.md +4 -4
  13. data/docs/_posts/2018-05-06-install_jruby.md +5 -11
  14. data/docs/_posts/2018-05-11-arch-linux-arm.md +1 -11
  15. data/docs/_posts/2018-11-18-building-gem.md +4 -2
  16. data/docs/_posts/2018-11-27-getting_started_geany.md +1 -1
  17. data/docs/_posts/2019-11-11-getting_started_buster.md +4 -7
  18. data/docs/_posts/{2018-06-26-auto_install_picrate.md → 2020-03-09-auto_install_picrate.md} +9 -6
  19. data/docs/_posts/2020-05-11-getting_started_manjaro.md +106 -0
  20. data/docs/about.md +1 -1
  21. data/lib/picrate.rb +2 -1
  22. data/lib/picrate/app.rb +1 -0
  23. data/lib/picrate/helper_methods.rb +1 -1
  24. data/lib/picrate/native_folder.rb +6 -7
  25. data/lib/picrate/runner.rb +4 -4
  26. data/lib/picrate/version.rb +1 -1
  27. data/library/jcomplex/jcomplex.rb +1 -0
  28. data/mvnw +2 -2
  29. data/mvnw.cmd +2 -2
  30. data/picrate.gemspec +3 -5
  31. data/pom.rb +18 -15
  32. data/pom.xml +20 -8
  33. data/src/main/java/monkstone/complex/JComplex.java +252 -0
  34. data/src/main/java/processing/awt/PGraphicsJava2D.java +22 -23
  35. data/src/main/java/processing/awt/PImageAWT.java +377 -0
  36. data/src/main/java/processing/awt/ShimAWT.java +545 -0
  37. data/src/main/java/processing/core/PApplet.java +2030 -2556
  38. data/src/main/java/processing/core/PGraphics.java +138 -124
  39. data/src/main/java/processing/core/PImage.java +1517 -1702
  40. data/src/main/java/processing/core/PSurface.java +105 -139
  41. data/src/main/java/processing/core/PSurfaceNone.java +29 -0
  42. data/src/main/java/processing/opengl/PGL.java +649 -3699
  43. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +223 -184
  44. data/src/main/java/processing/opengl/PJOGL.java +374 -1526
  45. data/src/main/java/processing/opengl/PShapeOpenGL.java +5 -6
  46. data/src/main/java/processing/opengl/PSurfaceJOGL.java +220 -86
  47. data/vendors/Rakefile +33 -21
  48. data/vendors/{picrate_sketches.geany → geany.rb} +32 -7
  49. metadata +17 -48
  50. data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
  51. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
  52. data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
  53. data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
@@ -207,12 +207,12 @@ public class PGraphics extends PImage implements PConstants {
207
207
  /**
208
208
  * Array of hint[] items. These are hacks to get around various
209
209
  * temporary workarounds inside the environment.
210
- *
210
+ *
211
211
  * Note that this array cannot be static, as a hint() may result in a
212
212
  * runtime change specific to a renderer. For instance, calling
213
213
  * hint(DISABLE_DEPTH_TEST) has to call glDisable() right away on an
214
214
  * instance of PGraphicsOpenGL.
215
- *
215
+ *
216
216
  * The hints[] array is allocated early on because it might
217
217
  * be used inside beginDraw(), allocate(), etc.
218
218
  */
@@ -570,7 +570,7 @@ public class PGraphics extends PImage implements PConstants {
570
570
 
571
571
  // vertices
572
572
  public static final int DEFAULT_VERTICES = 512;
573
- protected float vertices[][] =
573
+ protected float[][] vertices =
574
574
  new float[DEFAULT_VERTICES][VERTEX_FIELD_COUNT];
575
575
  protected int vertexCount; // total number of vertices
576
576
 
@@ -605,7 +605,7 @@ public class PGraphics extends PImage implements PConstants {
605
605
 
606
606
  // spline vertices
607
607
 
608
- protected float curveVertices[][];
608
+ protected float[][] curveVertices;
609
609
  protected int curveVertexCount;
610
610
 
611
611
  // ........................................................
@@ -618,16 +618,16 @@ public class PGraphics extends PImage implements PConstants {
618
618
  // [toxi 031031]
619
619
  // changed table's precision to 0.5 degree steps
620
620
  // introduced new vars for more flexible code
621
- static final protected float SIN_LUT[];
622
- static final protected float COS_LUT[];
621
+ static final protected float[] sinLUT;
622
+ static final protected float[] cosLUT;
623
623
  static final protected float SINCOS_PRECISION = 0.5f;
624
624
  static final protected int SINCOS_LENGTH = (int) (360f / SINCOS_PRECISION);
625
625
  static {
626
- SIN_LUT = new float[SINCOS_LENGTH];
627
- COS_LUT = new float[SINCOS_LENGTH];
626
+ sinLUT = new float[SINCOS_LENGTH];
627
+ cosLUT = new float[SINCOS_LENGTH];
628
628
  for (int i = 0; i < SINCOS_LENGTH; i++) {
629
- SIN_LUT[i] = (float) Math.sin(i * DEG_TO_RAD * SINCOS_PRECISION);
630
- COS_LUT[i] = (float) Math.cos(i * DEG_TO_RAD * SINCOS_PRECISION);
629
+ sinLUT[i] = (float) Math.sin(i * DEG_TO_RAD * SINCOS_PRECISION);
630
+ cosLUT[i] = (float) Math.cos(i * DEG_TO_RAD * SINCOS_PRECISION);
631
631
  }
632
632
  }
633
633
 
@@ -702,7 +702,9 @@ public class PGraphics extends PImage implements PConstants {
702
702
 
703
703
  // [toxi031031] new & faster sphere code w/ support flexible resolutions
704
704
  // will be set by sphereDetail() or 1st call to sphere()
705
- protected float sphereX[], sphereY[], sphereZ[];
705
+ protected float[] sphereX;
706
+ protected float[] sphereY;
707
+ protected float[] sphereZ;
706
708
 
707
709
  /// Number of U steps (aka "theta") around longitudinally spanning 2*pi
708
710
  public int sphereDetailU = 0;
@@ -765,15 +767,14 @@ public class PGraphics extends PImage implements PConstants {
765
767
 
766
768
 
767
769
  /**
768
- * The final step in setting up a renderer, set its size of this renderer.
769
- * This was formerly handled by the constructor, but instead it's been broken
770
- * out so that setParent/setPrimary/setPath can be handled differently.
771
- *
772
- * Important: this is ignored by the Methods task because otherwise it will
773
- * override setSize() in PApplet/Applet/Component, which will 1) not call
774
- * super.setSize(), and 2) will cause the renderer to be resized from the
775
- * event thread (EDT), causing a nasty crash as it collides with the
776
- * animation thread.
770
+ * The final step in setting up a renderer, set its size of this renderer.This was formerly handled by the constructor, but instead it's been broken
771
+ out so that setParent/setPrimary/setPath can be handled differently.Important: this is ignored by the Methods task because otherwise it will
772
+ override setSize() in PApplet/Applet/Component, which will 1) not call
773
+ super.setSize(), and 2) will cause the renderer to be resized from the
774
+ event thread (EDT), causing a nasty crash as it collides with the
775
+ animation thread.
776
+ * @param w
777
+ * @param h
777
778
  */
778
779
  public void setSize(int w, int h) { // ignore
779
780
  width = w;
@@ -842,10 +843,11 @@ public class PGraphics extends PImage implements PConstants {
842
843
 
843
844
 
844
845
  /**
845
- * Get cache storage data for the specified renderer. Because each renderer
846
- * will cache data in different formats, it's necessary to store cache data
847
- * keyed by the renderer object. Otherwise, attempting to draw the same
848
- * image to both a PGraphicsJava2D and a PGraphicsOpenGL will cause errors.
846
+ * Get cache storage data for the specified renderer.Because each renderer
847
+ will cache data in different formats, it's necessary to store cache data
848
+ keyed by the renderer object. Otherwise, attempting to draw the same
849
+ image to both a PGraphicsJava2D and a PGraphicsOpenGL will cause errors.
850
+ * @param image
849
851
  * @return metadata stored for the specified renderer
850
852
  */
851
853
  public Object getCache(PImage image) { // ignore
@@ -911,7 +913,7 @@ public class PGraphics extends PImage implements PConstants {
911
913
  *
912
914
  * ( end auto-generated )
913
915
  * <h3>Advanced</h3>
914
- *
916
+ *
915
917
  * When creating your own PGraphics, you should call this when
916
918
  * you're finished drawing.
917
919
  *
@@ -1088,7 +1090,7 @@ public class PGraphics extends PImage implements PConstants {
1088
1090
  * obscure rendering features that cannot be implemented in a consistent
1089
1091
  * manner across renderers. Many options will often graduate to standard
1090
1092
  * features instead of hints over time.
1091
- *
1093
+ *
1092
1094
  * hint(ENABLE_OPENGL_4X_SMOOTH) - Enable 4x anti-aliasing for P3D. This
1093
1095
  * can help force anti-aliasing if it has not been enabled by the user. On
1094
1096
  * some graphics cards, this can also be set by the graphics driver's
@@ -1096,13 +1098,13 @@ public class PGraphics extends PImage implements PConstants {
1096
1098
  * be called immediately after the size() command because it resets the
1097
1099
  * renderer, obliterating any settings and anything drawn (and like size(),
1098
1100
  * re-running the code that came before it again).
1099
- *
1101
+ *
1100
1102
  * hint(DISABLE_OPENGL_2X_SMOOTH) - In Processing 1.0, Processing always
1101
1103
  * enables 2x smoothing when the P3D renderer is used. This hint disables
1102
1104
  * the default 2x smoothing and returns the smoothing behavior found in
1103
1105
  * earlier releases, where smooth() and noSmooth() could be used to enable
1104
1106
  * and disable smoothing, though the quality was inferior.
1105
- *
1107
+ *
1106
1108
  * hint(ENABLE_NATIVE_FONTS) - Use the native version fonts when they are
1107
1109
  * installed, rather than the bitmapped version from a .vlw file. This is
1108
1110
  * useful with the default (or JAVA2D) renderer setting, as it will improve
@@ -1111,7 +1113,7 @@ public class PGraphics extends PImage implements PConstants {
1111
1113
  * machine (because you have the font installed) but lousy on others'
1112
1114
  * machines if the identical font is unavailable. This option can only be
1113
1115
  * set per-sketch, and must be called before any use of textFont().
1114
- *
1116
+ *
1115
1117
  * hint(DISABLE_DEPTH_TEST) - Disable the zbuffer, allowing you to draw on
1116
1118
  * top of everything at will. When depth testing is disabled, items will be
1117
1119
  * drawn to the screen sequentially, like a painting. This hint is most
@@ -1121,14 +1123,14 @@ public class PGraphics extends PImage implements PConstants {
1121
1123
  * hint(ENABLE_DEPTH_TEST), but note that with the depth buffer cleared,
1122
1124
  * any 3D drawing that happens later in draw() will ignore existing shapes
1123
1125
  * on the screen.
1124
- *
1126
+ *
1125
1127
  * hint(ENABLE_DEPTH_SORT) - Enable primitive z-sorting of triangles and
1126
1128
  * lines in P3D and OPENGL. This can slow performance considerably, and the
1127
1129
  * algorithm is not yet perfect. Restore the default with hint(DISABLE_DEPTH_SORT).
1128
- *
1130
+ *
1129
1131
  * hint(DISABLE_OPENGL_ERROR_REPORT) - Speeds up the P3D renderer setting
1130
1132
  * by not checking for errors while running. Undo with hint(ENABLE_OPENGL_ERROR_REPORT).
1131
- *
1133
+ *
1132
1134
  * hint(ENABLE_BUFFER_READING) - Depth and stencil buffers in P2D/P3D will be
1133
1135
  * downsampled to make PGL#readPixels work with multisampling. Enabling this
1134
1136
  * introduces some overhead, so if you experience bad performance, disable
@@ -1137,17 +1139,17 @@ public class PGraphics extends PImage implements PConstants {
1137
1139
  * creating your PGraphics2D/3D. You can restore the default with
1138
1140
  * hint(DISABLE_BUFFER_READING) if you don't plan to read depth from
1139
1141
  * this PGraphics anymore.
1140
- *
1142
+ *
1141
1143
  * hint(ENABLE_KEY_REPEAT) - Auto-repeating key events are discarded
1142
1144
  * by default (works only in P2D/P3D); use this hint to get all the key events
1143
1145
  * (including auto-repeated). Call hint(DISABLE_KEY_REPEAT) to get events
1144
1146
  * only when the key goes physically up or down.
1145
- *
1147
+ *
1146
1148
  * hint(DISABLE_ASYNC_SAVEFRAME) - P2D/P3D only - save() and saveFrame()
1147
1149
  * will not use separate threads for saving and will block until the image
1148
1150
  * is written to the drive. This was the default behavior in 3.0b7 and before.
1149
1151
  * To enable, call hint(ENABLE_ASYNC_SAVEFRAME).
1150
- *
1152
+ *
1151
1153
  * As of release 0149, unhint() has been removed in favor of adding
1152
1154
  * additional ENABLE/DISABLE constants to reset the default behavior. This
1153
1155
  * prevents the double negatives, and also reinforces which hints can be
@@ -1209,12 +1211,12 @@ public class PGraphics extends PImage implements PConstants {
1209
1211
  * specifies a position in 2D and the <b>vertex()</b> function with three
1210
1212
  * parameters specifies a position in 3D. Each shape will be outlined with
1211
1213
  * the current stroke color and filled with the fill color.
1212
- *
1214
+ *
1213
1215
  * Transformations such as <b>translate()</b>, <b>rotate()</b>, and
1214
1216
  * <b>scale()</b> do not work within <b>beginShape()</b>. It is also not
1215
1217
  * possible to use other shapes, such as <b>ellipse()</b> or <b>rect()</b>
1216
1218
  * within <b>beginShape()</b>.
1217
- *
1219
+ *
1218
1220
  * The P3D renderer settings allow <b>stroke()</b> and <b>fill()</b>
1219
1221
  * settings to be altered per-vertex, however the default P2D renderer does
1220
1222
  * not. Settings such as <b>strokeWeight()</b>, <b>strokeCap()</b>, and
@@ -1236,8 +1238,8 @@ public class PGraphics extends PImage implements PConstants {
1236
1238
 
1237
1239
 
1238
1240
  /**
1239
- * Sets whether the upcoming vertex is part of an edge.
1240
- * Equivalent to glEdgeFlag(), for people familiar with OpenGL.
1241
+ * Sets whether the upcoming vertex is part of an edge.Equivalent to glEdgeFlag(), for people familiar with OpenGL.
1242
+ * @param edge
1241
1243
  */
1242
1244
  public void edge(boolean edge) {
1243
1245
  this.edge = edge;
@@ -1359,7 +1361,7 @@ public class PGraphics extends PImage implements PConstants {
1359
1361
  * Sets a texture to be applied to vertex points. The <b>texture()</b>
1360
1362
  * function must be called between <b>beginShape()</b> and
1361
1363
  * <b>endShape()</b> and before any calls to <b>vertex()</b>.
1362
- *
1364
+ *
1363
1365
  * When textures are in use, the fill color is ignored. Instead, use tint()
1364
1366
  * to specify the color of the texture as it is applied to the shape.
1365
1367
  *
@@ -1389,7 +1391,7 @@ public class PGraphics extends PImage implements PConstants {
1389
1391
 
1390
1392
  protected void vertexCheck() {
1391
1393
  if (vertexCount == vertices.length) {
1392
- float temp[][] = new float[vertexCount << 1][VERTEX_FIELD_COUNT];
1394
+ float[][] temp = new float[vertexCount << 1][VERTEX_FIELD_COUNT];
1393
1395
  System.arraycopy(vertices, 0, temp, 0, vertexCount);
1394
1396
  vertices = temp;
1395
1397
  }
@@ -1481,7 +1483,7 @@ public class PGraphics extends PImage implements PConstants {
1481
1483
  // http://dev.processing.org/bugs/show_bug.cgi?id=444
1482
1484
  if (shape == POLYGON) {
1483
1485
  if (vertexCount > 0) {
1484
- float pvertex[] = vertices[vertexCount-1];
1486
+ float[] pvertex = vertices[vertexCount-1];
1485
1487
  if ((Math.abs(pvertex[X] - x) < EPSILON) &&
1486
1488
  (Math.abs(pvertex[Y] - y) < EPSILON) &&
1487
1489
  (Math.abs(pvertex[Z] - z) < EPSILON)) {
@@ -1648,18 +1650,18 @@ public class PGraphics extends PImage implements PConstants {
1648
1650
 
1649
1651
 
1650
1652
  /**
1651
- * Set (U, V) coords for the next vertex in the current shape.
1652
- * This is ugly as its own function, and will (almost?) always be
1653
- * coincident with a call to vertex. As of beta, this was moved to
1654
- * the protected method you see here, and called from an optional
1655
- * param of and overloaded vertex().
1656
- *
1653
+ * Set (U, V) coords for the next vertex in the current shape.This is ugly as its own function, and will (almost?) always be
1654
+ coincident with a call to vertex.As of beta, this was moved to
1655
+ the protected method you see here, and called from an optional
1656
+ param of and overloaded vertex().
1657
1657
  * The parameters depend on the current textureMode. When using
1658
- * textureMode(IMAGE), the coordinates will be relative to the size
1659
- * of the image texture, when used with textureMode(NORMAL),
1660
- * they'll be in the range 0..1.
1661
- *
1662
- * Used by both PGraphics2D (for images) and PGraphics3D.
1658
+ textureMode(IMAGE), the coordinates will be relative to the size
1659
+ of the image texture, when used with textureMode(NORMAL),
1660
+ they'll be in the range 0..1.
1661
+
1662
+ Used by both PGraphics2D (for images) and PGraphics3D.
1663
+ * @param u
1664
+ * @param v
1663
1665
  */
1664
1666
  protected void vertexTexture(float u, float v) {
1665
1667
  if (textureImage == null) {
@@ -1725,7 +1727,6 @@ public class PGraphics extends PImage implements PConstants {
1725
1727
  * @see PShape
1726
1728
  * @see PGraphics#beginShape(int)
1727
1729
  */
1728
-
1729
1730
  public void endShape(int mode) {
1730
1731
  }
1731
1732
 
@@ -1737,6 +1738,7 @@ public class PGraphics extends PImage implements PConstants {
1737
1738
 
1738
1739
 
1739
1740
  /**
1741
+ * @return
1740
1742
  * @webref shape
1741
1743
  * @param filename name of file to load, can be .svg or .obj
1742
1744
  * @see PShape
@@ -3083,8 +3085,8 @@ public class PGraphics extends PImage implements PConstants {
3083
3085
  float[] cz = new float[ures];
3084
3086
  // calc unit circle in XZ plane
3085
3087
  for (int i = 0; i < ures; i++) {
3086
- cx[i] = COS_LUT[(int) (i*delta) % SINCOS_LENGTH];
3087
- cz[i] = SIN_LUT[(int) (i*delta) % SINCOS_LENGTH];
3088
+ cx[i] = cosLUT[(int) (i*delta) % SINCOS_LENGTH];
3089
+ cz[i] = sinLUT[(int) (i*delta) % SINCOS_LENGTH];
3088
3090
  }
3089
3091
  // computing vertexlist
3090
3092
  // vertexlist starts at south pole
@@ -3101,8 +3103,8 @@ public class PGraphics extends PImage implements PConstants {
3101
3103
 
3102
3104
  // step along Y axis
3103
3105
  for (int i = 1; i < vres; i++) {
3104
- float curradius = SIN_LUT[(int) angle % SINCOS_LENGTH];
3105
- float currY = COS_LUT[(int) angle % SINCOS_LENGTH];
3106
+ float curradius = sinLUT[(int) angle % SINCOS_LENGTH];
3107
+ float currY = cosLUT[(int) angle % SINCOS_LENGTH];
3106
3108
  for (int j = 0; j < ures; j++) {
3107
3109
  sphereX[currVert] = cx[j] * curradius;
3108
3110
  sphereY[currVert] = currY;
@@ -3426,17 +3428,17 @@ public class PGraphics extends PImage implements PConstants {
3426
3428
  * ( begin auto-generated from curvePoint.xml )
3427
3429
  *
3428
3430
  * Evalutes the curve at point t for points a, b, c, d. The parameter t
3429
- * varies between 0 and 1, a and d are points on the curve, and b and c are
3430
- * the control points. This can be done once with the x coordinates and a
3431
+ * varies between 0 and 1, a and d are the control points, and b and c are
3432
+ * the points on the curve. This can be done once with the x coordinates and a
3431
3433
  * second time with the y coordinates to get the location of a curve at t.
3432
3434
  *
3433
3435
  * ( end auto-generated )
3434
3436
  *
3435
3437
  * @webref shape:curves
3436
- * @param a coordinate of first point on the curve
3437
- * @param b coordinate of second point on the curve
3438
- * @param c coordinate of third point on the curve
3439
- * @param d coordinate of fourth point on the curve
3438
+ * @param a coordinate of first control point
3439
+ * @param b coordinate of first point on the curve
3440
+ * @param c coordinate of second point on the curve
3441
+ * @param d coordinate of second control point
3440
3442
  * @param t value between 0 and 1
3441
3443
  * @see PGraphics#curve(float, float, float, float, float, float, float, float, float, float, float, float)
3442
3444
  * @see PGraphics#curveVertex(float, float)
@@ -3462,7 +3464,7 @@ public class PGraphics extends PImage implements PConstants {
3462
3464
  *
3463
3465
  * Calculates the tangent of a point on a curve. There's a good definition
3464
3466
  * of <em><a href="http://en.wikipedia.org/wiki/Tangent"
3465
- * target="new">tangent</em> on Wikipedia</a>.
3467
+ * target="new">tangent on Wikipedia</a></em>.
3466
3468
  *
3467
3469
  * ( end auto-generated )
3468
3470
  *
@@ -3893,7 +3895,7 @@ public class PGraphics extends PImage implements PConstants {
3893
3895
  /**
3894
3896
  * Expects x1, y1, x2, y2 coordinates where (x2 >= x1) and (y2 >= y1).
3895
3897
  * If tint() has been called, the image will be colored.
3896
- *
3898
+ *
3897
3899
  * The default implementation draws an image as a textured quad.
3898
3900
  * The (u, v) coordinates are in image space (they're ints, after all..)
3899
3901
  */
@@ -4167,7 +4169,7 @@ public class PGraphics extends PImage implements PConstants {
4167
4169
  * CENTER, and RIGHT set the display characteristics of the letters in
4168
4170
  * relation to the values for the <b>x</b> and <b>y</b> parameters of the
4169
4171
  * <b>text()</b> function.
4170
- *
4172
+ *
4171
4173
  * In Processing 0125 and later, an optional second parameter can be used
4172
4174
  * to vertically align the text. BASELINE is the default, and the vertical
4173
4175
  * alignment will be reset to BASELINE if the second parameter is not used.
@@ -4175,12 +4177,12 @@ public class PGraphics extends PImage implements PConstants {
4175
4177
  * offsets the line based on the current <b>textDescent()</b>. For multiple
4176
4178
  * lines, the final line will be aligned to the bottom, with the previous
4177
4179
  * lines appearing above it.
4178
- *
4180
+ *
4179
4181
  * When using <b>text()</b> with width and height parameters, BASELINE is
4180
4182
  * ignored, and treated as TOP. (Otherwise, text would by default draw
4181
4183
  * outside the box, since BASELINE is the default setting. BASELINE is not
4182
4184
  * a useful drawing mode for text drawn in a rectangle.)
4183
- *
4185
+ *
4184
4186
  * The vertical alignment is based on the value of <b>textAscent()</b>,
4185
4187
  * which many fonts do not specify correctly. It may be necessary to use a
4186
4188
  * hack and offset by a few pixels by hand so that the offset looks
@@ -4553,7 +4555,7 @@ public class PGraphics extends PImage implements PConstants {
4553
4555
  * Unlike the previous version that was inside PFont, this will
4554
4556
  * return the size not of a 1 pixel font, but the actual current size.
4555
4557
  */
4556
- protected float textWidthImpl(char buffer[], int start, int stop) {
4558
+ protected float textWidthImpl(char[] buffer, int start, int stop) {
4557
4559
  float wide = 0;
4558
4560
  for (int i = start; i < stop; i++) {
4559
4561
  // could add kerning here, but it just ain't implemented
@@ -5021,7 +5023,7 @@ public class PGraphics extends PImage implements PConstants {
5021
5023
  * Handles placement of a text line, then calls textLineImpl
5022
5024
  * to actually render at the specific point.
5023
5025
  */
5024
- protected void textLineAlignImpl(char buffer[], int start, int stop,
5026
+ protected void textLineAlignImpl(char[] buffer, int start, int stop,
5025
5027
  float x, float y) {
5026
5028
  if (textAlign == CENTER) {
5027
5029
  x -= textWidthImpl(buffer, start, stop) / 2f;
@@ -5037,7 +5039,7 @@ public class PGraphics extends PImage implements PConstants {
5037
5039
  /**
5038
5040
  * Implementation of actual drawing for a line of text.
5039
5041
  */
5040
- protected void textLineImpl(char buffer[], int start, int stop,
5042
+ protected void textLineImpl(char[] buffer, int start, int stop,
5041
5043
  float x, float y) {
5042
5044
  for (int index = start; index < stop; index++) {
5043
5045
  textCharImpl(buffer[index], x, y);
@@ -5350,7 +5352,7 @@ public class PGraphics extends PImage implements PConstants {
5350
5352
  * Rotates a shape the amount specified by the <b>angle</b> parameter.
5351
5353
  * Angles should be specified in radians (values from 0 to TWO_PI) or
5352
5354
  * converted to radians with the <b>radians()</b> function.
5353
- *
5355
+ *
5354
5356
  * Objects are always rotated around their relative position to the origin
5355
5357
  * and positive numbers rotate objects in a clockwise direction.
5356
5358
  * Transformations apply to everything that happens after and subsequent
@@ -5358,7 +5360,7 @@ public class PGraphics extends PImage implements PConstants {
5358
5360
  * <b>rotate(HALF_PI)</b> and then <b>rotate(HALF_PI)</b> is the same as
5359
5361
  * <b>rotate(PI)</b>. All tranformations are reset when <b>draw()</b>
5360
5362
  * begins again.
5361
- *
5363
+ *
5362
5364
  * Technically, <b>rotate()</b> multiplies the current transformation
5363
5365
  * matrix by a rotation matrix. This function can be further controlled by
5364
5366
  * the <b>pushMatrix()</b> and <b>popMatrix()</b>.
@@ -5561,7 +5563,7 @@ public class PGraphics extends PImage implements PConstants {
5561
5563
  * <b>shearX(PI/2)</b> and then <b>shearX(PI/2)</b> is the same as
5562
5564
  * <b>shearX(PI)</b>. If <b>shearX()</b> is called within the
5563
5565
  * <b>draw()</b>, the transformation is reset when the loop begins again.
5564
- *
5566
+ *
5565
5567
  * Technically, <b>shearX()</b> multiplies the current transformation
5566
5568
  * matrix by a rotation matrix. This function can be further controlled by
5567
5569
  * the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
@@ -5595,7 +5597,7 @@ public class PGraphics extends PImage implements PConstants {
5595
5597
  * <b>shearY(PI/2)</b> and then <b>shearY(PI/2)</b> is the same as
5596
5598
  * <b>shearY(PI)</b>. If <b>shearY()</b> is called within the
5597
5599
  * <b>draw()</b>, the transformation is reset when the loop begins again.
5598
- *
5600
+ *
5599
5601
  * Technically, <b>shearY()</b> multiplies the current transformation
5600
5602
  * matrix by a rotation matrix. This function can be further controlled by
5601
5603
  * the <b>pushMatrix()</b> and <b>popMatrix()</b> functions.
@@ -5808,8 +5810,8 @@ public class PGraphics extends PImage implements PConstants {
5808
5810
  * reason, camera functions should be placed at the beginning of
5809
5811
  * <b>draw()</b> (so that transformations happen afterwards), and the
5810
5812
  * <b>camera()</b> function can be used after <b>beginCamera()</b> if you
5811
- * want to reset the camera before applying transformations.<br
5812
- * />This function sets the matrix mode to the camera matrix so calls such
5813
+ * want to reset the camera before applying transformations.
5814
+ * This function sets the matrix mode to the camera matrix so calls such
5813
5815
  * as <b>translate()</b>, <b>rotate()</b>, applyMatrix() and resetMatrix()
5814
5816
  * affect the camera. <b>beginCamera()</b> should always be used with a
5815
5817
  * following <b>endCamera()</b> and pairs of <b>beginCamera()</b> and
@@ -6071,6 +6073,7 @@ public class PGraphics extends PImage implements PConstants {
6071
6073
 
6072
6074
  /**
6073
6075
  * @param z 3D z-coordinate to be mapped
6076
+ * @return
6074
6077
  */
6075
6078
  public float screenX(float x, float y, float z) {
6076
6079
  showMissingWarning("screenX");
@@ -6092,10 +6095,10 @@ public class PGraphics extends PImage implements PConstants {
6092
6095
  * ( begin auto-generated from screenZ.xml )
6093
6096
  *
6094
6097
  * Takes a three-dimensional X, Y, Z position and returns the Z value for
6095
- * where it will appear on a (two-dimensional) screen.
6098
+ * where it will appear on a (two-dimensional) screen.( end auto-generated )
6096
6099
  *
6097
- * ( end auto-generated )
6098
6100
  *
6101
+ * @return
6099
6102
  * @webref lights_camera:coordinates
6100
6103
  * @param x 3D x-coordinate to be mapped
6101
6104
  * @param y 3D y-coordinate to be mapped
@@ -6112,13 +6115,11 @@ public class PGraphics extends PImage implements PConstants {
6112
6115
  /**
6113
6116
  * ( begin auto-generated from modelX.xml )
6114
6117
  *
6115
- * Returns the three-dimensional X, Y, Z position in model space. This
6116
- * returns the X value for a given coordinate based on the current set of
6117
- * transformations (scale, rotate, translate, etc.) The X value can be used
6118
- * to place an object in space relative to the location of the original
6119
- * point once the transformations are no longer in use.
6120
- *
6121
- * In the example, the <b>modelX()</b>, <b>modelY()</b>, and
6118
+ * Returns the three-dimensional X, Y, Z position in model space.This
6119
+ returns the X value for a given coordinate based on the current set of
6120
+ transformations (scale, rotate, translate, etc.) The X value can be used
6121
+ to place an object in space relative to the location of the original
6122
+ point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
6122
6123
  * <b>modelZ()</b> functions record the location of a box in space after
6123
6124
  * being placed using a series of translate and rotate commands. After
6124
6125
  * popMatrix() is called, those transformations no longer apply, but the
@@ -6127,6 +6128,7 @@ public class PGraphics extends PImage implements PConstants {
6127
6128
  *
6128
6129
  * ( end auto-generated )
6129
6130
  *
6131
+ * @return
6130
6132
  * @webref lights_camera:coordinates
6131
6133
  * @param x 3D x-coordinate to be mapped
6132
6134
  * @param y 3D y-coordinate to be mapped
@@ -6143,13 +6145,11 @@ public class PGraphics extends PImage implements PConstants {
6143
6145
  /**
6144
6146
  * ( begin auto-generated from modelY.xml )
6145
6147
  *
6146
- * Returns the three-dimensional X, Y, Z position in model space. This
6147
- * returns the Y value for a given coordinate based on the current set of
6148
- * transformations (scale, rotate, translate, etc.) The Y value can be used
6149
- * to place an object in space relative to the location of the original
6150
- * point once the transformations are no longer in use.
6151
- *
6152
- * In the example, the <b>modelX()</b>, <b>modelY()</b>, and
6148
+ * Returns the three-dimensional X, Y, Z position in model space.This
6149
+ returns the Y value for a given coordinate based on the current set of
6150
+ transformations (scale, rotate, translate, etc.) The Y value can be used
6151
+ to place an object in space relative to the location of the original
6152
+ point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
6153
6153
  * <b>modelZ()</b> functions record the location of a box in space after
6154
6154
  * being placed using a series of translate and rotate commands. After
6155
6155
  * popMatrix() is called, those transformations no longer apply, but the
@@ -6158,6 +6158,7 @@ public class PGraphics extends PImage implements PConstants {
6158
6158
  *
6159
6159
  * ( end auto-generated )
6160
6160
  *
6161
+ * @return
6161
6162
  * @webref lights_camera:coordinates
6162
6163
  * @param x 3D x-coordinate to be mapped
6163
6164
  * @param y 3D y-coordinate to be mapped
@@ -6174,13 +6175,11 @@ public class PGraphics extends PImage implements PConstants {
6174
6175
  /**
6175
6176
  * ( begin auto-generated from modelZ.xml )
6176
6177
  *
6177
- * Returns the three-dimensional X, Y, Z position in model space. This
6178
- * returns the Z value for a given coordinate based on the current set of
6179
- * transformations (scale, rotate, translate, etc.) The Z value can be used
6180
- * to place an object in space relative to the location of the original
6181
- * point once the transformations are no longer in use.
6182
- *
6183
- * In the example, the <b>modelX()</b>, <b>modelY()</b>, and
6178
+ * Returns the three-dimensional X, Y, Z position in model space.This
6179
+ returns the Z value for a given coordinate based on the current set of
6180
+ transformations (scale, rotate, translate, etc.) The Z value can be used
6181
+ to place an object in space relative to the location of the original
6182
+ point once the transformations are no longer in use. In the example, the <b>modelX()</b>, <b>modelY()</b>, and
6184
6183
  * <b>modelZ()</b> functions record the location of a box in space after
6185
6184
  * being placed using a series of translate and rotate commands. After
6186
6185
  * popMatrix() is called, those transformations no longer apply, but the
@@ -6189,6 +6188,7 @@ public class PGraphics extends PImage implements PConstants {
6189
6188
  *
6190
6189
  * ( end auto-generated )
6191
6190
  *
6191
+ * @return
6192
6192
  * @webref lights_camera:coordinates
6193
6193
  * @param x 3D x-coordinate to be mapped
6194
6194
  * @param y 3D y-coordinate to be mapped
@@ -6410,7 +6410,7 @@ public class PGraphics extends PImage implements PConstants {
6410
6410
  *
6411
6411
  * Sets the width of the stroke used for lines, points, and the border
6412
6412
  * around shapes. All widths are set in units of pixels.
6413
- *
6413
+ *
6414
6414
  * When drawing with P3D, series of connected lines (such as the stroke
6415
6415
  * around a polygon, triangle, or ellipse) produce unattractive results
6416
6416
  * when a thick stroke weight is set (<a
@@ -6439,7 +6439,7 @@ public class PGraphics extends PImage implements PConstants {
6439
6439
  * are either mitered, beveled, or rounded and specified with the
6440
6440
  * corresponding parameters MITER, BEVEL, and ROUND. The default joint is
6441
6441
  * MITER.
6442
- *
6442
+ *
6443
6443
  * This function is not available with the P3D renderer, (<a
6444
6444
  * href="http://code.google.com/p/processing/issues/detail?id=123">see
6445
6445
  * Issue 123</a>). More information about the renderers can be found in the
@@ -6463,7 +6463,7 @@ public class PGraphics extends PImage implements PConstants {
6463
6463
  * Sets the style for rendering line endings. These ends are either
6464
6464
  * squared, extended, or rounded and specified with the corresponding
6465
6465
  * parameters SQUARE, PROJECT, and ROUND. The default cap is ROUND.
6466
- *
6466
+ *
6467
6467
  * This function is not available with the P3D renderer (<a
6468
6468
  * href="http://code.google.com/p/processing/issues/detail?id=123">see
6469
6469
  * Issue 123</a>). More information about the renderers can be found in the
@@ -6514,7 +6514,7 @@ public class PGraphics extends PImage implements PConstants {
6514
6514
  * is either specified in terms of the RGB or HSB color depending on the
6515
6515
  * current <b>colorMode()</b> (the default color space is RGB, with each
6516
6516
  * value in the range from 0 to 255).
6517
- *
6517
+ *
6518
6518
  * When using hexadecimal notation to specify a color, use "#" or "0x"
6519
6519
  * before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
6520
6520
  * digits to specify a color (the way colors are specified in HTML and
@@ -6522,7 +6522,7 @@ public class PGraphics extends PImage implements PConstants {
6522
6522
  * hexadecimal value must be specified with eight characters; the first two
6523
6523
  * characters define the alpha component and the remainder the red, green,
6524
6524
  * and blue components.
6525
- *
6525
+ *
6526
6526
  * The value for the parameter "gray" must be less than or equal to the
6527
6527
  * current maximum value as specified by <b>colorMode()</b>. The default
6528
6528
  * maximum value is 255.
@@ -6755,7 +6755,7 @@ public class PGraphics extends PImage implements PConstants {
6755
6755
  * color is either specified in terms of the RGB or HSB color depending on
6756
6756
  * the current <b>colorMode()</b> (the default color space is RGB, with
6757
6757
  * each value in the range from 0 to 255).
6758
- *
6758
+ *
6759
6759
  * When using hexadecimal notation to specify a color, use "#" or "0x"
6760
6760
  * before the values (e.g. #CCFFAA, 0xFFCCFFAA). The # syntax uses six
6761
6761
  * digits to specify a color (the way colors are specified in HTML and
@@ -6763,11 +6763,11 @@ public class PGraphics extends PImage implements PConstants {
6763
6763
  * hexadecimal value must be specified with eight characters; the first two
6764
6764
  * characters define the alpha component and the remainder the red, green,
6765
6765
  * and blue components.
6766
- *
6766
+ *
6767
6767
  * The value for the parameter "gray" must be less than or equal to the
6768
6768
  * current maximum value as specified by <b>colorMode()</b>. The default
6769
6769
  * maximum value is 255.
6770
- *
6770
+ *
6771
6771
  * To change the color of an image (or a texture), use tint().
6772
6772
  *
6773
6773
  * ( end auto-generated )
@@ -6942,6 +6942,8 @@ public class PGraphics extends PImage implements PConstants {
6942
6942
 
6943
6943
  /**
6944
6944
  * gray number specifying value between white and black
6945
+ *
6946
+ * @param gray value between black and white, by default 0 to 255
6945
6947
  */
6946
6948
  public void specular(float gray) {
6947
6949
  colorCalc(gray);
@@ -7019,6 +7021,8 @@ public class PGraphics extends PImage implements PConstants {
7019
7021
 
7020
7022
  /**
7021
7023
  * gray number specifying value between white and black
7024
+ *
7025
+ * @param gray value between black and white, by default 0 to 255
7022
7026
  */
7023
7027
  public void emissive(float gray) {
7024
7028
  colorCalc(gray);
@@ -7315,13 +7319,13 @@ public class PGraphics extends PImage implements PConstants {
7315
7319
  * of the Processing window. The default background is light gray. In the
7316
7320
  * <b>draw()</b> function, the background color is used to clear the
7317
7321
  * display window at the beginning of each frame.
7318
- *
7322
+ *
7319
7323
  * An image can also be used as the background for a sketch, however its
7320
7324
  * width and height must be the same size as the sketch window. To resize
7321
7325
  * an image 'b' to the size of the sketch window, use b.resize(width, height).
7322
- *
7326
+ *
7323
7327
  * Images used as background will ignore the current <b>tint()</b> setting.
7324
- *
7328
+ *
7325
7329
  * It is not possible to use transparency (alpha) in background colors with
7326
7330
  * the main drawing surface, however they will work properly with <b>createGraphics()</b>.
7327
7331
  *
@@ -8003,9 +8007,9 @@ public class PGraphics extends PImage implements PConstants {
8003
8007
  /**
8004
8008
  * ( begin auto-generated from hue.xml )
8005
8009
  *
8006
- * Extracts the hue value from a color.
8010
+ * Extracts the hue value from a color.( end auto-generated )
8007
8011
  *
8008
- * ( end auto-generated )
8012
+ * @return
8009
8013
  * @webref color:creating_reading
8010
8014
  * @usage web_application
8011
8015
  * @param rgb any value of the color datatype
@@ -8029,9 +8033,9 @@ public class PGraphics extends PImage implements PConstants {
8029
8033
  /**
8030
8034
  * ( begin auto-generated from saturation.xml )
8031
8035
  *
8032
- * Extracts the saturation value from a color.
8036
+ * Extracts the saturation value from a color.( end auto-generated )
8033
8037
  *
8034
- * ( end auto-generated )
8038
+ * @return
8035
8039
  * @webref color:creating_reading
8036
8040
  * @usage web_application
8037
8041
  * @param rgb any value of the color datatype
@@ -8055,10 +8059,10 @@ public class PGraphics extends PImage implements PConstants {
8055
8059
  /**
8056
8060
  * ( begin auto-generated from brightness.xml )
8057
8061
  *
8058
- * Extracts the brightness value from a color.
8062
+ * Extracts the brightness value from a color.( end auto-generated )
8059
8063
  *
8060
- * ( end auto-generated )
8061
8064
  *
8065
+ * @return
8062
8066
  * @webref color:creating_reading
8063
8067
  * @usage web_application
8064
8068
  * @param rgb any value of the color datatype
@@ -8194,6 +8198,7 @@ public class PGraphics extends PImage implements PConstants {
8194
8198
 
8195
8199
  /**
8196
8200
  * Record individual lines and triangles by echoing them to another renderer.
8201
+ * @param rawGraphics
8197
8202
  */
8198
8203
  public void beginRaw(PGraphics rawGraphics) { // ignore
8199
8204
  this.raw = rawGraphics;
@@ -8251,6 +8256,8 @@ public class PGraphics extends PImage implements PConstants {
8251
8256
 
8252
8257
  /**
8253
8258
  * Version of showWarning() that takes a parsed String.
8259
+ * @param msg
8260
+ * @param args
8254
8261
  */
8255
8262
  static public void showWarning(String msg, Object... args) { // ignore
8256
8263
  showWarning(String.format(msg, args));
@@ -8282,6 +8289,7 @@ public class PGraphics extends PImage implements PConstants {
8282
8289
 
8283
8290
  /**
8284
8291
  * Display a warning that the specified method is simply unavailable.
8292
+ * @param method
8285
8293
  */
8286
8294
  static public void showMethodWarning(String method) {
8287
8295
  showWarning(method + "() is not available with this renderer.");
@@ -8290,8 +8298,9 @@ public class PGraphics extends PImage implements PConstants {
8290
8298
 
8291
8299
  /**
8292
8300
  * Error that a particular variation of a method is unavailable (even though
8293
- * other variations are). For instance, if vertex(x, y, u, v) is not
8294
- * available, but vertex(x, y) is just fine.
8301
+ * other variations are).For instance, if vertex(x, y, u, v) is not
8302
+ available, but vertex(x, y) is just fine.
8303
+ * @param str
8295
8304
  */
8296
8305
  static public void showVariationWarning(String str) {
8297
8306
  showWarning(str + " is not available with this renderer.");
@@ -8302,6 +8311,7 @@ public class PGraphics extends PImage implements PConstants {
8302
8311
  * Display a warning that the specified method is not implemented, meaning
8303
8312
  * that it could be either a completely missing function, although other
8304
8313
  * variations of it may still work properly.
8314
+ * @param method
8305
8315
  */
8306
8316
  static public void showMissingWarning(String method) {
8307
8317
  showWarning(method + "(), or this particular variation of it, " +
@@ -8310,9 +8320,10 @@ public class PGraphics extends PImage implements PConstants {
8310
8320
 
8311
8321
 
8312
8322
  /**
8313
- * Show an renderer-related exception that halts the program. Currently just
8314
- * wraps the message as a RuntimeException and throws it, but might do
8315
- * something more specific might be used in the future.
8323
+ * Show an renderer-related exception that halts the program.Currently just
8324
+ wraps the message as a RuntimeException and throws it, but might do
8325
+ something more specific might be used in the future.
8326
+ * @param msg
8316
8327
  */
8317
8328
  static public void showException(String msg) { // ignore
8318
8329
  throw new RuntimeException(msg);
@@ -8321,6 +8332,7 @@ public class PGraphics extends PImage implements PConstants {
8321
8332
 
8322
8333
  /**
8323
8334
  * Same as below, but defaults to a 12 point font, just as MacWrite intended.
8335
+ * @param method
8324
8336
  */
8325
8337
  protected void defaultFontOrDeath(String method) {
8326
8338
  defaultFontOrDeath(method, 12);
@@ -8331,6 +8343,8 @@ public class PGraphics extends PImage implements PConstants {
8331
8343
  * First try to create a default font, but if that's not possible, throw
8332
8344
  * an exception that halts the program because textFont() has not been used
8333
8345
  * prior to the specified method.
8346
+ * @param method
8347
+ * @param size
8334
8348
  */
8335
8349
  protected void defaultFontOrDeath(String method, float size) {
8336
8350
  if (parent != null) {
@@ -8351,7 +8365,7 @@ public class PGraphics extends PImage implements PConstants {
8351
8365
  * Return true if this renderer should be drawn to the screen. Defaults to
8352
8366
  * returning true, since nearly all renderers are on-screen beasts. But can
8353
8367
  * be overridden for subclasses like PDF so that a window doesn't open up.
8354
- *
8368
+ *
8355
8369
  * A better name? showFrame, displayable, isVisible, visible, shouldDisplay,
8356
8370
  * what to call this?
8357
8371
  */