propane 3.2.0-java → 3.3.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +9 -0
  3. data/.mvn/wrapper/maven-wrapper.properties +3 -1
  4. data/CHANGELOG.md +3 -1
  5. data/README.md +4 -4
  6. data/lib/propane/app.rb +1 -1
  7. data/lib/propane/version.rb +1 -1
  8. data/pom.rb +79 -0
  9. data/pom.xml +32 -43
  10. data/propane.gemspec +2 -2
  11. data/src/main/java/japplemenubar/JAppleMenuBar.java +47 -41
  12. data/src/main/java/monkstone/vecmath/{AppRender.java → GfxRender.java} +12 -12
  13. data/src/main/java/processing/awt/PSurfaceAWT.java +3 -3
  14. data/src/main/java/processing/core/PApplet.java +14004 -14573
  15. data/src/main/java/processing/core/PGraphics.java +7563 -7213
  16. data/src/main/java/processing/core/PImage.java +2783 -3080
  17. data/src/main/java/processing/core/ThinkDifferent.java +120 -0
  18. data/src/main/java/processing/core/util/image/ImageLoadFacade.java +161 -0
  19. data/src/main/java/processing/core/util/image/ImageSaveFacade.java +169 -0
  20. data/src/main/java/processing/core/util/image/constants/TifConstants.java +45 -0
  21. data/src/main/java/processing/core/util/image/load/AwtImageLoadStrategy.java +80 -0
  22. data/src/main/java/processing/core/util/image/load/Base64StringImageLoadStrategy.java +73 -0
  23. data/src/main/java/processing/core/util/image/load/FallbackImageLoadStrategy.java +70 -0
  24. data/src/main/java/processing/core/util/image/load/ImageIoImageLoadStrategy.java +132 -0
  25. data/src/main/java/processing/core/util/image/load/ImageLoadStrategy.java +48 -0
  26. data/src/main/java/processing/core/util/image/load/ImageLoadUtil.java +45 -0
  27. data/src/main/java/processing/core/util/image/load/TgaImageLoadStrategy.java +255 -0
  28. data/src/main/java/processing/core/util/image/load/TiffImageLoadStrategy.java +98 -0
  29. data/src/main/java/processing/core/util/image/save/ImageSaveStrategy.java +49 -0
  30. data/src/main/java/processing/core/util/image/save/ImageSaveUtil.java +48 -0
  31. data/src/main/java/processing/core/util/image/save/ImageWriterImageSaveStrategy.java +179 -0
  32. data/src/main/java/processing/core/util/image/save/SaveImageException.java +41 -0
  33. data/src/main/java/processing/core/util/image/save/TgaImageSaveStrategy.java +198 -0
  34. data/src/main/java/processing/core/util/image/save/TiffImageSaveStrategy.java +91 -0
  35. data/src/main/java/processing/core/util/image/save/TiffNakedFilenameImageSaveStrategy.java +57 -0
  36. data/src/main/java/processing/core/util/io/InputFactory.java +285 -0
  37. data/src/main/java/processing/core/util/io/PathUtil.java +109 -0
  38. data/vendors/Rakefile +1 -1
  39. metadata +30 -7
  40. data/src/main/java/processing/core/DesktopHandler.java +0 -94
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27e0f6d8547d0ab680c183052c93de07386e196ef645111564ad033172ccccbe
4
- data.tar.gz: cc8cf473457ddfbe7e423e202276d209d629942b2d04bedfd07c577ca1fefb43
3
+ metadata.gz: 580882cb5f9d0a497b538b8537ae10d51d17b922ba81c01f1912fd6f161d23ab
4
+ data.tar.gz: 47b5945a4e46a9287c7856d6726f79668154bf502eadecba8045beacc831ed63
5
5
  SHA512:
