propane 3.3.1-java → 3.6.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +1 -2
  3. data/.mvn/wrapper/MavenWrapperDownloader.java +117 -0
  4. data/.mvn/wrapper/maven-wrapper.properties +2 -3
  5. data/.travis.yml +9 -0
  6. data/CHANGELOG.md +17 -5
  7. data/Gemfile +2 -0
  8. data/README.md +17 -8
  9. data/Rakefile +16 -30
  10. data/bin/propane +3 -1
  11. data/lib/propane.rb +6 -4
  12. data/lib/propane/app.rb +20 -10
  13. data/lib/propane/creators/sketch_class.rb +7 -1
  14. data/lib/propane/creators/sketch_factory.rb +4 -2
  15. data/lib/propane/creators/sketch_writer.rb +1 -0
  16. data/lib/propane/helper_methods.rb +23 -24
  17. data/lib/propane/helpers/numeric.rb +2 -0
  18. data/lib/propane/helpers/version_error.rb +1 -0
  19. data/lib/propane/library.rb +5 -1
  20. data/lib/propane/library_loader.rb +2 -0
  21. data/lib/propane/native_folder.rb +21 -15
  22. data/lib/propane/native_loader.rb +3 -0
  23. data/lib/propane/runner.rb +14 -6
  24. data/lib/propane/version.rb +2 -1
  25. data/library/boids/boids.rb +21 -11
  26. data/library/color_group/color_group.rb +28 -0
  27. data/library/control_panel/control_panel.rb +8 -5
  28. data/library/dxf/dxf.rb +6 -0
  29. data/library/file_chooser/chooser.rb +10 -9
  30. data/library/file_chooser/file_chooser.rb +10 -9
  31. data/library/library_proxy/library_proxy.rb +2 -0
  32. data/library/net/net.rb +7 -0
  33. data/library/simplex_noise/simplex_noise.rb +2 -0
  34. data/library/slider/slider.rb +23 -22
  35. data/library/vector_utils/vector_utils.rb +4 -0
  36. data/library/video_event/video_event.rb +4 -1
  37. data/mvnw +127 -51
  38. data/mvnw.cmd +182 -145
  39. data/pom.rb +53 -50
  40. data/pom.xml +17 -8
  41. data/propane.gemspec +13 -11
  42. data/src/main/java/monkstone/ColorUtil.java +13 -1
  43. data/src/main/java/monkstone/MathToolModule.java +253 -203
  44. data/src/main/java/monkstone/PropaneLibrary.java +2 -2
  45. data/src/main/java/monkstone/fastmath/Deglut.java +1 -1
  46. data/src/main/java/monkstone/filechooser/Chooser.java +2 -1
  47. data/src/main/java/monkstone/noise/SimplexNoise.java +2 -2
  48. data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +1 -1
  49. data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
  50. data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +1 -1
  51. data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +1 -1
  52. data/src/main/java/monkstone/slider/SliderBar.java +1 -1
  53. data/src/main/java/monkstone/slider/SliderGroup.java +1 -1
  54. data/src/main/java/monkstone/slider/WheelHandler.java +7 -6
  55. data/src/main/java/monkstone/vecmath/package-info.java +1 -1
  56. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +2 -2
  57. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
  58. data/src/main/java/monkstone/videoevent/CaptureEvent.java +27 -0
  59. data/src/main/java/monkstone/videoevent/{VideoInterface.java → MovieEvent.java} +11 -27
  60. data/src/main/java/monkstone/videoevent/package-info.java +1 -1
  61. data/src/main/java/processing/awt/PGraphicsJava2D.java +2164 -1661
  62. data/src/main/java/processing/awt/PImageAWT.java +377 -0
  63. data/src/main/java/processing/awt/PShapeJava2D.java +280 -268
  64. data/src/main/java/processing/awt/PSurfaceAWT.java +942 -829
  65. data/src/main/java/processing/awt/ShimAWT.java +581 -0
  66. data/src/main/java/processing/core/PApplet.java +831 -824
  67. data/src/main/java/processing/core/PConstants.java +477 -447
  68. data/src/main/java/processing/core/PFont.java +914 -880
  69. data/src/main/java/processing/core/PGraphics.java +229 -213
  70. data/src/main/java/processing/core/PImage.java +620 -318
  71. data/src/main/java/processing/core/PMatrix.java +172 -159
  72. data/src/main/java/processing/core/PMatrix2D.java +478 -409
  73. data/src/main/java/processing/core/PMatrix3D.java +762 -735
  74. data/src/main/java/processing/core/PShape.java +2888 -2652
  75. data/src/main/java/processing/core/PShapeOBJ.java +436 -415
  76. data/src/main/java/processing/core/PShapeSVG.java +1702 -1479
  77. data/src/main/java/processing/core/PStyle.java +40 -37
  78. data/src/main/java/processing/core/PSurface.java +139 -97
  79. data/src/main/java/processing/core/PSurfaceNone.java +296 -208
  80. data/src/main/java/processing/core/PVector.java +997 -965
  81. data/src/main/java/processing/core/ThinkDifferent.java +12 -17
  82. data/src/main/java/processing/data/DoubleDict.java +756 -710
  83. data/src/main/java/processing/data/DoubleList.java +749 -696
  84. data/src/main/java/processing/data/FloatDict.java +748 -702
  85. data/src/main/java/processing/data/FloatList.java +751 -697
  86. data/src/main/java/processing/data/IntDict.java +720 -673
  87. data/src/main/java/processing/data/IntList.java +699 -633
  88. data/src/main/java/processing/data/JSONArray.java +931 -873
  89. data/src/main/java/processing/data/JSONObject.java +1262 -1165
  90. data/src/main/java/processing/data/JSONTokener.java +351 -341
  91. data/src/main/java/processing/data/LongDict.java +710 -663
  92. data/src/main/java/processing/data/LongList.java +701 -635
  93. data/src/main/java/processing/data/Sort.java +37 -41
  94. data/src/main/java/processing/data/StringDict.java +525 -486
  95. data/src/main/java/processing/data/StringList.java +626 -580
  96. data/src/main/java/processing/data/Table.java +3690 -3510
  97. data/src/main/java/processing/data/TableRow.java +182 -183
  98. data/src/main/java/processing/data/XML.java +957 -883
  99. data/src/main/java/processing/dxf/RawDXF.java +404 -0
  100. data/src/main/java/processing/event/Event.java +87 -66
  101. data/src/main/java/processing/event/KeyEvent.java +48 -41
  102. data/src/main/java/processing/event/MouseEvent.java +88 -113
  103. data/src/main/java/processing/event/TouchEvent.java +10 -6
  104. data/src/main/java/processing/javafx/PGraphicsFX2D.java +20 -345
  105. data/src/main/java/processing/javafx/PSurfaceFX.java +149 -121
  106. data/src/main/java/processing/net/Client.java +744 -0
  107. data/src/main/java/processing/net/Server.java +388 -0
  108. data/src/main/java/processing/opengl/FontTexture.java +289 -270
  109. data/src/main/java/processing/opengl/FrameBuffer.java +386 -364
  110. data/src/main/java/processing/opengl/LinePath.java +547 -500
  111. data/src/main/java/processing/opengl/LineStroker.java +588 -581
  112. data/src/main/java/processing/opengl/PGL.java +3047 -2914
  113. data/src/main/java/processing/opengl/PGraphics2D.java +408 -315
  114. data/src/main/java/processing/opengl/PGraphics3D.java +107 -72
  115. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12378 -12075
  116. data/src/main/java/processing/opengl/PJOGL.java +1753 -1670
  117. data/src/main/java/processing/opengl/PShader.java +1266 -1257
  118. data/src/main/java/processing/opengl/PShapeOpenGL.java +4678 -4580
  119. data/src/main/java/processing/opengl/PSurfaceJOGL.java +1114 -1027
  120. data/src/main/java/processing/opengl/Texture.java +1492 -1401
  121. data/src/main/java/processing/opengl/VertexBuffer.java +57 -55
  122. data/test/create_test.rb +21 -20
  123. data/test/deglut_spec_test.rb +4 -2
  124. data/test/helper_methods_test.rb +49 -20
  125. data/test/math_tool_test.rb +39 -32
  126. data/test/native_folder.rb +47 -0
  127. data/test/respond_to_test.rb +3 -2
  128. data/test/sketches/key_event.rb +2 -2
  129. data/test/sketches/library/my_library/my_library.rb +3 -0
  130. data/test/test_helper.rb +2 -0
  131. data/test/vecmath_spec_test.rb +35 -22
  132. data/vendors/Rakefile +33 -62
  133. metadata +54 -45
  134. data/src/main/java/processing/core/util/image/ImageLoadFacade.java +0 -161
  135. data/src/main/java/processing/core/util/image/ImageSaveFacade.java +0 -169
  136. data/src/main/java/processing/core/util/image/constants/TifConstants.java +0 -45
  137. data/src/main/java/processing/core/util/image/load/AwtImageLoadStrategy.java +0 -80
  138. data/src/main/java/processing/core/util/image/load/Base64StringImageLoadStrategy.java +0 -73
  139. data/src/main/java/processing/core/util/image/load/FallbackImageLoadStrategy.java +0 -70
  140. data/src/main/java/processing/core/util/image/load/ImageIoImageLoadStrategy.java +0 -132
  141. data/src/main/java/processing/core/util/image/load/ImageLoadStrategy.java +0 -48
  142. data/src/main/java/processing/core/util/image/load/ImageLoadUtil.java +0 -45
  143. data/src/main/java/processing/core/util/image/load/TgaImageLoadStrategy.java +0 -255
  144. data/src/main/java/processing/core/util/image/load/TiffImageLoadStrategy.java +0 -98
  145. data/src/main/java/processing/core/util/image/save/ImageSaveStrategy.java +0 -49
  146. data/src/main/java/processing/core/util/image/save/ImageSaveUtil.java +0 -48
  147. data/src/main/java/processing/core/util/image/save/ImageWriterImageSaveStrategy.java +0 -179
  148. data/src/main/java/processing/core/util/image/save/SaveImageException.java +0 -41
  149. data/src/main/java/processing/core/util/image/save/TgaImageSaveStrategy.java +0 -198
  150. data/src/main/java/processing/core/util/image/save/TiffImageSaveStrategy.java +0 -91
  151. data/src/main/java/processing/core/util/image/save/TiffNakedFilenameImageSaveStrategy.java +0 -57
  152. data/src/main/java/processing/core/util/io/InputFactory.java +0 -285
  153. data/src/main/java/processing/core/util/io/PathUtil.java +0 -109
  154. data/src/main/java/processing/opengl/shaders/LightVert-brcm.glsl +0 -154
  155. data/src/main/java/processing/opengl/shaders/LightVert-vc4.glsl +0 -154
  156. data/src/main/java/processing/opengl/shaders/TexLightVert-brcm.glsl +0 -160
  157. data/src/main/java/processing/opengl/shaders/TexLightVert-vc4.glsl +0 -160
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a45edb342ed732fe93fc0e6866df3e64378b7b5e5cbfa86870f289d53ac7306c
4
- data.tar.gz: 18b06c7111468e2b157a7b92158e5f18ba1122cea435b14da9a756199dc09caf
3
+ metadata.gz: f8e0f1b907888514e27260110225621d9fa5f7792d319ddae436540bd98be75a
4
+ data.tar.gz: f26c694203a50b98df365b2b003d2c258c11c87e550618a146158a69dfa7954e
5
5
  SHA512:
