picrate 1.3.0-java → 2.0.0.pre-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +1 -1
  3. data/.mvn/wrapper/maven-wrapper.properties +2 -2
  4. data/CHANGELOG.md +2 -1
  5. data/Gemfile +3 -1
  6. data/README.md +4 -2
  7. data/Rakefile +8 -4
  8. data/bin/picrate +3 -1
  9. data/docs/_posts/2019-11-11-getting_started_buster.md +1 -1
  10. data/lib/picrate.rb +1 -1
  11. data/lib/picrate/app.rb +10 -3
  12. data/lib/picrate/creators/parameters.rb +8 -8
  13. data/lib/picrate/creators/sketch_factory.rb +5 -3
  14. data/lib/picrate/helper_methods.rb +21 -21
  15. data/lib/picrate/helpers/numeric.rb +2 -0
  16. data/lib/picrate/library.rb +5 -1
  17. data/lib/picrate/library_loader.rb +2 -0
  18. data/lib/picrate/native_folder.rb +6 -4
  19. data/lib/picrate/native_loader.rb +3 -0
  20. data/lib/picrate/runner.rb +1 -0
  21. data/lib/picrate/version.rb +1 -1
  22. data/library/boids/boids.rb +17 -8
  23. data/library/chooser/chooser.rb +10 -9
  24. data/library/color_group/color_group.rb +2 -0
  25. data/library/control_panel/control_panel.rb +7 -4
  26. data/library/dxf/dxf.rb +2 -0
  27. data/library/library_proxy/library_proxy.rb +2 -0
  28. data/library/net/net.rb +2 -0
  29. data/library/slider/slider.rb +24 -23
  30. data/library/vector_utils/vector_utils.rb +4 -0
  31. data/library/video_event/video_event.rb +2 -0
  32. data/picrate.gemspec +14 -12
  33. data/pom.rb +15 -15
  34. data/pom.xml +5 -5
  35. data/src/main/java/monkstone/ColorUtil.java +1 -1
  36. data/src/main/java/monkstone/MathToolModule.java +1 -1
  37. data/src/main/java/monkstone/PicrateLibrary.java +8 -8
  38. data/src/main/java/monkstone/fastmath/Deglut.java +16 -16
  39. data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
  40. data/src/main/java/monkstone/noise/SimplexNoise.java +3 -3
  41. data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
  42. data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
  43. data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +12 -12
  44. data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
  45. data/src/main/java/monkstone/slider/SliderBar.java +1 -1
  46. data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
  47. data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
  48. data/src/main/java/monkstone/vecmath/package-info.java +1 -1
  49. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
  50. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
  51. data/src/main/java/monkstone/videoevent/CaptureEvent.java +1 -1
  52. data/src/main/java/monkstone/videoevent/MovieEvent.java +1 -1
  53. data/src/main/java/monkstone/videoevent/package-info.java +1 -1
  54. data/src/main/java/processing/awt/PGraphicsJava2D.java +11 -13
  55. data/src/main/java/processing/awt/PSurfaceAWT.java +0 -20
  56. data/src/main/java/processing/core/PApplet.java +1949 -2247
  57. data/src/main/java/processing/core/PConstants.java +180 -180
  58. data/src/main/java/processing/core/PFont.java +2 -2
  59. data/src/main/java/processing/core/PGraphics.java +90 -90
  60. data/src/main/java/processing/core/PImage.java +65 -65
  61. data/src/main/java/processing/core/PMatrix.java +39 -39
  62. data/src/main/java/processing/core/PSurface.java +37 -37
  63. data/src/main/java/processing/core/PVector.java +2 -2
  64. data/src/main/java/processing/data/FloatDict.java +251 -284
  65. data/src/main/java/processing/data/TableRow.java +32 -32
  66. data/src/main/java/processing/dxf/RawDXF.java +3 -3
  67. data/src/main/java/processing/net/Client.java +1 -1
  68. data/src/main/java/processing/opengl/PGL.java +3884 -3950
  69. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +38 -21
  70. data/src/main/java/processing/opengl/PSurfaceJOGL.java +42 -61
  71. data/test/color_group_test.rb +4 -4
  72. data/test/deglut_spec_test.rb +2 -0
  73. data/test/helper_methods_test.rb +41 -13
  74. data/test/math_tool_test.rb +46 -37
  75. data/test/respond_to_test.rb +5 -3
  76. data/test/sketches/key_event.rb +2 -2
  77. data/test/sketches/library/my_library/my_library.rb +3 -0
  78. data/test/test_helper.rb +2 -0
  79. data/test/vecmath_spec_test.rb +30 -19
  80. data/vendors/Rakefile +2 -2
  81. metadata +29 -17
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative 'test_helper'
4
4
 
