picrate 0.5.0-java → 0.6.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 +3 -1
- data/README.md +1 -1
- data/Rakefile +8 -6
- data/docs/_editors/geany.md +5 -4
- data/docs/_editors/vim.md +6 -0
- data/docs/_includes/head.html +1 -0
- data/docs/_libraries/control_panel.md +2 -2
- data/docs/_libraries/gl_video.md +21 -0
- data/docs/_posts/2018-05-06-getting_started.md +10 -9
- data/docs/_posts/2018-05-06-install_jruby.md +19 -2
- data/docs/_posts/2018-06-26-auto_install_picrate.md +19 -4
- data/docs/_posts/2018-11-18-building-gem.md +18 -0
- data/docs/_posts/2018-11-27-getting_started_geany.md +38 -0
- data/docs/about.md +21 -10
- data/docs/assets/android-chrome-192x192.png +0 -0
- data/docs/assets/android-chrome-512x512.png +0 -0
- data/docs/assets/favicon.ico +0 -0
- data/docs/assets/geany.png +0 -0
- data/docs/assets/jwishy_picrate.png +0 -0
- data/docs/assets/picrate.svg +251 -0
- data/docs/index.html +8 -14
- data/lib/picrate/runner.rb +6 -2
- data/lib/picrate/version.rb +1 -1
- data/library/boids/boids.rb +10 -13
- data/mvnw +234 -0
- data/picrate.gemspec +2 -1
- data/pom.rb +1 -1
- data/pom.xml +1 -1
- data/src/main/java/japplemenubar/JAppleMenuBar.java +10 -2
- data/src/main/java/monkstone/ColorUtil.java +11 -1
- data/src/main/java/monkstone/MathToolModule.java +1 -0
- data/src/main/java/monkstone/PicrateLibrary.java +1 -0
- data/src/main/java/monkstone/fastmath/Deglut.java +1 -0
- data/src/main/java/monkstone/noise/SimplexNoise.java +3 -3
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleSlider.java +8 -8
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/Slider.java +3 -3
- data/src/main/java/monkstone/slider/SliderBar.java +1 -1
- data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
- data/src/main/java/monkstone/vecmath/AppRender.java +1 -0
- data/src/main/java/monkstone/vecmath/JRender.java +1 -0
- data/src/main/java/monkstone/vecmath/ShapeRender.java +1 -0
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +8 -0
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -0
- data/src/main/java/processing/awt/PGraphicsJava2D.java +85 -16
- data/src/main/java/processing/awt/PSurfaceAWT.java +1 -1
- data/src/main/java/processing/core/PApplet.java +18 -12
- data/src/main/java/processing/core/PShape.java +1182 -305
- data/src/main/java/processing/core/PStyle.java +1 -1
- data/src/main/java/processing/core/PSurface.java +1 -1
- data/src/main/java/processing/data/FloatDict.java +196 -54
- data/src/main/java/processing/data/FloatList.java +167 -54
- data/src/main/java/processing/data/IntDict.java +211 -56
- data/src/main/java/processing/data/IntList.java +185 -52
- data/src/main/java/processing/data/JSONArray.java +69 -20
- data/src/main/java/processing/data/JSONObject.java +53 -12
- data/src/main/java/processing/data/Sort.java +40 -10
- data/src/main/java/processing/data/StringDict.java +159 -49
- data/src/main/java/processing/data/StringList.java +147 -42
- data/src/main/java/processing/data/Table.java +778 -223
- data/src/main/java/processing/data/TableRow.java +26 -2
- data/src/main/java/processing/data/XML.java +190 -50
- data/src/main/java/processing/event/Event.java +93 -0
- data/src/main/java/processing/event/KeyEvent.java +55 -13
- data/src/main/java/processing/event/MouseEvent.java +77 -1
- data/src/main/java/processing/event/TouchEvent.java +14 -1
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +8 -0
- data/src/main/java/processing/opengl/FrameBuffer.java +228 -66
- data/src/main/java/processing/opengl/LinePath.java +131 -27
- data/src/main/java/processing/opengl/LineStroker.java +30 -5
- data/src/main/java/processing/opengl/PGL.java +4066 -865
- data/src/main/java/processing/opengl/PGraphics2D.java +38 -10
- data/src/main/java/processing/opengl/PGraphics3D.java +38 -6
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +1980 -474
- data/src/main/java/processing/opengl/PJOGL.java +1460 -248
- data/src/main/java/processing/opengl/PShader.java +904 -217
- data/src/main/java/processing/opengl/PShapeOpenGL.java +1811 -487
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +278 -71
- data/src/main/java/processing/opengl/Texture.java +610 -135
- data/src/main/java/processing/opengl/VertexBuffer.java +45 -9
- data/src/main/resources/icon/icon-1024.png +0 -0
- data/src/main/resources/icon/icon-128.png +0 -0
- data/src/main/resources/icon/icon-16.png +0 -0
- data/src/main/resources/icon/icon-256.png +0 -0
- data/src/main/resources/icon/icon-32.png +0 -0
- data/src/main/resources/icon/icon-48.png +0 -0
- data/src/main/resources/icon/icon-512.png +0 -0
- data/src/main/resources/icon/icon-64.png +0 -0
- data/vendors/Rakefile +1 -1
- metadata +13 -6
- data/docs/assets/circle_collisions.png +0 -0
- data/docs/favicon.ico +0 -0
@@ -19,7 +19,7 @@ package monkstone.noise;
|
|
19
19
|
|
20
20
|
/**
|
21
21
|
*
|
22
|
-
* @author
|
22
|
+
* @author Martin Prout
|
23
23
|
*/
|
24
24
|
public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
|
25
25
|
|
@@ -92,7 +92,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
|
|
92
92
|
*
|
93
93
|
* @param xin
|
94
94
|
* @param yin
|
95
|
-
* @return
|
95
|
+
* @return noise double
|
96
96
|
*/
|
97
97
|
public static double noise(double xin, double yin) {
|
98
98
|
double n0, n1, n2; // Noise contributions from the three corners
|
@@ -297,7 +297,7 @@ public class SimplexNoise { // Simplex noise in 2D, 3D and 4D
|
|
297
297
|
* @param y
|
298
298
|
* @param z
|
299
299
|
* @param w
|
300
|
-
* @return
|
300
|
+
* @return noise double
|
301
301
|
*/
|
302
302
|
public static double noise(double x, double y, double z, double w) {
|
303
303
|
|
@@ -9,7 +9,7 @@ import processing.core.PApplet;
|
|
9
9
|
|
10
10
|
/**
|
11
11
|
*
|
12
|
-
* @author
|
12
|
+
* @author Martin Prout
|
13
13
|
*/
|
14
14
|
public abstract class SimpleSlider implements Slider {//implements Slider {
|
15
15
|
|
@@ -60,7 +60,7 @@ public abstract class SimpleSlider implements Slider {//implements Slider {
|
|
60
60
|
/**
|
61
61
|
*
|
62
62
|
*/
|
63
|
-
|
63
|
+
|
64
64
|
@Override
|
65
65
|
public void showLabel() {
|
66
66
|
displayLabel = true;
|
@@ -69,7 +69,7 @@ public abstract class SimpleSlider implements Slider {//implements Slider {
|
|
69
69
|
/**
|
70
70
|
*
|
71
71
|
*/
|
72
|
-
|
72
|
+
|
73
73
|
@Override
|
74
74
|
public void hideLabel() {
|
75
75
|
displayLabel = false;
|
@@ -78,7 +78,7 @@ public abstract class SimpleSlider implements Slider {//implements Slider {
|
|
78
78
|
/**
|
79
79
|
*
|
80
80
|
*/
|
81
|
-
|
81
|
+
|
82
82
|
@Override
|
83
83
|
public void showNumbers() {
|
84
84
|
displayValue = true;
|
@@ -99,7 +99,7 @@ public abstract class SimpleSlider implements Slider {//implements Slider {
|
|
99
99
|
/**
|
100
100
|
*
|
101
101
|
*/
|
102
|
-
|
102
|
+
|
103
103
|
@Override
|
104
104
|
public void hideBackground() {
|
105
105
|
backgroundVisible = false;
|
@@ -107,9 +107,9 @@ public abstract class SimpleSlider implements Slider {//implements Slider {
|
|
107
107
|
|
108
108
|
/**
|
109
109
|
*
|
110
|
-
* @return
|
110
|
+
* @return value as a Float
|
111
111
|
*/
|
112
|
-
|
112
|
+
|
113
113
|
@Override
|
114
114
|
public float readValue() {
|
115
115
|
return pValue;
|
@@ -140,7 +140,7 @@ public abstract class SimpleSlider implements Slider {//implements Slider {
|
|
140
140
|
*
|
141
141
|
* @param s
|
142
142
|
*/
|
143
|
-
|
143
|
+
|
144
144
|
@Override
|
145
145
|
public void labelSize(int s) {
|
146
146
|
labelSize = (s < 4) ? 4 : s;
|
@@ -7,7 +7,7 @@ package monkstone.slider;
|
|
7
7
|
|
8
8
|
/**
|
9
9
|
*
|
10
|
-
* @author
|
10
|
+
* @author Martin Prout
|
11
11
|
*/
|
12
12
|
public interface Slider {
|
13
13
|
|
@@ -44,7 +44,7 @@ public interface Slider {
|
|
44
44
|
|
45
45
|
/**
|
46
46
|
*
|
47
|
-
* @return
|
47
|
+
* @return value
|
48
48
|
*/
|
49
49
|
float readValue();
|
50
50
|
|
@@ -63,5 +63,5 @@ public interface Slider {
|
|
63
63
|
*
|
64
64
|
*/
|
65
65
|
void showNumbers();
|
66
|
-
|
66
|
+
|
67
67
|
}
|
@@ -57,10 +57,18 @@ public class Vec2 extends RubyObject {
|
|
57
57
|
vec2Cls.defineAnnotatedMethods(Vec2.class);
|
58
58
|
}
|
59
59
|
|
60
|
+
/**
|
61
|
+
*
|
62
|
+
* @return x value :double
|
63
|
+
*/
|
60
64
|
public double javax() {
|
61
65
|
return jx;
|
62
66
|
}
|
63
67
|
|
68
|
+
/**
|
69
|
+
*
|
70
|
+
* @return y value :double
|
71
|
+
*/
|
64
72
|
public double javay() {
|
65
73
|
return jy;
|
66
74
|
}
|
@@ -60,6 +60,10 @@ public class PGraphicsJava2D extends PGraphics {
|
|
60
60
|
//// boolean useOffscreen = true; // ~40fps
|
61
61
|
// boolean useOffscreen = false;
|
62
62
|
|
63
|
+
/**
|
64
|
+
*
|
65
|
+
*/
|
66
|
+
|
63
67
|
public Graphics2D g2;
|
64
68
|
// protected BufferedImage offscreen;
|
65
69
|
|
@@ -91,16 +95,45 @@ public class PGraphicsJava2D extends PGraphics {
|
|
91
95
|
Rectangle2D.Float rect = new Rectangle2D.Float();
|
92
96
|
Arc2D.Float arc = new Arc2D.Float();
|
93
97
|
|
94
|
-
|
98
|
+
/**
|
99
|
+
*
|
100
|
+
*/
|
101
|
+
protected Color tintColorObject;
|
102
|
+
|
103
|
+
/**
|
104
|
+
*
|
105
|
+
*/
|
106
|
+
protected Color fillColorObject;
|
107
|
+
|
108
|
+
/**
|
109
|
+
*
|
110
|
+
*/
|
111
|
+
public boolean fillGradient;
|
112
|
+
|
113
|
+
/**
|
114
|
+
*
|
115
|
+
*/
|
116
|
+
public Paint fillGradientObject;
|
117
|
+
|
118
|
+
/**
|
119
|
+
*
|
120
|
+
*/
|
121
|
+
protected Stroke strokeObject;
|
122
|
+
|
123
|
+
/**
|
124
|
+
*
|
125
|
+
*/
|
126
|
+
protected Color strokeColorObject;
|
95
127
|
|
96
|
-
|
97
|
-
|
98
|
-
|
128
|
+
/**
|
129
|
+
*
|
130
|
+
*/
|
131
|
+
public boolean strokeGradient;
|
99
132
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
133
|
+
/**
|
134
|
+
*
|
135
|
+
*/
|
136
|
+
public Paint strokeGradientObject;
|
104
137
|
|
105
138
|
Font fontObject;
|
106
139
|
|
@@ -110,6 +143,10 @@ public class PGraphicsJava2D extends PGraphics {
|
|
110
143
|
|
111
144
|
// INTERNAL
|
112
145
|
|
146
|
+
/**
|
147
|
+
*
|
148
|
+
*/
|
149
|
+
|
113
150
|
|
114
151
|
public PGraphicsJava2D() { }
|
115
152
|
|
@@ -256,6 +293,7 @@ public class PGraphicsJava2D extends PGraphics {
|
|
256
293
|
/**
|
257
294
|
* Still need a means to get the java.awt.Image object, since getNative()
|
258
295
|
* is going to return the {@link Graphics2D} object.
|
296
|
+
* @return
|
259
297
|
*/
|
260
298
|
@Override
|
261
299
|
public Image getImage() {
|
@@ -263,7 +301,8 @@ public class PGraphicsJava2D extends PGraphics {
|
|
263
301
|
}
|
264
302
|
|
265
303
|
|
266
|
-
/** Returns the java.awt.Graphics2D object used by this renderer.
|
304
|
+
/** Returns the java.awt.Graphics2D object used by this renderer.
|
305
|
+
* @return */
|
267
306
|
@Override
|
268
307
|
public Object getNative() {
|
269
308
|
return g2;
|
@@ -293,6 +332,11 @@ public class PGraphicsJava2D extends PGraphics {
|
|
293
332
|
|
294
333
|
// Graphics2D g2old;
|
295
334
|
|
335
|
+
/**
|
336
|
+
*
|
337
|
+
* @return
|
338
|
+
*/
|
339
|
+
|
296
340
|
public Graphics2D checkImage() {
|
297
341
|
if (image == null ||
|
298
342
|
((BufferedImage) image).getWidth() != width*pixelDensity ||
|
@@ -1323,6 +1367,11 @@ public class PGraphicsJava2D extends PGraphics {
|
|
1323
1367
|
|
1324
1368
|
// JAVA2D SHAPE/PATH HANDLING
|
1325
1369
|
|
1370
|
+
/**
|
1371
|
+
*
|
1372
|
+
* @param s
|
1373
|
+
*/
|
1374
|
+
|
1326
1375
|
|
1327
1376
|
protected void fillShape(Shape s) {
|
1328
1377
|
if (fillGradient) {
|
@@ -1334,8 +1383,11 @@ public class PGraphicsJava2D extends PGraphics {
|
|
1334
1383
|
}
|
1335
1384
|
}
|
1336
1385
|
|
1337
|
-
|
1338
|
-
|
1386
|
+
/**
|
1387
|
+
*
|
1388
|
+
* @param s
|
1389
|
+
*/
|
1390
|
+
protected void strokeShape(Shape s) {
|
1339
1391
|
if (strokeGradient) {
|
1340
1392
|
g2.setPaint(strokeGradientObject);
|
1341
1393
|
g2.draw(s);
|
@@ -1345,8 +1397,11 @@ public class PGraphicsJava2D extends PGraphics {
|
|
1345
1397
|
}
|
1346
1398
|
}
|
1347
1399
|
|
1348
|
-
|
1349
|
-
|
1400
|
+
/**
|
1401
|
+
*
|
1402
|
+
* @param s
|
1403
|
+
*/
|
1404
|
+
protected void drawShape(Shape s) {
|
1350
1405
|
if (fillGradient) {
|
1351
1406
|
g2.setPaint(fillGradientObject);
|
1352
1407
|
g2.fill(s);
|
@@ -1559,6 +1614,7 @@ public class PGraphicsJava2D extends PGraphics {
|
|
1559
1614
|
|
1560
1615
|
/**
|
1561
1616
|
* Handle renderer-specific image drawing.
|
1617
|
+
* @param who
|
1562
1618
|
*/
|
1563
1619
|
@Override
|
1564
1620
|
protected void imageImpl(PImage who,
|
@@ -2430,8 +2486,10 @@ public class PGraphicsJava2D extends PGraphics {
|
|
2430
2486
|
strokeImpl();
|
2431
2487
|
}
|
2432
2488
|
|
2433
|
-
|
2434
|
-
|
2489
|
+
/**
|
2490
|
+
*
|
2491
|
+
*/
|
2492
|
+
protected void strokeImpl() {
|
2435
2493
|
int cap = BasicStroke.CAP_BUTT;
|
2436
2494
|
if (strokeCap == ROUND) {
|
2437
2495
|
cap = BasicStroke.CAP_ROUND;
|
@@ -2553,7 +2611,11 @@ public class PGraphicsJava2D extends PGraphics {
|
|
2553
2611
|
|
2554
2612
|
int[] clearPixels;
|
2555
2613
|
|
2556
|
-
|
2614
|
+
/**
|
2615
|
+
*
|
2616
|
+
* @param color
|
2617
|
+
*/
|
2618
|
+
protected void clearPixels(int color) {
|
2557
2619
|
// On a hi-res display, image may be larger than width/height
|
2558
2620
|
int imageWidth = image.getWidth(null);
|
2559
2621
|
int imageHeight = image.getHeight(null);
|
@@ -2710,6 +2772,11 @@ public class PGraphicsJava2D extends PGraphics {
|
|
2710
2772
|
|
2711
2773
|
// getImage, setCache, getCache, removeCache, isModified, setModified
|
2712
2774
|
|
2775
|
+
/**
|
2776
|
+
*
|
2777
|
+
* @return
|
2778
|
+
*/
|
2779
|
+
|
2713
2780
|
|
2714
2781
|
protected WritableRaster getRaster() {
|
2715
2782
|
WritableRaster raster = null;
|
@@ -2783,6 +2850,8 @@ public class PGraphicsJava2D extends PGraphics {
|
|
2783
2850
|
* <P>
|
2784
2851
|
* Unlike in PImage, where updatePixels() only requests that the
|
2785
2852
|
* update happens, in PGraphicsJava2D, this will happen immediately.
|
2853
|
+
* @param d
|
2854
|
+
* @param c
|
2786
2855
|
*/
|
2787
2856
|
@Override
|
2788
2857
|
public void updatePixels(int x, int y, int c, int d) {
|