propane 3.11.0-java → 4.0.0-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +1 -1
  3. data/CHANGELOG.md +2 -0
  4. data/README.md +5 -5
  5. data/Rakefile +1 -1
  6. data/lib/propane/app.rb +2 -2
  7. data/lib/propane/version.rb +1 -1
  8. data/lib/propane-4.0.0.jar +0 -0
  9. data/library/slider/slider.rb +1 -1
  10. data/pom.rb +8 -8
  11. data/pom.xml +8 -8
  12. data/propane.gemspec +3 -3
  13. data/src/main/java/monkstone/ColorUtil.java +1 -1
  14. data/src/main/java/monkstone/MathToolModule.java +1 -1
  15. data/src/main/java/monkstone/PropaneLibrary.java +1 -1
  16. data/src/main/java/monkstone/fastmath/DegLutTables.java +10 -11
  17. data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
  18. data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
  19. data/src/main/java/monkstone/noise/LICENSE +121 -0
  20. data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
  21. data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
  22. data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
  23. data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
  24. data/src/main/java/monkstone/slider/SliderBar.java +1 -1
  25. data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
  26. data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
  27. data/src/main/java/monkstone/vecmath/package-info.java +1 -1
  28. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +92 -68
  29. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
  30. data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
  31. data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
  32. data/src/main/java/monkstone/videoevent/package-info.java +1 -1
  33. data/src/main/java/processing/awt/PGraphicsJava2D.java +0 -1
  34. data/src/main/java/processing/awt/PImageAWT.java +2 -4
  35. data/src/main/java/processing/core/PApplet.java +4 -4
  36. data/src/main/java/processing/core/PImage.java +3025 -3047
  37. data/src/main/java/processing/core/PMatrix.java +5 -2
  38. data/src/main/java/processing/data/DoubleDict.java +72 -43
  39. data/src/main/java/processing/data/DoubleList.java +6 -2
  40. data/src/main/java/processing/data/FloatDict.java +744 -756
  41. data/src/main/java/processing/data/FloatList.java +68 -26
  42. data/src/main/java/processing/data/IntDict.java +72 -45
  43. data/src/main/java/processing/data/IntList.java +63 -26
  44. data/src/main/java/processing/data/JSONArray.java +892 -931
  45. data/src/main/java/processing/data/JSONObject.java +1169 -1262
  46. data/src/main/java/processing/data/JSONTokener.java +30 -49
  47. data/src/main/java/processing/data/LongDict.java +699 -712
  48. data/src/main/java/processing/data/LongList.java +676 -700
  49. data/src/main/java/processing/data/Sort.java +1 -0
  50. data/src/main/java/processing/data/Table.java +4040 -3661
  51. data/src/main/java/processing/data/TableRow.java +16 -0
  52. data/src/main/java/processing/data/XML.java +1041 -956
  53. data/src/main/java/processing/event/TouchEvent.java +1 -1
  54. data/src/main/java/processing/opengl/FontTexture.java +2 -2
  55. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +15 -18
  56. data/src/main/java/processing/opengl/PJOGL.java +2 -2
  57. data/src/main/java/processing/opengl/PShapeOpenGL.java +23 -24
  58. data/test/vecmath_spec_test.rb +14 -3
  59. data/vendors/Rakefile +1 -1
  60. metadata +9 -8
  61. data/lib/propane-3.11.0.jar +0 -0
