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.
- checksums.yaml +4 -4
- data/.mvn/wrapper/maven-wrapper.properties +1 -1
- data/CHANGELOG.md +2 -0
- data/README.md +7 -7
- data/lib/propane/app.rb +2 -5
- data/lib/propane/helper_methods.rb +6 -6
- data/lib/propane/version.rb +1 -1
- data/lib/{propane-3.10.0.jar → propane-3.11.0.jar} +0 -0
- data/pom.rb +6 -6
- data/pom.xml +6 -6
- data/propane.gemspec +3 -3
- data/src/main/java/monkstone/noise/OpenSimplex2F.java +838 -737
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -13
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +14 -28
- data/src/main/java/processing/awt/PImageAWT.java +6 -4
- data/src/main/java/processing/core/PApplet.java +71 -59
- data/src/main/java/processing/core/PImage.java +14 -14
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
- data/src/main/java/processing/opengl/PShader.java +1 -6
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
- data/{lib/java/processing/opengl → src/main/resources}/cursors/arrow.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/cross.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/hand.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/license.txt +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/move.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/text.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/cursors/wait.png +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/ColorVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LightFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LightVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LineFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/LineVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/MaskFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/PointFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/PointVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightFrag.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexLightVert.glsl +0 -0
- data/{lib/java/processing/opengl → src/main/resources}/shaders/TexVert.glsl +0 -0
- data/test/test_helper.rb +1 -0
- data/vendors/Rakefile +1 -1
- metadata +29 -155
- data/lib/java/japplemenubar/JAppleMenuBar.java +0 -88
- data/lib/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
- data/lib/java/monkstone/ColorUtil.java +0 -127
- data/lib/java/monkstone/MathToolModule.java +0 -287
- data/lib/java/monkstone/PropaneLibrary.java +0 -46
- data/lib/java/monkstone/core/LibraryProxy.java +0 -136
- data/lib/java/monkstone/fastmath/DegLutTables.java +0 -111
- data/lib/java/monkstone/fastmath/Deglut.java +0 -71
- data/lib/java/monkstone/fastmath/package-info.java +0 -6
- data/lib/java/monkstone/filechooser/Chooser.java +0 -39
- data/lib/java/monkstone/noise/FastTerrain.java +0 -874
- data/lib/java/monkstone/noise/Noise.java +0 -90
- data/lib/java/monkstone/noise/NoiseGenerator.java +0 -75
- data/lib/java/monkstone/noise/NoiseMode.java +0 -28
- data/lib/java/monkstone/noise/OpenSimplex2F.java +0 -881
- data/lib/java/monkstone/noise/OpenSimplex2S.java +0 -1106
- data/lib/java/monkstone/noise/SmoothTerrain.java +0 -1099
- data/lib/java/monkstone/slider/CustomHorizontalSlider.java +0 -164
- data/lib/java/monkstone/slider/CustomVerticalSlider.java +0 -178
- data/lib/java/monkstone/slider/SimpleHorizontalSlider.java +0 -145
- data/lib/java/monkstone/slider/SimpleSlider.java +0 -166
- data/lib/java/monkstone/slider/SimpleVerticalSlider.java +0 -157
- data/lib/java/monkstone/slider/Slider.java +0 -61
- data/lib/java/monkstone/slider/SliderBar.java +0 -245
- data/lib/java/monkstone/slider/SliderGroup.java +0 -56
- data/lib/java/monkstone/slider/WheelHandler.java +0 -35
- data/lib/java/monkstone/vecmath/GfxRender.java +0 -86
- data/lib/java/monkstone/vecmath/JRender.java +0 -56
- data/lib/java/monkstone/vecmath/ShapeRender.java +0 -87
- data/lib/java/monkstone/vecmath/package-info.java +0 -20
- data/lib/java/monkstone/vecmath/vec2/Vec2.java +0 -802
- data/lib/java/monkstone/vecmath/vec2/package-info.java +0 -6
- data/lib/java/monkstone/vecmath/vec3/Vec3.java +0 -727
- data/lib/java/monkstone/vecmath/vec3/package-info.java +0 -6
- data/lib/java/monkstone/videoevent/CaptureEvent.java +0 -27
- data/lib/java/monkstone/videoevent/MovieEvent.java +0 -32
- data/lib/java/monkstone/videoevent/package-info.java +0 -20
- data/lib/java/processing/awt/PGraphicsJava2D.java +0 -3040
- data/lib/java/processing/awt/PImageAWT.java +0 -377
- data/lib/java/processing/awt/PShapeJava2D.java +0 -387
- data/lib/java/processing/awt/PSurfaceAWT.java +0 -1581
- data/lib/java/processing/awt/ShimAWT.java +0 -581
- data/lib/java/processing/core/PApplet.java +0 -15156
- data/lib/java/processing/core/PConstants.java +0 -523
- data/lib/java/processing/core/PFont.java +0 -1126
- data/lib/java/processing/core/PGraphics.java +0 -8600
- data/lib/java/processing/core/PImage.java +0 -3377
- data/lib/java/processing/core/PMatrix.java +0 -208
- data/lib/java/processing/core/PMatrix2D.java +0 -562
- data/lib/java/processing/core/PMatrix3D.java +0 -890
- data/lib/java/processing/core/PShape.java +0 -3561
- data/lib/java/processing/core/PShapeOBJ.java +0 -483
- data/lib/java/processing/core/PShapeSVG.java +0 -2016
- data/lib/java/processing/core/PStyle.java +0 -63
- data/lib/java/processing/core/PSurface.java +0 -198
- data/lib/java/processing/core/PSurfaceNone.java +0 -431
- data/lib/java/processing/core/PVector.java +0 -1066
- data/lib/java/processing/core/ThinkDifferent.java +0 -115
- data/lib/java/processing/data/DoubleDict.java +0 -850
- data/lib/java/processing/data/DoubleList.java +0 -928
- data/lib/java/processing/data/FloatDict.java +0 -847
- data/lib/java/processing/data/FloatList.java +0 -936
- data/lib/java/processing/data/IntDict.java +0 -807
- data/lib/java/processing/data/IntList.java +0 -936
- data/lib/java/processing/data/JSONArray.java +0 -1260
- data/lib/java/processing/data/JSONObject.java +0 -2282
- data/lib/java/processing/data/JSONTokener.java +0 -435
- data/lib/java/processing/data/LongDict.java +0 -802
- data/lib/java/processing/data/LongList.java +0 -937
- data/lib/java/processing/data/Sort.java +0 -46
- data/lib/java/processing/data/StringDict.java +0 -613
- data/lib/java/processing/data/StringList.java +0 -800
- data/lib/java/processing/data/Table.java +0 -4936
- data/lib/java/processing/data/TableRow.java +0 -198
- data/lib/java/processing/data/XML.java +0 -1156
- data/lib/java/processing/dxf/RawDXF.java +0 -404
- data/lib/java/processing/event/Event.java +0 -125
- data/lib/java/processing/event/KeyEvent.java +0 -70
- data/lib/java/processing/event/MouseEvent.java +0 -114
- data/lib/java/processing/event/TouchEvent.java +0 -57
- data/lib/java/processing/javafx/PGraphicsFX2D.java +0 -32
- data/lib/java/processing/javafx/PSurfaceFX.java +0 -173
- data/lib/java/processing/net/Client.java +0 -744
- data/lib/java/processing/net/Server.java +0 -388
- data/lib/java/processing/opengl/FontTexture.java +0 -378
- data/lib/java/processing/opengl/FrameBuffer.java +0 -513
- data/lib/java/processing/opengl/LinePath.java +0 -627
- data/lib/java/processing/opengl/LineStroker.java +0 -681
- data/lib/java/processing/opengl/PGL.java +0 -3483
- data/lib/java/processing/opengl/PGraphics2D.java +0 -615
- data/lib/java/processing/opengl/PGraphics3D.java +0 -281
- data/lib/java/processing/opengl/PGraphicsOpenGL.java +0 -13753
- data/lib/java/processing/opengl/PJOGL.java +0 -2008
- data/lib/java/processing/opengl/PShader.java +0 -1484
- data/lib/java/processing/opengl/PShapeOpenGL.java +0 -5269
- data/lib/java/processing/opengl/PSurfaceJOGL.java +0 -1385
- data/lib/java/processing/opengl/Texture.java +0 -1696
- data/lib/java/processing/opengl/VertexBuffer.java +0 -88
- data/lib/java/processing/pdf/PGraphicsPDF.java +0 -581
- data/lib/java/processing/svg/PGraphicsSVG.java +0 -378
- data/src/main/java/processing/opengl/cursors/arrow.png +0 -0
- data/src/main/java/processing/opengl/cursors/cross.png +0 -0
- data/src/main/java/processing/opengl/cursors/hand.png +0 -0
- data/src/main/java/processing/opengl/cursors/license.txt +0 -27
- data/src/main/java/processing/opengl/cursors/move.png +0 -0
- data/src/main/java/processing/opengl/cursors/text.png +0 -0
- data/src/main/java/processing/opengl/cursors/wait.png +0 -0
- data/src/main/java/processing/opengl/shaders/ColorFrag.glsl +0 -32
- data/src/main/java/processing/opengl/shaders/ColorVert.glsl +0 -34
- data/src/main/java/processing/opengl/shaders/LightFrag.glsl +0 -33
- data/src/main/java/processing/opengl/shaders/LightVert.glsl +0 -151
- data/src/main/java/processing/opengl/shaders/LineFrag.glsl +0 -32
- data/src/main/java/processing/opengl/shaders/LineVert.glsl +0 -100
- data/src/main/java/processing/opengl/shaders/MaskFrag.glsl +0 -40
- data/src/main/java/processing/opengl/shaders/PointFrag.glsl +0 -32
- data/src/main/java/processing/opengl/shaders/PointVert.glsl +0 -56
- data/src/main/java/processing/opengl/shaders/TexFrag.glsl +0 -37
- data/src/main/java/processing/opengl/shaders/TexLightFrag.glsl +0 -37
- data/src/main/java/processing/opengl/shaders/TexLightVert.glsl +0 -157
- 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
|
-
|
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 =
|
560
|
+
double scalar = args[1] instanceof RubyFloat
|
563
561
|
? ((RubyFloat) args[1]).getValue() : ((RubyFixnum) args[1]).getDoubleValue();
|
564
|
-
assert
|
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
|
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
|
-
|
748
|
-
&&
|
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
|
-
}
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
213
|
+
jx = value instanceof RubyFloat
|
226
214
|
? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
|
227
215
|
} else if (key == RubySymbol.newSymbol(runtime, "y")) {
|
228
|
-
jy =
|
216
|
+
jy = value instanceof RubyFloat
|
229
217
|
? ((RubyFloat) value).getValue() : ((RubyFixnum) value).getDoubleValue();
|
230
218
|
} else if (key == RubySymbol.newSymbol(runtime, "z")) {
|
231
|
-
jz =
|
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 =
|
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 =
|
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
|
-
|
432
|
-
return this;
|
433
|
-
}
|
418
|
+
if (block.isGiven() && !block.yield(context, scalar).toJava(Boolean.class)) {
|
419
|
+
return this;
|
434
420
|
}
|
435
|
-
double new_mag =
|
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 (
|
690
|
-
&&
|
691
|
-
&&
|
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
|
-
|
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
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
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 (
|
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).
|
2129
|
-
|
2130
|
-
|
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
|
-
|
3192
|
-
*
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
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
|
-
|
3230
|
-
|
3231
|
-
|
3232
|
-
|
3233
|
-
|
3234
|
-
|
3235
|
-
|
3236
|
-
|
3237
|
-
|
3238
|
-
|
3239
|
-
|
3240
|
-
|
3241
|
-
|
3242
|
-
|
3243
|
-
|
3244
|
-
|
3245
|
-
|
3246
|
-
|
3247
|
-
|
3248
|
-
|
3249
|
-
|
3250
|
-
|
3251
|
-
|
3252
|
-
|
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
|
-
|
3256
|
-
|
3257
|
-
|
3258
|
-
|
3259
|
-
|
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
|
-
* <
|
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
|
-
* <
|
1570
|
+
* <code>C = A*factor + B</code>
|
1571
1571
|
*
|
1572
1572
|
* <LI>ADD - additive blending with white clip:
|
1573
|
-
* <
|
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
|
-
* <
|
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
|
-
* <
|
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
|
-
* <
|
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
|
-
* <
|
1619
|
-
* <
|
1618
|
+
* <code>>>8</code> or <code>>>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
|
-
* <
|
1622
|
-
* not <
|
1623
|
-
* the same as <
|
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><
|
3134
|
-
* <LI><
|
3135
|
-
* <LI><
|
3133
|
+
* <LI><code>ALPHA</code> images written as 8bit grayscale (uses lowest byte)
|
3134
|
+
* <LI><code>RGB</code> → 24 bits
|
3135
|
+
* <LI><code>ARGB</code> → 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
|
-
* <
|
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("/
|
184
|
+
PGraphicsOpenGL.class.getResource("/shaders/ColorVert.glsl");
|
185
185
|
static protected URL defTextureShaderVertURL =
|
186
|
-
PGraphicsOpenGL.class.getResource("/
|
186
|
+
PGraphicsOpenGL.class.getResource("/shaders/TexVert.glsl");
|
187
187
|
static protected URL defLightShaderVertURL =
|
188
|
-
PGraphicsOpenGL.class.getResource("/
|
188
|
+
PGraphicsOpenGL.class.getResource("/shaders/LightVert.glsl");
|
189
189
|
static protected URL defTexlightShaderVertURL =
|
190
|
-
PGraphicsOpenGL.class.getResource("/
|
190
|
+
PGraphicsOpenGL.class.getResource("/shaders/TexLightVert.glsl");
|
191
191
|
static protected URL defColorShaderFragURL =
|
192
|
-
PGraphicsOpenGL.class.getResource("/
|
192
|
+
PGraphicsOpenGL.class.getResource("/shaders/ColorFrag.glsl");
|
193
193
|
static protected URL defTextureShaderFragURL =
|
194
|
-
PGraphicsOpenGL.class.getResource("/
|
194
|
+
PGraphicsOpenGL.class.getResource("/shaders/TexFrag.glsl");
|
195
195
|
static protected URL defLightShaderFragURL =
|
196
|
-
PGraphicsOpenGL.class.getResource("/
|
196
|
+
PGraphicsOpenGL.class.getResource("/shaders/LightFrag.glsl");
|
197
197
|
static protected URL defTexlightShaderFragURL =
|
198
|
-
PGraphicsOpenGL.class.getResource("/
|
198
|
+
PGraphicsOpenGL.class.getResource("/shaders/TexLightFrag.glsl");
|
199
199
|
|
200
200
|
static protected URL defLineShaderVertURL =
|
201
|
-
PGraphicsOpenGL.class.getResource("/
|
201
|
+
PGraphicsOpenGL.class.getResource("/shaders/LineVert.glsl");
|
202
202
|
static protected URL defLineShaderFragURL =
|
203
|
-
PGraphicsOpenGL.class.getResource("/
|
203
|
+
PGraphicsOpenGL.class.getResource("/shaders/LineFrag.glsl");
|
204
204
|
static protected URL defPointShaderVertURL =
|
205
|
-
PGraphicsOpenGL.class.getResource("/
|
205
|
+
PGraphicsOpenGL.class.getResource("/shaders/PointVert.glsl");
|
206
206
|
static protected URL defPointShaderFragURL =
|
207
|
-
PGraphicsOpenGL.class.getResource("/
|
207
|
+
PGraphicsOpenGL.class.getResource("/shaders/PointFrag.glsl");
|
208
208
|
static protected URL maskShaderFragURL =
|
209
|
-
PGraphicsOpenGL.class.getResource("/
|
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;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|