6
- metadata.gz: 501f170bf9899573c5085c292a0fe8796df82588dd74b2b07b80c8dda96498a7cbd26352fce2a8623a69b1ff0d4703bb265dcf55b81292efdbe3c52322100fc1
7
- data.tar.gz: 4b8a78d2f4b924111b16a8269d922107f84f186465e5568972237944886bfcb2c23fa5178e5c2b8046aa559b74ea167932795c25a97849322ec9c991ab274a24
6
+ metadata.gz: d2cf96f90b7377e091c01d9b188a63d618001408675c2f945d72ee00da8cccbe057d372255010ef04a4adaffe54ae6afdad5d70713d00469b223edf8cb172067
7
+ data.tar.gz: 3e2d188cd042052892f0c5b1f33229b4faf28214c3ad3d739af052f6961e9430b050d59076f3965d6521ccb740d227c3b0f65f8c8fa1f42c8b00076b83153074
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <extensions>
3
+ <extension>
4
+ <groupId>io.takari.polyglot</groupId>
5
+ <artifactId>polyglot-ruby</artifactId>
6
+ <version>0.4.0</version>
7
+ </extension>
8
+ </extensions>
9
+
@@ -1 +1,3 @@
1
- distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
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,4 +1,6 @@
1
- **v3.2** Now is the time for some serious refactoring for jdk11. Might even work on MacOS and Windows, ahead of vanilla processing.
1
+ **v3.3.0** Compile with jdk12. Changed AppRender to GfxRender (PGraphics instead of PApplet). Attempt fix for macOS icons
2
+
3
+ **v3.2.0** Now is the time for some serious refactoring for jdk11. Might even work on MacOS and Windows, ahead of vanilla processing.
2
4
 
3
5
  **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.
4
6
 
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Propane
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.
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).
4
4
 
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-3.5+, 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.
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
 
7
7
  adjust above for your OS/distro setup.
8
8
 
@@ -24,10 +24,10 @@ rake javadoc
24
24
 
25
25
  ```bash
26
26
  jgem install propane # from rubygems
27
- jgem install propane-3.2.0-java.gem # local install
27
+ jgem install propane-3.3.0-java.gem # local install
28
28
  # Alternative
29
29
  jruby -S gem install propane # from rubygems
30
- jruby -S gem install propane-3.2.0-java.gem # local install
30
+ jruby -S gem install propane-3.3.0-java.gem # local install
31
31
  ```
32
32
 
33
33
  ## Check Install
@@ -10,7 +10,7 @@ module Propane
10
10
  SKETCH_ROOT = File.absolute_path('.')
11
11
 
12
12
  module Render
13
- java_import 'monkstone.vecmath.AppRender'
13
+ java_import 'monkstone.vecmath.GfxRender'
14
14
  java_import 'monkstone.vecmath.ShapeRender'
15
15
  end
16
16
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Propane
3
- VERSION = '3.2.0'.freeze
3
+ VERSION = '3.3.0'.freeze
4
4
  end
data/pom.rb ADDED
@@ -0,0 +1,79 @@
1
+ project 'propane', 'https://github.com/monkstone/propane' do
2
+
3
+ model_version '4.0.0'
4
+ id 'propane:propane:3.3.0'
5
+ packaging 'jar'
6
+
7
+ description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
8
+
9
+ developer 'monkstone' do
10
+ name 'Martin Prout'
11
+ roles 'developer'
12
+ end
13
+
14
+ developer 'benfry' do
15
+ name 'Ben Fry'
16
+ roles 'developer'
17
+ end
18
+
19
+ developer 'REAS' do
20
+ name 'Casey Reas'
21
+ roles 'developer'
22
+ end
23
+
24
+ developer 'codeanticode' do
25
+ name 'Andres Colubri'
26
+ roles 'developer'
27
+ end
28
+
29
+ issue_management 'https://github.com/ruby-processing/propane/issues', 'Github'
30
+
31
+ source_control( :url => 'https://github.com/ruby-processing/propane',
32
+ :connection => 'scm:git:git://github.com/ruby-processing/propane.git',
33
+ :developer_connection => 'scm:git:git@github.com/ruby-processing/propane.git' )
34
+
35
+ properties( 'propane.basedir' => '${project.basedir}',
36
+ 'processing.api' => 'http://processing.github.io/processing-javadocs/core/',
37
+ 'source.directory' => 'src',
38
+ 'polyglot.dump.pom' => 'pom.xml',
39
+ 'project.build.sourceEncoding' => 'utf-8',
40
+ 'jogl.version' => '2.3.2',
41
+ 'jruby.api' => 'http://jruby.org/apidocs/' )
42
+
43
+ pom 'org.jruby:jruby:9.2.7.0'
44
+ jar 'org.processing:video:3.2.3'
45
+ jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
46
+ jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
47
+
48
+ overrides do
49
+ plugin( 'org.codehaus.mojo:versions-maven-plugin:2.7',
50
+ 'generateBackupPoms' => 'false' )
51
+ plugin( :compiler, '3.8.0',
52
+ 'release' => '11' )
53
+ plugin( :javadoc, '3.0.1',
54
+ 'detectOfflineLinks' => 'false',
55
+ 'links' => [ '${jruby.api}',
56
+ '${processing.api}' ] )
57
+ plugin( :jar, '3.1.0',
58
+ 'archive' => {
59
+ 'manifestFile' => 'MANIFEST.MF'
60
+ } )
61
+ end
62
+
63
+
64
+ build do
65
+
66
+ resource do
67
+ directory '${source.directory}/main/java'
68
+ includes '**/**/*.glsl', '**/*.jnilib'
69
+ excludes '**/**/*.java'
70
+ end
71
+
72
+ resource do
73
+ directory '${source.directory}/main/resources'
74
+ includes '**/*.png', '*.txt'
75
+ excludes
76
+ end
77
+ end
78
+
79
+ end
data/pom.xml CHANGED
@@ -1,27 +1,20 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+
4
+
5
+ DO NOT MODIFIY - GENERATED CODE
6
+
7
+
8
+ -->
2
9
  <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
10
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
11
  <modelVersion>4.0.0</modelVersion>
5
12
  <groupId>propane</groupId>
6
13
  <artifactId>propane</artifactId>
7
- <version>3.2.0</version>
14
+ <version>3.3.0</version>
8
15
  <name>propane</name>
9
16
  <description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
10
17
  <url>https://github.com/monkstone/propane</url>
11
- <organization>
12
- <name>ruby-processing</name>
13
- <url>https://ruby-processing.github.io</url>
14
- </organization>
15
- <licenses>
16
- <license>
17
- <name>GPL 3</name>
18
- <url>http://www.gnu.org/licenses/gpl-3.0-standalone.html</url>
19
- </license>
20
- <license>
21
- <name>LGPL 2</name>
22
- <url>https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html</url>
23
- </license>
24
- </licenses>
25
18
  <developers>
26
19
  <developer>
27
20
  <id>monkstone</id>
@@ -64,9 +57,6 @@
64
57
  <properties>
65
58
  <jogl.version>2.3.2</jogl.version>
66
59
  <jruby.api>http://jruby.org/apidocs/</jruby.api>
67
- <!--<maven.compiler.release>8</maven.compiler.release>-->
68
- <maven.compiler.source>1.8</maven.compiler.source>
69
- <maven.compiler.target>1.8</maven.compiler.target>
70
60
  <polyglot.dump.pom>pom.xml</polyglot.dump.pom>
71
61
  <processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
72
62
  <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
@@ -77,7 +67,7 @@
77
67
  <dependency>
78
68
  <groupId>org.jruby</groupId>
79
69
  <artifactId>jruby</artifactId>
80
- <version>9.2.6.0</version>
70
+ <version>9.2.7.0</version>
81
71
  <type>pom</type>
82
72
  </dependency>
83
73
  <dependency>
@@ -127,7 +117,6 @@
127
117
  </configuration>
128
118
  </plugin>
129
119
  <plugin>
130
- <groupId>org.apache.maven.plugins</groupId>
131
120
  <artifactId>maven-compiler-plugin</artifactId>
132
121
  <version>3.8.0</version>
133
122
  <configuration>
@@ -135,26 +124,26 @@
135
124
  </configuration>
136
125
  </plugin>
137
126
  <plugin>
138
- <artifactId>maven-javadoc-plugin</artifactId>
139
- <version>3.0.1</version>
140
- <configuration>
141
- <detectOfflineLinks>false</detectOfflineLinks>
142
- <links>
143
- <link>${jruby.api}</link>
144
- <link>${processing.api}</link>
145
- </links>
146
- </configuration>
147
- </plugin>
148
- <plugin>
149
- <artifactId>maven-jar-plugin</artifactId>
150
- <version>3.1.0</version>
151
- <configuration>
152
- <archive>
153
- <manifestFile>MANIFEST.MF</manifestFile>
154
- </archive>
155
- </configuration>
156
- </plugin>
157
- </plugins>
158
- </pluginManagement>
159
- </build>
127
+ <artifactId>maven-javadoc-plugin</artifactId>
128
+ <version>3.0.1</version>
129
+ <configuration>
130
+ <detectOfflineLinks>false</detectOfflineLinks>
131
+ <links>
132
+ <link>${jruby.api}</link>
133
+ <link>${processing.api}</link>
134
+ </links>
135
+ </configuration>
136
+ </plugin>
137
+ <plugin>
138
+ <artifactId>maven-jar-plugin</artifactId>
139
+ <version>3.1.0</version>
140
+ <configuration>
141
+ <archive>
142
+ <manifestFile>MANIFEST.MF</manifestFile>
143
+ </archive>
144
+ </configuration>
145
+ </plugin>
146
+ </plugins>
147
+ </pluginManagement>
148
+ </build>
160
149
  </project>
@@ -12,10 +12,10 @@ Gem::Specification.new do |gem|
12
12
  gem.description = <<-EOS
13
13
  A batteries included version of processing in ruby targetting jdk11.
14
14
  EOS
15
- gem.summary = %q{ruby wrapper for processing-3.5 on MacOS, linux and windows (64bit only)}
15
+ gem.summary = %q{ruby implementation of processing-4.0 on MacOS, linux and windows (64bit only)}
16
16
  gem.homepage = 'https://ruby-processing.github.io/propane/'
17
17
  gem.files = `git ls-files`.split($/)
18
- gem.files << 'lib/propane-3.2.0.jar'
18
+ gem.files << 'lib/propane-3.3.0.jar'
19
19
  gem.files << 'lib/gluegen-rt.jar'
20
20
  gem.files << 'lib/jogl-all.jar'
21
21
  gem.files << 'lib/gluegen-rt-natives-linux-amd64.jar'
@@ -16,65 +16,71 @@
16
16
  Public License along with this library; if not, write to the
17
17
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18
18
  Boston, MA 02111-1307 USA
19
- */
19
+ */
20
20
  package japplemenubar;
21
21
 
22
22
  import java.io.*;
23
23
 
24
24
  import processing.core.PApplet;
25
25
 
26
+
26
27
  /**
27
- * Starting point for the application. General initialization should be done
28
- * inside the ApplicationController's init() method. If certain kinds of
29
- * non-Swing initialization takes too long, it should happen in a new Thread and
30
- * off the Swing event dispatch thread (EDT).
31
- *
28
+ * Starting point for the application. General initialization should be done
29
+ * inside the ApplicationController's init() method. If certain kinds of
30
+ * non-Swing initialization takes too long, it should happen in a new Thread
31
+ * and off the Swing event dispatch thread (EDT).
32
+ *
32
33
  * @author hansi
33
34
  */