@@ -43,18 +43,21 @@ public interface PMatrix {
43
43
 
44
44
  /**
45
45
  * Returns a copy of this PMatrix.
46
+ * @return
46
47
  */
47
48
  public PMatrix get();
48
49
 
49
50
  /**
50
- * Copies the matrix contents into a float array.
51
- * If target is null (or not the correct size), a new array will be created.
51
+ * Copies the matrix contents into a float array.If target is null (or not the correct size), a new array will be created.
52
+ * @param target
53
+ * @return
52
54
  */
53
55
  public float[] get(float[] target);
54
56
 
55
57
 
56
58
  /**
57
59
  * Make this matrix become a copy of src.
60
+ * @param src
58
61
  */
59
62
  public void set(PMatrix src);
60
63
 
@@ -1,6 +1,9 @@
1
1
  package processing.data;
2
2
 
3
- import java.io.*;
3
+ //import java.io.*;
4
+ import java.io.BufferedReader;
5
+ import java.io.File;
6
+ import java.io.PrintWriter;
4
7
  import java.util.HashMap;
5
8
  import java.util.Iterator;
6
9
  import java.util.Map;
@@ -36,9 +39,10 @@ public class DoubleDict {
36
39
 
37
40
 
38
41
  /**
39
- * Create a new lookup with a specific size. This is more efficient than not
40
- * specifying a size. Use it when you know the rough size of the thing you're creating.
42
+ * Create a new lookup with a specific size.This is more efficient than not
43
+ specifying a size. Use it when you know the rough size of the thing you're creating.
41
44
  *
45
+ * @param length
42
46
  * @nowebref
43
47
  */
44
48
  public DoubleDict(int length) {
@@ -52,6 +56,7 @@ public class DoubleDict {
52
56
  * Read a set of entries from a Reader that has each key/value pair on
53
57
  * a single line, separated by a tab.
54
58
  *
59
+ * @param reader
55
60
  * @nowebref
56
61
  */
57
62
  public DoubleDict(BufferedReader reader) {
@@ -59,19 +64,21 @@ public class DoubleDict {
59
64
  keys = new String[lines.length];
60
65
  values = new double[lines.length];
61
66
 
62
- for (int i = 0; i < lines.length; i++) {
63
- String[] pieces = PApplet.split(lines[i], '\t');
64
- if (pieces.length == 2) {
65
- keys[count] = pieces[0];
66
- values[count] = PApplet.parseFloat(pieces[1]);
67
- indices.put(pieces[0], count);
68
- count++;
67
+ for (String line : lines) {
68
+ String[] pieces = PApplet.split(line, '\t');
69
+ if (pieces.length == 2) {
70
+ keys[count] = pieces[0];
71
+ values[count] = PApplet.parseFloat(pieces[1]);
72
+ indices.put(pieces[0], count);
73
+ count++;
74
+ }
69
75
  }
70
- }
71
76
  }
72
77
 
73
78
 
74
79
  /**
80
+ * @param keys
81
+ * @param values
75
82
  * @nowebref
76
83
  */
77
84
  public DoubleDict(String[] keys, double[] values) {
@@ -95,6 +102,7 @@ public class DoubleDict {
95
102
  * { "key2", 2 }
96
103
  * });
97
104
  * </pre>
105
+ * @param pairs
98
106
  */
99
107
  public DoubleDict(Object[][] pairs) {
100
108
  count = pairs.length;
@@ -123,6 +131,7 @@ public class DoubleDict {
123
131
 
124
132
 
125
133
  /**
134
+ * @return
126
135
  * @webref doubledict:method
127
136
  * @brief Returns the number of key/value pairs
128
137
  */
@@ -132,8 +141,8 @@ public class DoubleDict {
132
141
 
133
142
 
134
143
  /**
135
- * Resize the internal data, this can only be used to shrink the list.
136
- * Helpful for situations like sorting and then grabbing the top 50 entries.
144
+ * Resize the internal data, this can only be used to shrink the list.Helpful for situations like sorting and then grabbing the top 50 entries.
145
+ * @param length
137
146
  */
138
147
  public void resize(int length) {
139
148
  if (length == count) return;
@@ -191,12 +200,7 @@ public class DoubleDict {
191
200
 
192
201
 
193
202
  public Iterable<Entry> entries() {
194
- return new Iterable<Entry>() {
195
-
196
- public Iterator<Entry> iterator() {
197
- return entryIterator();
198
- }
199
- };
203
+ return this::entryIterator;
200
204
  }
201
205
 
202
206
 
@@ -204,17 +208,20 @@ public class DoubleDict {
204
208
  return new Iterator<Entry>() {
205
209
  int index = -1;
206
210
 
211
+ @Override
207
212
  public void remove() {
208
213
  removeIndex(index);
209
214
  index--;
210
215
  }
211
216
 
217
+ @Override
212
218
  public Entry next() {
213
219
  ++index;
214
220
  Entry e = new Entry(keys[index], values[index]);
215
221
  return e;
216
222
  }
217
223
 
224
+ @Override
218
225
  public boolean hasNext() {
219
226
  return index+1 < size();
220
227
  }
@@ -239,13 +246,7 @@ public class DoubleDict {
239
246
 
240
247
 
241
248
  public Iterable<String> keys() {
242
- return new Iterable<String>() {
243
-
244
- @Override
245
- public Iterator<String> iterator() {
246
- return keyIterator();
247
- }
248
- };
249
+ return this::keyIterator;
249
250
  }
250
251
 
251
252
 
@@ -254,15 +255,18 @@ public class DoubleDict {
254
255
  return new Iterator<String>() {
255
256
  int index = -1;
256
257
 
258
+ @Override
257
259
  public void remove() {
258
260
  removeIndex(index);
259
261
  index--;
260
262
  }
261
263
 
264
+ @Override
262
265
  public String next() {
263
266
  return key(++index);
264
267
  }
265
268
 
269
+ @Override
266
270
  public boolean hasNext() {
267
271
  return index+1 < size();
268
272
  }
@@ -271,8 +275,9 @@ public class DoubleDict {
271
275
 
272
276
 
273
277
  /**
274
- * Return a copy of the internal keys array. This array can be modified.
278
+ * Return a copy of the internal keys array.This array can be modified.
275
279
  *
280
+ * @return
276
281
  * @webref doubledict:method
277
282
  * @brief Return a copy of the internal keys array
278
283
  */
@@ -297,17 +302,12 @@ public class DoubleDict {
297
302
 
298
303
 
299
304
  /**
305
+ * @return
300
306
  * @webref doubledict:method
301
307
  * @brief Return the internal array being used to store the values
302
308
  */
303
309
  public Iterable<Double> values() {
304
- return new Iterable<Double>() {
305
-
306
- @Override
307
- public Iterator<Double> iterator() {
308
- return valueIterator();
309
- }
310
- };
310
+ return () -> valueIterator();
311
311
  }
312
312
 
313
313
 
@@ -315,15 +315,18 @@ public class DoubleDict {
315
315
  return new Iterator<Double>() {
316
316
  int index = -1;
317
317
 
318
+ @Override
318
319
  public void remove() {
319
320
  removeIndex(index);
320
321
  index--;
321
322
  }
322
323
 
324
+ @Override
323
325
  public Double next() {
324
326
  return value(++index);
325
327
  }
326
328
 
329
+ @Override
327
330
  public boolean hasNext() {
328
331
  return index+1 < size();
329
332
  }
@@ -334,6 +337,7 @@ public class DoubleDict {
334
337
  /**
335
338
  * Create a new array and copy each of the values into it.
336
339
  *
340
+ * @return
337
341
  * @webref doubledict:method
338
342
  * @brief Create a new array and copy each of the values into it
339
343
  */
@@ -345,8 +349,10 @@ public class DoubleDict {
345
349
 
346
350
  /**
347
351
  * Fill an already-allocated array with the values (more efficient than
348
- * creating a new array each time). If 'array' is null, or not the same
352
+ * creating a new array each time).If 'array' is null, or not the same
349
353
  * size as the number of values, a new array will be allocated and returned.
354
+ * @param array
355
+ * @return
350
356
  */
351
357
  public double[] valueArray(double[] array) {
352
358
  if (array == null || array.length != size()) {
@@ -360,6 +366,8 @@ public class DoubleDict {
360
366
  /**
361
367
  * Return a value for the specified key.
362
368
  *
369
+ * @param key
370
+ * @return
363
371
  * @webref doubledict:method
364
372
  * @brief Return a value for the specified key
365
373
  */
@@ -382,6 +390,8 @@ public class DoubleDict {
382
390
 
383
391
 
384
392
  /**
393
+ * @param key
394
+ * @param amount
385
395
  * @webref doubledict:method
386
396
  * @brief Create a new key/value pair or change the value of one
387
397
  */
@@ -405,6 +415,8 @@ public class DoubleDict {
405
415
 
406
416
 
407
417
  /**
418
+ * @param key
419
+ * @return
408
420
  * @webref doubledict:method
409
421
  * @brief Check if a key is a part of the data structure
410
422
  */
@@ -414,6 +426,8 @@ public class DoubleDict {
414
426
 
415
427
 
416
428
  /**
429
+ * @param key
430
+ * @param amount
417
431
  * @webref doubledict:method
418
432
  * @brief Add to a value
419
433
  */
@@ -428,6 +442,8 @@ public class DoubleDict {
428
442
 
429
443
 
430
444
  /**
445
+ * @param key
446
+ * @param amount
431
447
  * @webref doubledict:method
432
448
  * @brief Subtract from a value
433
449
  */
@@ -437,6 +453,8 @@ public class DoubleDict {
437
453
 
438
454
 
439
455
  /**
456
+ * @param key
457
+ * @param amount
440
458
  * @webref doubledict:method
441
459
  * @brief Multiply a value
442
460
  */
@@ -449,6 +467,8 @@ public class DoubleDict {
449
467
 
450
468
 
451
469
  /**
470
+ * @param key
471
+ * @param amount
452
472
  * @webref doubledict:method
453
473
  * @brief Divide a value
454
474
  */
@@ -471,6 +491,7 @@ public class DoubleDict {
471
491
 
472
492
 
473
493
  /**
494
+ * @return
474
495
  * @webref doublelist:method
475
496
  * @brief Return the smallest value
476
497
  */
@@ -525,6 +546,7 @@ public class DoubleDict {
525
546
 
526
547
 
527
548
  /**
549
+ * @return
528
550
  * @webref doublelist:method
529
551
  * @brief Return the largest value
530
552
  */
@@ -558,7 +580,8 @@ public class DoubleDict {
558
580
  }
559
581
 
560
582
 
561
- /** The key for a max value; null if empty or everything is NaN (no max). */
583
+ /** The key for a max value; null if empty or everything is NaN (no max).
584
+ * @return */
562
585
  public String maxKey() {
563
586
  //checkMinMax("maxKey");
564
587
  int index = maxIndex();
@@ -569,7 +592,8 @@ public class DoubleDict {
569
592
  }
570
593
 
571
594
 
572
- /** The max value. (Or NaN if no entries or they're all NaN.) */
595
+ /** * The max value.(Or NaN if no entries or they're all NaN.)
596
+ * @return */
573
597
  public double maxValue() {
574
598
  //checkMinMax("maxValue");
575
599
  int index = maxIndex();
@@ -591,7 +615,7 @@ public class DoubleDict {
591
615
 
592
616
  public int index(String what) {
593
617
  Integer found = indices.get(what);
594
- return (found == null) ? -1 : found.intValue();
618
+ return (found == null) ? -1 : found;
595
619
  }
596
620
 
597
621
 
@@ -600,7 +624,7 @@ public class DoubleDict {
600
624
  keys = PApplet.expand(keys);
601
625
  values = PApplet.expand(values);
602
626
  }
603
- indices.put(what, Integer.valueOf(count));
627
+ indices.put(what, count);
604
628
  keys[count] = what;
605
629
  values[count] = much;
606
630
  count++;
@@ -608,6 +632,8 @@ public class DoubleDict {
608
632
 
609
633
 
610
634
  /**
635
+ * @param key
636
+ * @return
611
637
  * @webref doubledict:method
612
638
  * @brief Remove a key/value pair
613
639
  */
@@ -789,7 +815,8 @@ public class DoubleDict {
789
815
  }
790
816
 
791
817
 
792
- /** Returns a duplicate copy of this object. */
818
+ /** Returns a duplicate copy of this object.
819
+ * @return */
793
820
  public DoubleDict copy() {
794
821
  DoubleDict outgoing = new DoubleDict(count);
795
822
  System.arraycopy(keys, 0, outgoing.keys, 0, count);
@@ -811,11 +838,12 @@ public class DoubleDict {
811
838
 
812
839
  /**
813
840
  * Save tab-delimited entries to a file (TSV format, UTF-8 encoding)
841
+ * @param file
814
842
  */
815
843
  public void save(File file) {
816
- PrintWriter writer = PApplet.createWriter(file);
817
- write(writer);
818
- writer.close();
844
+ try (PrintWriter writer = PApplet.createWriter(file)) {
845
+ write(writer);
846
+ }
819
847
  }
820
848
 
821
849
 
@@ -833,6 +861,7 @@ public class DoubleDict {
833
861
 
834
862
  /**
835
863
  * Return this dictionary as a String in JSON format.
864
+ * @return
836
865
  */
837
866
  public String toJSON() {
838
867
  StringList items = new StringList();
@@ -32,6 +32,7 @@ public class DoubleList implements Iterable<Double> {
32
32
 
33
33
 
34
34
  /**
35
+ * @param length
35
36
  * @nowebref
36
37
  */
37
38
  public DoubleList(int length) {
@@ -40,6 +41,7 @@ public class DoubleList implements Iterable<Double> {
40
41
 
41
42
 
42
43
  /**
44
+ * @param list
43
45
  * @nowebref
44
46
  */
45
47
  public DoubleList(double[] list) {
@@ -50,9 +52,9 @@ public class DoubleList implements Iterable<Double> {
50
52
 
51
53
 
52
54
  /**
53
- * Construct an FloatList from an iterable pile of objects.
54
- * For instance, a double array, an array of strings, who knows).
55
+ * Construct an FloatList from an iterable pile of objects.For instance, a double array, an array of strings, who knows).
55
56
  * Un-parseable or null values will be set to NaN.
57
+ * @param iter
56
58
  * @nowebref
57
59
  */
58
60
  public DoubleList(Iterable<Object> iter) {
@@ -904,6 +906,7 @@ public class DoubleList implements Iterable<Double> {
904
906
 
905
907
  /**
906
908
  * Write entries to a PrintWriter, one per line
909
+ * @param writer
907
910
  */
908
911
  public void write(PrintWriter writer) {
909
912
  for (int i = 0; i < count; i++) {
@@ -915,6 +918,7 @@ public class DoubleList implements Iterable<Double> {
915
918
 
916
919
  /**
917
920
  * Return this dictionary as a String in JSON format.
921
+ * @return
918
922
  */
919
923
  public String toJSON() {
920
924
  return "[ " + join(", ") + " ]";