5
- METHODS = %i(
5
+ METHODS = %i[
6
6
  alpha
7
7
  ambient
8
8
  ambient_light
@@ -181,7 +181,7 @@ METHODS = %i(
181
181
  update_pixels
182
182
  vertex
183
183
  width
184
- )
184
+ ].freeze
185
185
 
186
186
  class TestSketch < Processing::App
187
187
  def settings
@@ -193,7 +193,9 @@ class TestSketch < Processing::App
193
193
  end
194
194
 
195
195
  def draw
196
- exit if frame_count > 30
196
+ exit if frame_count > 20
197
+
198
+ background 0, 200, 0
197
199
  end
198
200
  end
199
201
 
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env jruby
2
- require 'picrate'
2
+ # frozen_string_literal: true
3
3
 
4
+ require 'picrate'
4
5
 
5
6
  class CustomProxySketch < Processing::App
6
-
7
7
  # A simple demonstration of vanilla processing 'reflection' methods using
8
8
  # picrate :library_proxy. See my_library.rb code for the guts.
9
9
  load_libraries :library_proxy, :my_library
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This class demonstrates how by inheriting from the abstract class LibraryProxy
2
4
  # we can access 'keyEvent' and 'draw' (Note we need a draw method even
3
5
  # though can be empty)
@@ -20,6 +22,7 @@ class MyLibrary < LibraryProxy
20
22
  def keyEvent(e) # NB: need camel case for reflection to work
21
23
  return unless e.get_action == KeyEvent::PRESS
22
24
  return if e.get_key > 122 # else we can't use :chr
25
+
23
26
  case e.get_key.chr.upcase
24
27
  when 'S'
25
28
  app.send :hide, false
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  gem 'minitest'
2
4
  require 'java'
3
5
  require_relative '../lib/picrate'
@@ -1,12 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'test_helper'
2
4
 
3
5
  Java::Monkstone::PicrateLibrary.load(JRuby.runtime)
4
6
 
5
-
6
7
  Dir.chdir(File.dirname(__FILE__))
7
8
 
8
9
  class VecmathTest < Minitest::Test
9
-
10
10
  # duck for Vec2D constructor
11
11
  Point = Struct.new(:x, :y)
12
12
  # duck for Vec3D constructor
@@ -15,12 +15,11 @@ class VecmathTest < Minitest::Test
15
15
  Pointless = Struct.new(:a, :b)
16
16
  # non-duck to test fail
17
17
  Pointless3 = Struct.new(:a, :b, :c)
18
- def setup
19
-
20
- end
18
+ def setup; end
21
19
 
22
20
  def test_equals
23
- x, y = 1.0000001, 1.01
21
+ x = 1.0000001
22
+ y = 1.01
24
23
  a = Vec2D.new(x, y)
25
24
  assert_equal(a.to_a, [x, y], 'Failed to return Vec2D as an Array')
26
25
  end
@@ -32,7 +31,8 @@ class VecmathTest < Minitest::Test
32
31
  end
33
32
 
34
33
  def test_copy_equals
35
- x, y = 1.0000001, 1.01
34
+ x = 1.0000001
35
+ y = 1.01
36
36
  a = Vec2D.new(x, y)
37
37
  b = a.copy
38
38
  assert_equal(a.to_a, b.to_a, 'Failed deep copy')
@@ -58,7 +58,8 @@ class VecmathTest < Minitest::Test
58
58
  end
59
59
 
60
60
  def test_copy_not_equals
61
- x, y = 1.0000001, 1.01
61
+ x = 1.0000001
62
+ y = 1.01
62
63
  a = Vec2D.new(x, y)
63
64
  b = a.copy
64
65
  b *= 0
@@ -119,7 +120,7 @@ class VecmathTest < Minitest::Test
119
120
 
120
121
  def test_random
121
122
  a = Vec2D.random
122
- assert a.kind_of? Vec2D
123
+ assert a.is_a? Vec2D
123
124
  assert_in_epsilon(a.mag, 1.0)
124
125
  end
125
126
 
@@ -131,7 +132,7 @@ class VecmathTest < Minitest::Test
131
132
 
132
133
  def test_mag
133
134
  a = Vec2D.new(-3, -4)
134
- assert_in_epsilon(a.mag, 5, 0.001,'Failed to return magnitude of vector')
135
+ assert_in_epsilon(a.mag, 5, 0.001, 'Failed to return magnitude of vector')
135
136
  end
136
137
 
137
138
  def test_mag_variant
@@ -225,14 +226,16 @@ class VecmathTest < Minitest::Test
225
226
  end
226
227
 
227
228
  def test_rotate
228
- x, y = 20, 10
229
+ x = 20
230
+ y = 10
229
231
  b = Vec2D.new(x, y)
230
232
  a = b.rotate(Math::PI / 2)
231
233
  assert_equal(a, Vec2D.new(-10, 20), 'Failed to rotate vector by scalar radians')
232
234
  end
233
235
 
234
236
  def test_hash_index
235
- x, y = 10, 20
237
+ x = 10
238
+ y = 20
236
239
  b = Vec2D.new(x, y)
237
240
  assert_equal(b[:x], x, 'Failed to hash index')
238
241
  end
@@ -267,7 +270,7 @@ class VecmathTest < Minitest::Test
267
270
  a = Vec2D.new(200, 0)
268
271
  b = Vec2D.new(0, 200)
269
272
  # Expected result is an area, twice that of the triangle created by the vectors
270
- assert_equal((a).cross(b).abs, 40_000.0, 'Failed area test using 2D vector cross product')
273
+ assert_equal(a.cross(b).abs, 40_000.0, 'Failed area test using 2D vector cross product')
271
274
  end
272
275
 
273
276
  def test_cross_non_zero # Could be used to calculate area of triangle
@@ -286,7 +289,9 @@ class VecmathTest < Minitest::Test
286
289
  end
287
290
 
288
291
  def test_equals3
289
- x, y, z = 1.0000001, 1.01, 0.0
292
+ x = 1.0000001
293
+ y = 1.01
294
+ z = 0.0
290
295
  a = Vec3D.new(x, y)
291
296
  assert_equal(a.to_a, [x, y, z], 'Failed to return Vec3D as an Array')
292
297
  end
@@ -317,14 +322,18 @@ class VecmathTest < Minitest::Test
317
322
  end
318
323
 
319
324
  def test_copy_equals3
320
- x, y, z = 1.0000001, 1.01, 1
325
+ x = 1.0000001
326
+ y = 1.01
327
+ z = 1
321
328
  a = Vec3D.new(x, y, z)
322
329
  b = a.copy
323
330
  assert_equal(a.to_a, b.to_a, 'Failed deep copy')
324
331
  end
325
332
 
326
333
  def test_copy_not_equals3
327
- x, y, z = 1.0000001, 1.01, 6.0
334
+ x = 1.0000001
335
+ y = 1.01
336
+ z = 6.0
328
337
  a = Vec3D.new(x, y, z)
329
338
  b = a.copy
330
339
  b *= 0
@@ -369,13 +378,13 @@ class VecmathTest < Minitest::Test
369
378
 
370
379
  def test_random3
371
380
  a = Vec3D.random
372
- assert a.kind_of? Vec3D
381
+ assert a.is_a? Vec3D
373
382
  assert_in_epsilon(a.mag, 1.0)
374
383
  end
375
384
 
376
385
  def test_assign_value3
377
386
  a = Vec3D.new(3, 5)
378
- a.x=23
387
+ a.x = 23
379
388
  assert_equal(a.x, 23, 'Failed to assign x value')
380
389
  end
381
390
 
@@ -504,7 +513,9 @@ class VecmathTest < Minitest::Test
504
513
  end
505
514
 
506
515
  def test_hash_key3
507
- x, y, z = 10, 20, 50
516
+ x = 10
517
+ y = 20
518
+ z = 50
508
519
  b = Vec3D.new(x, y, z)
509
520
  assert_equal(b[:x], x, 'Failed hash key access')
510
521
  assert_equal(b[:y], y, 'Failed hash key access')
@@ -7,7 +7,7 @@ SOUND = 'sound.zip'
7
7
  SOUND_VERSION = 'v1.3.2'
8
8
  VIDEO = 'video-2.0-beta4.zip'
9
9
  VIDEO_VERSION = 'r6-v2.0-beta4'
10
- EXAMPLES = '0.5.3'
10
+ EXAMPLES = '0.5.2'
11
11
  HOME_DIR = ENV['HOME']
12
12
  LIBRARY = File.join(HOME_DIR, '.picrate', 'libraries')
13
13
  PROJECT_DIR = File.join(HOME_DIR, 'projects')
@@ -96,5 +96,5 @@ task copy_video: "/tmp/#{VIDEO}" do
96
96
  system "unzip -d /tmp /tmp/#{VIDEO}"
97
97
  FileUtils.rm_r "#{LIBRARY}/video" if File.exist? "#{LIBRARY}/video"
98
98
  FileUtils.mkdir_p "#{LIBRARY}/video/library"
99
- FileUtils.mv Dir.glob("/tmp/video/library/*.jar"), "#{LIBRARY}/video/library"
99
+ FileUtils.mv Dir.glob('/tmp/video/library/*.jar'), "#{LIBRARY}/video/library"
100
100
  end
metadata CHANGED
@@ -1,64 +1,70 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0.pre
5
5
  platform: java
6
6
  authors:
7
7
  - monkstone
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-22 00:00:00.000000000 Z
11
+ date: 2020-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '12.3'
18
+ version: '5.10'
19
+ name: minitest
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '12.3'
26
+ version: '5.10'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
- version: '5.10'
32
+ version: '12.3'
33
+ name: rake
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '5.10'
40
+ version: '12.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: arcball
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.0'
47
+ - - ">="
46
48
  - !ruby/object:Gem::Version
47
49
  version: 1.0.1
50
+ name: arcball
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '1.0'
58
+ - - ">="
53
59
  - !ruby/object:Gem::Version
54
60
  version: 1.0.1
55
61
  - !ruby/object:Gem::Dependency
56
- name: geomerative
57
62
  requirement: !ruby/object:Gem::Requirement
58
63
  requirements:
59
64
  - - "~>"
60
65
  - !ruby/object:Gem::Version
61
66
  version: '1.1'
67
+ name: geomerative
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
@@ -67,17 +73,23 @@ dependencies:
67
73
  - !ruby/object:Gem::Version
68
74
  version: '1.1'
69
75
  - !ruby/object:Gem::Dependency
70
- name: ruby_wordcram
71
76
  requirement: !ruby/object:Gem::Requirement
72
77
  requirements:
73
78
  - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '2.0'
81
+ - - ">="
74
82
  - !ruby/object:Gem::Version
75
83
  version: 2.0.4
84
+ name: ruby_wordcram
76
85
  type: :runtime
77
86
  prerelease: false
78
87
  version_requirements: !ruby/object:Gem::Requirement
79
88
  requirements:
80
89
  - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '2.0'
92
+ - - ">="
81
93
  - !ruby/object:Gem::Version
82
94
  version: 2.0.4
83
95
  description: |
@@ -209,7 +221,7 @@ files:
209
221
  - lib/jogl-all-natives-linux-amd64.jar
210
222
  - lib/jogl-all-natives-linux-armv6hf.jar
211
223
  - lib/jogl-all.jar
212
- - lib/picrate-1.3.0.jar
224
+ - lib/picrate-2.0.0.pre.jar
213
225
  - lib/picrate.rb
214
226
  - lib/picrate/app.rb
215
227
  - lib/picrate/creators/parameters.rb
@@ -384,13 +396,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
384
396
  version: '0'
385
397
  required_rubygems_version: !ruby/object:Gem::Requirement
386
398
  requirements:
387
- - - ">="
399
+ - - ">"
388
400
  - !ruby/object:Gem::Version
389
- version: '0'
401
+ version: 1.3.1
390
402
  requirements:
391
- - java runtime == 8
403
+ - java runtime == 11+
392
404
  rubygems_version: 3.0.6
393
- signing_key:
405
+ signing_key:
394
406
  specification_version: 4
395
407
  summary: ruby implementation of processing-3 on raspberrypi and linux64
396
408
  test_files: