propane 3.1.0.pre-java → 3.2.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.
- checksums.yaml +4 -4
- data/.mvn/wrapper/maven-wrapper.properties +1 -0
- data/CHANGELOG.md +1 -5
- data/README.md +23 -12
- data/Rakefile +23 -12
- data/lib/propane/helpers/version_error.rb +6 -0
- data/lib/propane/runner.rb +12 -0
- data/lib/propane/version.rb +1 -1
- data/library/slider/slider.rb +1 -1
- data/mvnw +234 -0
- data/mvnw.cmd +145 -0
- data/pom.xml +28 -27
- data/propane.gemspec +2 -2
- data/src/main/java/japplemenubar/JAppleMenuBar.java +41 -47
- data/src/main/java/monkstone/ColorUtil.java +1 -1
- data/src/main/java/monkstone/MathToolModule.java +12 -11
- data/src/main/java/monkstone/PropaneLibrary.java +9 -10
- data/src/main/java/monkstone/core/LibraryProxy.java +124 -113
- data/src/main/java/monkstone/fastmath/Deglut.java +86 -89
- data/src/main/java/monkstone/filechooser/Chooser.java +7 -13
- data/src/main/java/monkstone/noise/SimplexNoise.java +0 -1
- data/src/main/java/monkstone/slider/CustomHorizontalSlider.java +4 -4
- data/src/main/java/monkstone/slider/CustomVerticalSlider.java +1 -1
- data/src/main/java/monkstone/slider/SimpleHorizontalSlider.java +9 -9
- data/src/main/java/monkstone/slider/SimpleSlider.java +0 -9
- data/src/main/java/monkstone/slider/SimpleVerticalSlider.java +11 -13
- data/src/main/java/monkstone/slider/Slider.java +1 -1
- 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/slider/WheelHandler.java +8 -9
- data/src/main/java/monkstone/vecmath/AppRender.java +2 -2
- data/src/main/java/monkstone/vecmath/ShapeRender.java +2 -2
- data/src/main/java/monkstone/vecmath/package-info.java +2 -2
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +2 -2
- data/src/main/java/monkstone/vecmath/vec3/Vec3.java +1 -1
- data/src/main/java/monkstone/videoevent/VideoInterface.java +11 -5
- data/src/main/java/monkstone/videoevent/package-info.java +2 -2
- data/src/main/java/processing/awt/PGraphicsJava2D.java +1742 -2243
- data/src/main/java/processing/awt/PShapeJava2D.java +268 -270
- data/src/main/java/processing/awt/PSurfaceAWT.java +821 -920
- data/src/main/java/processing/core/DesktopHandler.java +94 -0
- data/src/main/java/processing/core/PApplet.java +14170 -14082
- data/src/main/java/processing/core/PConstants.java +447 -473
- data/src/main/java/processing/core/PFont.java +867 -873
- data/src/main/java/processing/core/PGraphics.java +7193 -7428
- data/src/main/java/processing/core/PImage.java +3051 -3117
- data/src/main/java/processing/core/PMatrix.java +159 -172
- data/src/main/java/processing/core/PMatrix2D.java +403 -444
- data/src/main/java/processing/core/PMatrix3D.java +735 -749
- data/src/main/java/processing/core/PShape.java +2651 -2793
- data/src/main/java/processing/core/PShapeOBJ.java +415 -422
- data/src/main/java/processing/core/PShapeSVG.java +1466 -1475
- data/src/main/java/processing/core/PStyle.java +37 -40
- data/src/main/java/processing/core/PSurface.java +98 -103
- data/src/main/java/processing/core/PSurfaceNone.java +208 -236
- data/src/main/java/processing/core/PVector.java +961 -990
- data/src/main/java/processing/data/DoubleDict.java +709 -753
- data/src/main/java/processing/data/DoubleList.java +695 -748
- data/src/main/java/processing/data/FloatDict.java +702 -746
- data/src/main/java/processing/data/FloatList.java +697 -751
- data/src/main/java/processing/data/IntDict.java +673 -718
- data/src/main/java/processing/data/IntList.java +633 -699
- data/src/main/java/processing/data/JSONArray.java +873 -931
- data/src/main/java/processing/data/JSONObject.java +1165 -1262
- data/src/main/java/processing/data/JSONTokener.java +341 -351
- data/src/main/java/processing/data/LongDict.java +662 -707
- data/src/main/java/processing/data/LongList.java +634 -700
- data/src/main/java/processing/data/Sort.java +41 -37
- data/src/main/java/processing/data/StringDict.java +486 -522
- data/src/main/java/processing/data/StringList.java +580 -624
- data/src/main/java/processing/data/Table.java +3508 -3686
- data/src/main/java/processing/data/TableRow.java +183 -182
- data/src/main/java/processing/data/XML.java +883 -957
- data/src/main/java/processing/event/Event.java +66 -87
- data/src/main/java/processing/event/KeyEvent.java +41 -48
- data/src/main/java/processing/event/MouseEvent.java +93 -103
- data/src/main/java/processing/event/TouchEvent.java +6 -10
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +5 -69
- data/src/main/java/processing/javafx/PSurfaceFX.java +2 -7
- data/src/main/java/processing/opengl/FontTexture.java +270 -290
- data/src/main/java/processing/opengl/FrameBuffer.java +363 -375
- data/src/main/java/processing/opengl/LinePath.java +500 -543
- data/src/main/java/processing/opengl/LineStroker.java +582 -593
- data/src/main/java/processing/opengl/PGL.java +2881 -2904
- data/src/main/java/processing/opengl/PGraphics2D.java +315 -408
- data/src/main/java/processing/opengl/PGraphics3D.java +72 -107
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +12043 -12230
- data/src/main/java/processing/opengl/PJOGL.java +1681 -1745
- data/src/main/java/processing/opengl/PShader.java +1257 -1260
- data/src/main/java/processing/opengl/PShapeOpenGL.java +4599 -4662
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +1030 -1047
- data/src/main/java/processing/opengl/Texture.java +1397 -1462
- data/src/main/java/processing/opengl/VertexBuffer.java +55 -57
- 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 +12 -8
- data/src/main/java/processing/core/ThinkDifferent.java +0 -70
data/mvnw.cmd
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
@REM ----------------------------------------------------------------------------
|
|
2
|
+
@REM Licensed to the Apache Software Foundation (ASF) under one
|
|
3
|
+
@REM or more contributor license agreements. See the NOTICE file
|
|
4
|
+
@REM distributed with this work for additional information
|
|
5
|
+
@REM regarding copyright ownership. The ASF licenses this file
|
|
6
|
+
@REM to you under the Apache License, Version 2.0 (the
|
|
7
|
+
@REM "License"); you may not use this file except in compliance
|
|
8
|
+
@REM with the License. You may obtain a copy of the License at
|
|
9
|
+
@REM
|
|
10
|
+
@REM http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
@REM
|
|
12
|
+
@REM Unless required by applicable law or agreed to in writing,
|
|
13
|
+
@REM software distributed under the License is distributed on an
|
|
14
|
+
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
15
|
+
@REM KIND, either express or implied. See the License for the
|
|
16
|
+
@REM specific language governing permissions and limitations
|
|
17
|
+
@REM under the License.
|
|
18
|
+
@REM ----------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
@REM ----------------------------------------------------------------------------
|
|
21
|
+
@REM Maven2 Start Up Batch script
|
|
22
|
+
@REM
|
|
23
|
+
@REM Required ENV vars:
|
|
24
|
+
@REM JAVA_HOME - location of a JDK home dir
|
|
25
|
+
@REM
|
|
26
|
+
@REM Optional ENV vars
|
|
27
|
+
@REM M2_HOME - location of maven2's installed home dir
|
|
28
|
+
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
|
29
|
+
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
|
30
|
+
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
|
31
|
+
@REM e.g. to debug Maven itself, use
|
|
32
|
+
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
|
33
|
+
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
|
34
|
+
@REM ----------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
|
37
|
+
@echo off
|
|
38
|
+
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
|
39
|
+
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
|
40
|
+
|
|
41
|
+
@REM set %HOME% to equivalent of $HOME
|
|
42
|
+
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
|
43
|
+
|
|
44
|
+
@REM Execute a user defined script before this one
|
|
45
|
+
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
|
46
|
+
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
|
47
|
+
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
|
48
|
+
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
|
49
|
+
:skipRcPre
|
|
50
|
+
|
|
51
|
+
@setlocal
|
|
52
|
+
|
|
53
|
+
set ERROR_CODE=0
|
|
54
|
+
|
|
55
|
+
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
|
56
|
+
@setlocal
|
|
57
|
+
|
|
58
|
+
@REM ==== START VALIDATION ====
|
|
59
|
+
if not "%JAVA_HOME%" == "" goto OkJHome
|
|
60
|
+
|
|
61
|
+
echo.
|
|
62
|
+
echo Error: JAVA_HOME not found in your environment. >&2
|
|
63
|
+
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
|
64
|
+
echo location of your Java installation. >&2
|
|
65
|
+
echo.
|
|
66
|
+
goto error
|
|
67
|
+
|
|
68
|
+
:OkJHome
|
|
69
|
+
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
|
70
|
+
|
|
71
|
+
echo.
|
|
72
|
+
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
|
73
|
+
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
|
74
|
+
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
|
75
|
+
echo location of your Java installation. >&2
|
|
76
|
+
echo.
|
|
77
|
+
goto error
|
|
78
|
+
|
|
79
|
+
@REM ==== END VALIDATION ====
|
|
80
|
+
|
|
81
|
+
:init
|
|
82
|
+
|
|
83
|
+
set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %*
|
|
84
|
+
|
|
85
|
+
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
|
86
|
+
@REM Fallback to current working directory if not found.
|
|
87
|
+
|
|
88
|
+
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
|
89
|
+
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
|
90
|
+
|
|
91
|
+
set EXEC_DIR=%CD%
|
|
92
|
+
set WDIR=%EXEC_DIR%
|
|
93
|
+
:findBaseDir
|
|
94
|
+
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
|
95
|
+
cd ..
|
|
96
|
+
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
|
97
|
+
set WDIR=%CD%
|
|
98
|
+
goto findBaseDir
|
|
99
|
+
|
|
100
|
+
:baseDirFound
|
|
101
|
+
set MAVEN_PROJECTBASEDIR=%WDIR%
|
|
102
|
+
cd "%EXEC_DIR%"
|
|
103
|
+
goto endDetectBaseDir
|
|
104
|
+
|
|
105
|
+
:baseDirNotFound
|
|
106
|
+
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
|
107
|
+
cd "%EXEC_DIR%"
|
|
108
|
+
|
|
109
|
+
:endDetectBaseDir
|
|
110
|
+
|
|
111
|
+
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
|
112
|
+
|
|
113
|
+
@setlocal EnableExtensions EnableDelayedExpansion
|
|
114
|
+
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
|
115
|
+
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
|
116
|
+
|
|
117
|
+
:endReadAdditionalConfig
|
|
118
|
+
|
|
119
|
+
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
|
120
|
+
|
|
121
|
+
set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar""
|
|
122
|
+
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
|
123
|
+
|
|
124
|
+
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CMD_LINE_ARGS%
|
|
125
|
+
if ERRORLEVEL 1 goto error
|
|
126
|
+
goto end
|
|
127
|
+
|
|
128
|
+
:error
|
|
129
|
+
set ERROR_CODE=1
|
|
130
|
+
|
|
131
|
+
:end
|
|
132
|
+
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
|
133
|
+
|
|
134
|
+
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
|
135
|
+
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
|
136
|
+
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
|
137
|
+
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
|
138
|
+
:skipRcPost
|
|
139
|
+
|
|
140
|
+
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
|
141
|
+
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
|
142
|
+
|
|
143
|
+
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
|
144
|
+
|
|
145
|
+
exit /B %ERROR_CODE%
|
data/pom.xml
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<modelVersion>4.0.0</modelVersion>
|
|
5
5
|
<groupId>propane</groupId>
|
|
6
6
|
<artifactId>propane</artifactId>
|
|
7
|
-
<version>3.
|
|
7
|
+
<version>3.2.0</version>
|
|
8
8
|
<name>propane</name>
|
|
9
9
|
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
|
|
10
10
|
<url>https://github.com/monkstone/propane</url>
|
|
@@ -64,19 +64,20 @@
|
|
|
64
64
|
<properties>
|
|
65
65
|
<jogl.version>2.3.2</jogl.version>
|
|
66
66
|
<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>
|
|
67
70
|
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
|
|
68
71
|
<processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
|
|
69
72
|
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
|
70
73
|
<propane.basedir>${project.basedir}</propane.basedir>
|
|
71
74
|
<source.directory>src</source.directory>
|
|
72
|
-
<maven.compiler.source>11</maven.compiler.source>
|
|
73
|
-
<maven.compiler.target>11</maven.compiler.target>
|
|
74
75
|
</properties>
|
|
75
76
|
<dependencies>
|
|
76
77
|
<dependency>
|
|
77
78
|
<groupId>org.jruby</groupId>
|
|
78
79
|
<artifactId>jruby</artifactId>
|
|
79
|
-
<version>9.2.
|
|
80
|
+
<version>9.2.6.0</version>
|
|
80
81
|
<type>pom</type>
|
|
81
82
|
</dependency>
|
|
82
83
|
<dependency>
|
|
@@ -130,30 +131,30 @@
|
|
|
130
131
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
131
132
|
<version>3.8.0</version>
|
|
132
133
|
<configuration>
|
|
133
|
-
|
|
134
|
-
</configuration>
|
|
135
|
-
</plugin>
|
|
136
|
-
<plugin>
|
|
137
|
-
<artifactId>maven-javadoc-plugin</artifactId>
|
|
138
|
-
<version>3.0.1</version>
|
|
139
|
-
<configuration>
|
|
140
|
-
<detectOfflineLinks>false</detectOfflineLinks>
|
|
141
|
-
<links>
|
|
142
|
-
<link>${jruby.api}</link>
|
|
143
|
-
<link>${processing.api}</link>
|
|
144
|
-
</links>
|
|
134
|
+
<release>11</release>
|
|
145
135
|
</configuration>
|
|
146
136
|
</plugin>
|
|
147
137
|
<plugin>
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
</
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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>
|
|
159
160
|
</project>
|
data/propane.gemspec
CHANGED
|
@@ -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.
|
|
15
|
+
gem.summary = %q{ruby wrapper for processing-3.5 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.
|
|
18
|
+
gem.files << 'lib/propane-3.2.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,71 +16,65 @@
|
|
|
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
|
-
|
|
27
26
|
/**
|
|
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
|
-
*
|
|
32
|
-
*
|
|
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
|
+
*
|
|
33
32
|
* @author hansi
|
|
34
33
|
*/
|
|
35
34
|
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();
|
|
45
35
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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();
|
|
52
45
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
+
}
|
|
69
68
|
|
|
70
|
-
|
|
71
69
|
// static public void show() {
|
|
72
70
|
// instance.setVisible(true);
|
|
73
71
|
// }
|
|
72
|
+
static public void hide() {
|
|
73
|
+
instance.setVisible(false, false);
|
|
74
|
+
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
static public void hide() {
|
|
77
|
-
instance.setVisible(false, false);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
public native void setVisible(boolean visibility, boolean kioskMode);
|
|
76
|
+
public native void setVisible(boolean visibility, boolean kioskMode);
|
|
82
77
|
|
|
83
|
-
|
|
84
78
|
// public void setVisible(boolean visibility) {
|
|
85
79
|
// // Keep original API in-tact. Default kiosk-mode to off.
|
|
86
80
|
// setVisible(visibility, false);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* in their sketches. Includes a method to efficiently convert an array of web
|
|
4
4
|
* strings to an array of color int, and another to convert an array of color
|
|
5
5
|
* int to a string that can be used in ruby code (to generate web color array).
|
|
6
|
-
* Copyright (c) 2015-
|
|
6
|
+
* Copyright (c) 2015-19 Martin Prout.
|
|
7
7
|
* This utility is free software; you can redistribute it and/or modify
|
|
8
8
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
9
9
|
* the Free Software Foundation; either version 2.1 of the License, or (at
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The purpose of this tool is to allow propane users to use an alternative
|
|
3
3
|
* to processing.org map, lerp and norm methods in their sketches
|
|
4
|
-
* Copyright (c) 2015-
|
|
4
|
+
* Copyright (c) 2015-19 Martin Prout. This tool is free software; you can
|
|
5
5
|
* redistribute it and/or modify it under the terms of the GNU Lesser General
|
|
6
6
|
* Public License as published by the Free Software Foundation; either version
|
|
7
7
|
* 2.1 of the License, or (at your option) any later version.
|
|
@@ -175,7 +175,8 @@ public class MathToolModule {
|
|
|
175
175
|
}
|
|
176
176
|
return mapMt(context, value, start, stop, 0, 1.0);
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
// start2 + (stop2 - start2) * ((value - start1) / (stop1 - start1));
|
|
179
|
+
|
|
179
180
|
static final RubyFloat mapMt(ThreadContext context, double value, double first1, double last1, double first2, double last2) {
|
|
180
181
|
double result = first2 + (last2 - first2) * ((value - first1) / (last1 - first1));
|
|
181
182
|
return context.runtime.newFloat(result);
|
|
@@ -218,17 +219,17 @@ public class MathToolModule {
|
|
|
218
219
|
int column = (int) args[1].toJava(Integer.class);
|
|
219
220
|
int rowStep = 1;
|
|
220
221
|
int colStep = 1;
|
|
221
|
-
if (args.length == 4){
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
if (args.length == 4) {
|
|
223
|
+
rowStep = (int) args[2].toJava(Integer.class);
|
|
224
|
+
colStep = (int) args[3].toJava(Integer.class);
|
|
224
225
|
}
|
|
225
226
|
if (block.isGiven()) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
int tempRow = row / rowStep;
|
|
228
|
+
for (int z = 0; z < (tempRow * (column / colStep)); z++) {
|
|
229
|
+
int x = z % tempRow;
|
|
230
|
+
int y = z / tempRow;
|
|
231
|
+
block.yieldSpecific(context, context.runtime.newFixnum(x * rowStep), context.runtime.newFixnum(y * colStep));
|
|
232
|
+
}
|
|
232
233
|
}
|
|
233
234
|
return context.nil;
|
|
234
235
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The purpose of this class is to load the MathTool into ruby-processing runtime
|
|
3
|
-
* Copyright (C) 2015-
|
|
2
|
+
* The purpose of this class is to load the MathTool into ruby-processing runtime
|
|
3
|
+
* Copyright (C) 2015-19 Martin Prout. This code is free software; you can
|
|
4
4
|
* redistribute it and/or modify it under the terms of the GNU Lesser General
|
|
5
|
-
* Public License as published by the Free Software Foundation; either version
|
|
5
|
+
* Public License as published by the Free Software Foundation; either version
|
|
6
6
|
* 2.1 of the License, or (at your option) any later version.
|
|
7
|
-
*
|
|
7
|
+
*
|
|
8
8
|
* Obtain a copy of the license at http://www.gnu.org/licenses/lgpl-2.1.html
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
package monkstone;
|
|
12
11
|
|
|
13
12
|
import java.io.IOException;
|
|
@@ -21,8 +20,8 @@ import org.jruby.runtime.load.Library;
|
|
|
21
20
|
*
|
|
22
21
|
* @author Martin Prout
|
|
23
22
|
*/
|
|
24
|
-
public class PropaneLibrary implements Library{
|
|
25
|
-
|
|
23
|
+
public class PropaneLibrary implements Library {
|
|
24
|
+
|
|
26
25
|
/**
|
|
27
26
|
*
|
|
28
27
|
* @param runtime
|
|
@@ -32,8 +31,8 @@ public class PropaneLibrary implements Library{
|
|
|
32
31
|
Deglut.createDeglut(runtime);
|
|
33
32
|
Vec2.createVec2(runtime);
|
|
34
33
|
Vec3.createVec3(runtime);
|
|
35
|
-
}
|
|
36
|
-
|
|
34
|
+
}
|
|
35
|
+
|
|
37
36
|
/**
|
|
38
37
|
*
|
|
39
38
|
* @param runtime
|
|
@@ -43,5 +42,5 @@ public class PropaneLibrary implements Library{
|
|
|
43
42
|
@Override
|
|
44
43
|
public void load(final Ruby runtime, boolean wrap) throws IOException {
|
|
45
44
|
load(runtime);
|
|
46
|
-
}
|
|
45
|
+
}
|
|
47
46
|
}
|