34
35
  public class JAppleMenuBar {
36
+ static JAppleMenuBar instance;
37
+ static final String FILENAME = "libjAppleMenuBar.jnilib";
38
+
39
+ static {
40
+ try {
41
+ File temp = File.createTempFile("processing", "menubar");
42
+ temp.delete(); // remove the file itself
43
+ temp.mkdirs(); // create a directory out of it
44
+ temp.deleteOnExit();
35
45
 
36
- static JAppleMenuBar instance;
37
- static final String FILENAME = "libjAppleMenuBar.jnilib";
38
-
39
- static {
40
- try {
41
- File temp = File.createTempFile("processing", "menubar");
42
- temp.delete(); // remove the file itself
43
- temp.mkdirs(); // create a directory out of it
44
- temp.deleteOnExit();
46
+ File jnilibFile = new File(temp, FILENAME);
47
+ InputStream input = JAppleMenuBar.class.getResourceAsStream(FILENAME);
48
+ if (input != null) {
49
+ if (PApplet.saveStream(jnilibFile, input)) {
50
+ System.load(jnilibFile.getAbsolutePath());
51
+ instance = new JAppleMenuBar();
45
52
 
46
- File jnilibFile = new File(temp, FILENAME);
47
- InputStream input = JAppleMenuBar.class.getResourceAsStream(FILENAME);
48
- if (input != null) {
49
- if (PApplet.saveStream(jnilibFile, input)) {
50
- System.load(jnilibFile.getAbsolutePath());
51
- instance = new JAppleMenuBar();
52
-
53
- } else {
54
- sadness("Problem saving " + FILENAME + " for full screen use.");
55
- }
56
- } else {
57
- sadness("Could not load " + FILENAME + " from core.jar");
58
- }
59
- } catch (IOException e) {
60
- sadness("Unknown error, here's the stack trace.");
61
- e.printStackTrace();
62
- }
63
- }
64
-
65
- static void sadness(String msg) {
66
- System.err.println("Full screen mode disabled. " + msg);
67
- }
53
+ } else {
54
+ sadness("Problem saving " + FILENAME + " for full screen use.");
55
+ }
56
+ } else {
57
+ sadness("Could not load " + FILENAME + " from core.jar");
58
+ }
59
+ } catch (IOException e) {
60
+ sadness("Unknown error, here's the stack trace.");
61
+ e.printStackTrace();
62
+ }
63
+ }
64
+
65
+
66
+ static void sadness(String msg) {
67
+ System.err.println("Full screen mode disabled. " + msg);
68
+ }
68
69
 
70
+
69
71
  // static public void show() {
70
72
  // instance.setVisible(true);
71
73
  // }
72
- static public void hide() {
73
- instance.setVisible(false, false);
74
- }
75
74
 
76
- public native void setVisible(boolean visibility, boolean kioskMode);
75
+
76
+ static public void hide() {
77
+ instance.setVisible(false, false);
78
+ }
79
+
80
+
81
+ public native void setVisible(boolean visibility, boolean kioskMode);
77
82
 
83
+
78
84
  // public void setVisible(boolean visibility) {
79
85
  // // Keep original API in-tact. Default kiosk-mode to off.
80
86
  // setVisible(visibility, false);
@@ -1,21 +1,21 @@
1
1
  package monkstone.vecmath;
2
2
 
3
- import processing.core.PApplet;
3
+ import processing.core.PGraphics;
4
4
 
5
5
  /**
6
6
  *
7
7
  * @author Martin Prout
8
8
  */
9
- public class AppRender implements JRender {
9
+ public class GfxRender implements JRender {
10
10
 
11
- final PApplet app;
11
+ final PGraphics graphics;
12
12
 
13
13
  /**
14
14
  *
15
- * @param app PApplet
15
+ * @param graphics PGraphics
16
16
  */
17
- public AppRender(final PApplet app) {
18
- this.app = app;
17
+ public GfxRender(final PGraphics graphics) {
18
+ this.graphics = graphics;
19
19
  }
20
20
 
21
21
  /**
@@ -25,7 +25,7 @@ public class AppRender implements JRender {
25
25
  */
26
26
  @Override
27
27
  public void vertex(double x, double y) {
28
- app.vertex((float) x, (float) y);
28
+ graphics.vertex((float) x, (float) y);
29
29
  }
30
30
 
31
31
  /**
@@ -35,7 +35,7 @@ public class AppRender implements JRender {
35
35
  */
36
36
  @Override
37
37
  public void curveVertex(double x, double y) {
38
- app.curveVertex((float) x, (float) y);
38
+ graphics.curveVertex((float) x, (float) y);
39
39
  }
40
40
 
41
41
  /**
@@ -46,7 +46,7 @@ public class AppRender implements JRender {
46
46
  */
47
47
  @Override
48
48
  public void vertex(double x, double y, double z) {
49
- app.vertex((float) x, (float) y, (float) z);
49
+ graphics.vertex((float) x, (float) y, (float) z);
50
50
  }
51
51
 
52
52
  /**
@@ -57,7 +57,7 @@ public class AppRender implements JRender {
57
57
  */
58
58
  @Override
59
59
  public void normal(double x, double y, double z) {
60
- app.normal((float) x, (float) y, (float) z);
60
+ graphics.normal((float) x, (float) y, (float) z);
61
61
  }
62
62
 
63
63
  /**
@@ -70,7 +70,7 @@ public class AppRender implements JRender {
70
70
  */
71
71
  @Override
72
72
  public void vertex(double x, double y, double z, double u, double v) {
73
- app.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
73
+ graphics.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
74
74
  }
75
75
 
76
76
  /**
@@ -81,6 +81,6 @@ public class AppRender implements JRender {
81
81
  */
82
82
  @Override
83
83
  public void curveVertex(double x, double y, double z) {
84
- app.curveVertex((float) x, (float) y, (float) z);
84
+ graphics.curveVertex((float) x, (float) y, (float) z);
85
85
  }
86
86
  }