6
- metadata.gz: d8cb5318d84264ae49a575d6af4a2e477f082ee55c61381012fb87c632c5052ef9b896f520748f3a7b4b83944d60e2fbea823b8d788b95b4c09db8973cb0a0fa
7
- data.tar.gz: 691b2c1b03a5989c1db763487df32cb83b6073da18d0c986838f5eecae9008d0cccb86c37d999e9879d1a13b0c6cb7f64103fbdb20ccf84a6a60f495a14eac47
6
+ metadata.gz: 1263af382d8cec20f5d16d760d0afe542802955ee42bb398e4ca28e8e5583ca04a04fd619529567b5df78cadd3f824c17de8d860a8ba1c3f003b2453a87fa16a
7
+ data.tar.gz: 90b9e87ca02ee5dde1bfd71dc51efc91574ee2855fddfea113793d2e3d8434b07f090d2170c0a4df798fd6b200846cb9645415c09158d684f3a757ef8ee0682f
@@ -3,7 +3,6 @@
3
3
  <extension>
4
4
  <groupId>io.takari.polyglot</groupId>
5
5
  <artifactId>polyglot-ruby</artifactId>
6
- <version>0.4.0</version>
6
+ <version>0.4.5</version>
7
7
  </extension>
8
8
  </extensions>
9
-
@@ -0,0 +1,117 @@
1
+ /*
2
+ * Copyright 2007-present the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import java.net.*;
17
+ import java.io.*;
18
+ import java.nio.channels.*;
19
+ import java.util.Properties;
20
+
21
+ public class MavenWrapperDownloader {
22
+
23
+ private static final String WRAPPER_VERSION = "0.5.6";
24
+ /**
25
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
26
+ */
27
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
28
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
29
+
30
+ /**
31
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
32
+ * use instead of the default one.
33
+ */
34
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
35
+ ".mvn/wrapper/maven-wrapper.properties";
36
+
37
+ /**
38
+ * Path where the maven-wrapper.jar will be saved to.
39
+ */
40
+ private static final String MAVEN_WRAPPER_JAR_PATH =
41
+ ".mvn/wrapper/maven-wrapper.jar";
42
+
43
+ /**
44
+ * Name of the property which should be used to override the default download url for the wrapper.
45
+ */
46
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
47
+
48
+ public static void main(String args[]) {
49
+ System.out.println("- Downloader started");
50
+ File baseDirectory = new File(args[0]);
51
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
52
+
53
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
54
+ // wrapperUrl parameter.
55
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
56
+ String url = DEFAULT_DOWNLOAD_URL;
57
+ if(mavenWrapperPropertyFile.exists()) {
58
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
59
+ try {
60
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
61
+ Properties mavenWrapperProperties = new Properties();
62
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
63
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
64
+ } catch (IOException e) {
65
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
66
+ } finally {
67
+ try {
68
+ if(mavenWrapperPropertyFileInputStream != null) {
69
+ mavenWrapperPropertyFileInputStream.close();
70
+ }
71
+ } catch (IOException e) {
72
+ // Ignore ...
73
+ }
74
+ }
75
+ }
76
+ System.out.println("- Downloading from: " + url);
77
+
78
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
79
+ if(!outputFile.getParentFile().exists()) {
80
+ if(!outputFile.getParentFile().mkdirs()) {
81
+ System.out.println(
82
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
83
+ }
84
+ }
85
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
86
+ try {
87
+ downloadFileFromURL(url, outputFile);
88
+ System.out.println("Done");
89
+ System.exit(0);
90
+ } catch (Throwable e) {
91
+ System.out.println("- Error downloading");
92
+
93
+ System.exit(1);
94
+ }
95
+ }
96
+
97
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
98
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
99
+ String username = System.getenv("MVNW_USERNAME");
100
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
101
+ Authenticator.setDefault(new Authenticator() {
102
+ @Override
103
+ protected PasswordAuthentication getPasswordAuthentication() {
104
+ return new PasswordAuthentication(username, password);
105
+ }
106
+ });
107
+ }
108
+ URL website = new URL(urlString);
109
+ ReadableByteChannel rbc;
110
+ rbc = Channels.newChannel(website.openStream());
111
+ FileOutputStream fos = new FileOutputStream(destination);
112
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
113
+ fos.close();
114
+ rbc.close();
115
+ }
116
+
117
+ }
@@ -1,3 +1,2 @@
1
-
2
- distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip
3
-
1
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2
+ wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
@@ -0,0 +1,9 @@
1
+ language: java
2
+ dist: bionic
3
+
4
+ rvm:
5
+ - jruby-9.2.12.0
6
+ jdk:
7
+ - openjdk11
8
+ os:
9
+ - linux
@@ -1,8 +1,20 @@
1
+ **v3.6.0** Recommend JRuby-9.2.14.0 use video-2.0 release
2
+
3
+ **v3.5.0** Rebase processing core code around Sam Pottingers latest fixes for JOGL an image save, does mean breaking some of Diwis and Joshua Davis examples, but one hopes codeanticode knows what he's doing.
4
+
5
+ **v3.4.3** Use Map.of to initialize HashMap bump processing version in build bump to jruby-9.2.11.0
6
+
7
+ **v3.4.2** Fix native library bug on windows (thanks to Jay Scott). Add minim library examples
8
+
9
+ **v3.4.1** Update to jruby-9.2.9.0
10
+
11
+ **v3.4.0** Experimental refactoring of ThinkDifferent, and some other processing classes
12
+
1
13
  **v3.3.1** Reflection makes refactoring a nightmare DesktopHandler => ThinkDifferent
2
14
 
3
- **v3.3.0** Compile with jdk12. Changed AppRender to GfxRender (PGraphics instead of PApplet). Attempt fix for macOS icons
15
+ **v3.3.0** Compile with jdk12\. Changed AppRender to GfxRender (PGraphics instead of PApplet). Attempt fix for macOS icons
4
16
 
5
- **v3.2.0** Now is the time for some serious refactoring for jdk11. Might even work on MacOS and Windows, ahead of vanilla processing.
17
+ **v3.2.0** Now is the time for some serious refactoring for jdk11\. Might even work on MacOS and Windows, ahead of vanilla processing.
6
18
 
7
19
  **v2.9.1** Attempt to bring 64 bit Windows users to party. Use non versioned jogl/opengl jars from processing distro, including processing.org apple.jar in case it's needed, MacOS users are being very opaque on this.
8
20
 
@@ -26,7 +38,7 @@
26
38
 
27
39
  **v2.6.1** Bump processing version, bump recommended jruby version.
28
40
 
29
- **v2.6.0** Refactored `LibraryLoader` knows less about `Library` class. The library class _knows_ about paths, and checks that they exist. Currently has ability to load `GLVideo` library, that will eventually become the new video libary (supports gstreamer-1.0 instead of gstreamer-0.1.0 that has already been dropped by some linux distros).
41
+ **v2.6.0** Refactored `LibraryLoader` knows less about `Library` class. The library class _knows_ about paths, and checks that they exist. Currently has ability to load `GLVideo` library, that will eventually become the new video libary (supports gstreamer-1.0 instead of gstreamer-0.1.0 that has already been dropped by some linux distros).
30
42
 
31
43
  **v2.5.5** Intermediate `refactored_library` loader, can be release if required but still not there as regards refactor goals.
32
44
 
@@ -64,13 +76,13 @@
64
76
 
65
77
  **v2.0.0** Refactored to work with processing-3.0, `--install samples` and/or vanilla processing `sound` and `video` libraries
66
78
 
67
- **v0.9.0** Implements `data_path` in ruby, you should use this method to return the absolute path to the `data` folder (read and write). Prefer JRubyArt methods, in the main.
79
+ **v0.9.0** Implements `data_path` in ruby, you should use this method to return the absolute path to the `data` folder (read and write). Prefer JRubyArt methods, in the main.
68
80
 
69
81
  **v0.8.0** Complete samples refactored to `data_path` folder, no longer require jruby-complete to run because we provide an absolute path to `data` folder, but it still probably requires that you run the sketch from the directory. Future direction might be to create a `~/.propane` folder, which would support additionalvanilla processing libraries, also integration with `atom` editor.
70
82
 
71
83
  **v0.7.0** Update to JRuby-Complete-9.1.2.0.
72
84
 
73
- **v0.6.0** Includes a sketch creator utility 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy), includes slider in sketch library, change to requiring jdk8. Update to JRuby-Complete-9.1.0.0, request updated arcball (to run samples).
85
+ **v0.6.0** Includes a sketch creator utility 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy), includes slider in sketch library, change to requiring jdk8\. Update to JRuby-Complete-9.1.0.0, request updated arcball (to run samples).
74
86
 
75
87
  **v0.5.0** Includes a sketch creator utility 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy).
76
88
 
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Propane
1
+ # Propane [![Gem Version](https://badge.fury.io/rb/propane.svg)](https://badge.fury.io/rb/propane) ![Travis CI](https://travis-ci.org/ruby-processing/propane.svg)
2
2
 
3
- This version is intended to work with openjdk11+, @sampottinger is currently working on [vanilla processing][vanilla] which will enable JRubyArt to catch up. Unfortunately there is a cockup in debian distributions, and it is currently safer to use the Oracle version on debian (Archlinux openjdk version is fine).
3
+ This version is intended to work with openjdk11+, @sampottinger is currently working on [vanilla processing][vanilla] which will enable JRubyArt to catch up.
4
4
 
5
5
  A slim layer to communicate with Processing from JRuby, features maven build. We have created a configuration free version of ruby processing, for processing-4.0+, where we include a modified processing core (`public runPropane()` to replace `protected runSketch()`. These jars are small enough to include in a gem distribution, and hence we do not require configuration. This has created a scriptable version, ie files get run direct from jruby. Currently JavaFX is unsupported again @sampottinger is currently working on [vanilla processing][vanilla] to use OpenJFX. It would be nice make use of java modules, but I think we should let jruby project do that first (unless processing.org beat them to it).
6
6
 
@@ -8,9 +8,12 @@ adjust above for your OS/distro setup.
8
8
 
9
9
  ## Requirements
10
10
 
11
- - `jdk-11.0.2+`
12
- - `jruby-9.2.7.0`
13
- - `mvn-3.5.4+`
11
+ There may be a linker issue with P2D or P3D sketches with stock openjdk with some linux distros, in which case you might find [Adopt open jdk binaries][adopt] will work for you.
12
+
13
+ - `jdk-11.0.3+`
14
+ - `jruby-9.2.12.0`
15
+
16
+ Currently you can ignore `illegal reflective access` warnings, see [here how to suppress them][warning].
14
17
 
15
18
  ## Building and testing
16
19
 
@@ -24,10 +27,10 @@ rake javadoc
24
27
 
25
28
  ```bash
26
29
  jgem install propane # from rubygems
27
- jgem install propane-3.3.0-java.gem # local install
30
+ jgem install propane-3.6.0-java.gem # local install
28
31
  # Alternative
29
32
  jruby -S gem install propane # from rubygems
30
- jruby -S gem install propane-3.3.0-java.gem # local install
33
+ jruby -S gem install propane-3.6.0-java.gem # local install
31
34
  ```
32
35
 
33
36
  ## Check Install
@@ -37,6 +40,10 @@ To check version and confirm gem bin files are on your path (also checks JDK ver
37
40
  propane --version
38
41
  ```
39
42
 
43
+ ## Suppressing Reflective Access warnings
44
+
45
+ Since propane-3.5.0 it is possible to suppress reflective access warnings by setting JAVA_HOME environmental variable jruby does the rest.
46
+
40
47
  ## Usage
41
48
 
42
49
  A propane sketch:-
@@ -88,13 +95,15 @@ See [gh-pages][gh-pages] for more detailed instructions and much more.
88
95
 
89
96
  ## Examples
90
97
 
91
- [Worked Examples](https://github.com/ruby-processing/propane-examples) more to follow, feel free to add your own, especially ruby-2.4
98
+ [Worked Examples](https://github.com/ruby-processing/propane-examples) more to follow, feel free to add your own, especially ruby-2.5
92
99
  + syntax now we can. To install the samples. The samples get copied to `~/propane_samples`. Depends on wget.
93
100
  ```bash
94
101
  propane --install samples
95
102
  ```
96
103
  please move existing `propane_samples` if you wish to keep them. The current release features several PixelFlow glsl library examples, including a few shadertoy demos as sketches.
97
104
 
105
+ [adopt]: https://adoptopenjdk.net/
98
106
  [building]:http://ruby-processing.github.io/building/building/
99
107
  [gh-pages]:https://ruby-processing.github.io/propane/
100
108
  [vanilla]:https://github.com/processing/processing/pull/5753
109
+ [warning]: https://monkstone.github.io/jruby_art/update/2019/09/10/Reflective_Access.html
data/Rakefile CHANGED
@@ -1,31 +1,17 @@
1
1
  # frozen_string_literal: false
2
- require_relative 'lib/propane/version'
3
- require 'erb'
4
2
 
5
- desc 'Create jar Manifest'
6
- task :create_manifest do
7
- manifest = ERB.new <<~MANIFEST
8
- Implementation-Title: rpextras (java extension for propane)
9
- Implementation-Version: <%= Propane::VERSION %>
10
- Class-Path: gluegen-rt.jar jog-all.jar
11
- MANIFEST
12
- File.open('MANIFEST.MF', 'w') do |f|
13
- f.puts(manifest.result(binding))
14
- end
15
- end
3
+ require_relative 'lib/propane/version'
16
4
 
17
- task default: [:init, :compile, :install, :test, :gem]
5
+ task default: %i[init compile install test gem]
18
6
 
19
- # depends on installed processing, with processing on path
20
- desc 'Create Manifest and Copy Jars'
21
- task init: :create_manifest do
22
- processing_root = File.dirname(`readlink -f $(which processing)`) # for Archlinux etc
23
- # processing_root = File.join(ENV['HOME'], 'processing-3.5.3') # alternative for debian linux etc
24
- jar_dir = File.join(processing_root, 'core', 'library')
25
- opengl = Dir.entries(jar_dir).grep(/amd64|macosx-universal/)
7
+ # Currently depends on local jogl-2.4.0 jars on path ~/jogl24
8
+ desc 'Copy Jars'
9
+ task :init do
10
+ jogl24 = File.join(ENV['HOME'], 'jogl24')
11
+ opengl = Dir.entries(jogl24).grep(/amd64|universal/).select { |jar| jar =~ /linux|windows|macosx/ }
26
12
  opengl.concat %w[jogl-all.jar gluegen-rt.jar]
27
13
  opengl.each do |gl|
28
- FileUtils.cp(File.join(jar_dir, gl), File.join('.', 'lib'))
14
+ FileUtils.cp(File.join(jogl24, gl), File.join('.', 'lib'))
29
15
  end
30
16
  end
31
17
 
@@ -36,17 +22,17 @@ end
36
22
 
37
23
  desc 'Gem'
38
24
  task :gem do
39
- sh 'gem build propane.gemspec'
25
+ sh 'jgem build propane.gemspec'
40
26
  end
41
27
 
42
28
  desc 'Document'
43
29
  task :javadoc do
44
- sh 'mvn javadoc:javadoc'
30
+ sh './mvnw javadoc:javadoc'
45
31
  end
46
32
 
47
33
  desc 'Compile'
48
34
  task :compile do
49
- sh 'mvn package'
35
+ sh './mvnw package'
50
36
  end
51
37
 
52
38
  desc 'JRuby-Complete'
@@ -58,15 +44,15 @@ desc 'Test'
58
44
  task :test do
59
45
  sh 'jruby test/helper_methods_test.rb'
60
46
  # sh 'jruby test/respond_to_test.rb' Skip test on Travis to avoid Headless fail
61
- sh 'jruby test/create_test.rb'
62
- sh 'jruby test/math_tool_test.rb'
63
- sh 'jruby test/deglut_spec_test.rb'
64
- sh 'jruby test/vecmath_spec_test.rb'
47
+ sh 'jruby --dev test/create_test.rb'
48
+ sh 'jruby --dev test/math_tool_test.rb'
49
+ sh 'jruby --dev test/deglut_spec_test.rb'
50
+ sh 'jruby --dev test/vecmath_spec_test.rb'
65
51
  end
66
52
 
67
53
  desc 'clean'
68
54
  task :clean do
69
- Dir["./**/*.{jar,gem}"].each do |path|
55
+ Dir['./**/*.{jar,gem}'].each do |path|
70
56
  puts "Deleting #{path} ..."
71
57
  File.delete(path)
72
58
  end
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env jruby
2
+ # frozen_string_literal: true
3
+
2
4
  unless defined? PROPANE_ROOT
3
- $LOAD_PATH << File.expand_path(File.dirname(__FILE__))
5
+ $LOAD_PATH << __dir__
4
6
  PROPANE_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
5
7
  end
6
8
 
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'java'
3
4
  unless defined? PROPANE_ROOT
4
- $LOAD_PATH << File.expand_path(File.dirname(__FILE__))
5
- PROPANE_ROOT = File.absolute_path(File.dirname(__dir__))
5
+ $LOAD_PATH << File.dirname(__dir__)
6
+ PROPANE_ROOT = File.dirname(__dir__)
6
7
  end
7
- Dir["#{PROPANE_ROOT}/lib/*.jar"].each do |jar|
8
+ Dir["#{PROPANE_ROOT}/lib/*.jar"].sort.each do |jar|
8
9
  require jar
9
10
  end
10
- require_relative 'propane/app'
11
+ require "#{PROPANE_ROOT}/lib/propane/app"
12
+ require "#{PROPANE_ROOT}/lib/propane/helpers/numeric"
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: false
2
+
3
+ require 'jruby'
2
4
  require_relative 'helper_methods'
3
5
  require_relative 'library_loader'
4
6
 
@@ -8,7 +10,7 @@ module Propane
8
10
  # Load vecmath, fastmath and mathtool modules
9
11
  Java::Monkstone::PropaneLibrary.load(JRuby.runtime)
10
12
  SKETCH_ROOT = File.absolute_path('.')
11
-
13
+ # import custom Vecmath renderers
12
14
  module Render
13
15
  java_import 'monkstone.vecmath.GfxRender'
14
16
  java_import 'monkstone.vecmath.ShapeRender'
@@ -49,13 +51,15 @@ module Propane
49
51
 
50
52
  # All sketches extend this class
51
53
  class App < PApplet
52
- include Math, MathTool, HelperMethods, Render
54
+ include HelperMethods
55
+ include Math
56
+ include MathTool
57
+ include Render
53
58
  # Alias some methods for familiarity for Shoes coders.
54
59
  alias oval ellipse
55
60
  alias stroke_width stroke_weight
56
61
  alias rgb color
57
62
  alias gray color
58
- field_reader :surface
59
63
 
60
64
  def sketch_class
61
65
  self.class.sketch_class
@@ -75,8 +79,8 @@ module Propane
75
79
  #
76
80
  class << self
77
81
  # Handy getters and setters on the class go here:
78
- attr_accessor :sketch_class, :library_loader, :title, :arguments, :options
79
-
82
+ attr_accessor :sketch_class, :library_loader, :arguments, :options
83
+ attr_reader :surface
80
84
  def load_libraries(*args)
81
85
  library_loader ||= LibraryLoader.new
82
86
  library_loader.load_library(*args)
@@ -99,6 +103,7 @@ module Propane
99
103
  # Processing call them by their expected Java names.
100
104
  def method_added(method_name) #:nodoc:
101
105
  return unless METHODS_TO_ALIAS.key?(method_name)
106
+
102
107
  alias_method METHODS_TO_ALIAS[method_name], method_name
103
108
  end
104
109
  end
@@ -112,12 +117,14 @@ module Propane
112
117
  proxy_java_fields
113
118
  raise TypeError unless options.is_a? Hash
114
119
  raise TypeError unless arguments.is_a? Array
120
+
115
121
  # Set up the sketch.
116
122
  super()
117
123
  post_initialize(options)
118
124
  Propane.app = self
119
125
  @arguments = arguments
120
126
  @options = options
127
+ @surface = get_surface
121
128
  run_propane
122
129
  end
123
130
 
@@ -126,12 +133,11 @@ module Propane
126
133
  @width ||= w
127
134
  @height ||= h
128
135
  @render_mode ||= mode
129
- import_opengl if /opengl/ =~ mode
136
+ import_opengl if /opengl/.match?(mode)
130
137
  super(*args)
131
138
  end
132
139
 
133
- def post_initialize(_args)
134
- end
140
+ def post_initialize(_args); end
135
141
 
136
142
  def sketch_title(title)
137
143
  surface.set_title(title)
@@ -164,6 +170,7 @@ module Propane
164
170
  # Processing call them by their expected Java names.
165
171
  def method_added(method_name) #:nodoc:
166
172
  return unless METHODS_TO_ALIAS.key?(method_name)
173
+
167
174
  alias_method METHODS_TO_ALIAS[method_name], method_name
168
175
  end
169
176
  end
@@ -181,7 +188,10 @@ module Propane
181
188
 
182
189
  def method_missing(name, *args, &block)
183
190
  return Propane.app.send(name, *args) if Propane.app.respond_to? name
191
+
184
192
  super
185
193
  end
186
- end # Processing::Proxy
187
- end # Propane
194
+ end
195
+ # end Processing::Proxy
196
+ end
197
+ # end Propane