propane 2.0.6-java → 2.1.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -3
- data/lib/propane/app.rb +14 -9
- data/lib/propane/version.rb +1 -1
- data/pom.rb +1 -1
- data/pom.xml +1 -1
- data/src/monkstone/ColorUtil.java +42 -27
- data/vendors/Rakefile +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 833e28f17c9ccee6633b4b72e047cb3bb19dac95
|
4
|
+
data.tar.gz: 0bf06a5796ced532ad970af689ac9f734aa569dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7807f527d2946ec41416819b30e3838ffa27164183080fed34ff13f42dfd9cf69702d48de50614f1764c3bf902fa3a96bdddec6db76bd4b0535b8cda8ccdc24
|
7
|
+
data.tar.gz: 41804e15ab02a6fc37dac4fa34c353c7bbfa836c7ad169cf2e525d009a327f3dc6077a9e63f4423d21ac471bb3e668b373a83e84a5dc060a7202b20da317aa03
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
+
**v2.1.0** Add missing method to ColorUtil.java, `include HelperMethods, PConstants, Math, MathTool` in `Propane::Proxy`, it is just simpler that way. Mixin Renderer for AppRender and ShapeRender. Changes to `Propane::Proxy` are significant enough to warrant versioning bump, samples making use of new code will not be runable by earlier versions.
|
2
|
+
|
1
3
|
**v2.0.6** Update to core processing-3.2.3
|
2
4
|
|
3
5
|
**v2.0.5** Update to processing-3.2.2, fix local library load, add proxy_library expand samples
|
6
|
+
|
4
7
|
**v2.0.4** Correct `norm_strict`, add `math_tool_test` add `simplex_noise` expand samples
|
5
8
|
|
6
9
|
**v2.0.3** Suggest use of jruby-9.1.4.0, more about loading vanilla libraries
|
@@ -14,13 +17,13 @@
|
|
14
17
|
**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.
|
15
18
|
|
16
19
|
**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.
|
17
|
-
**v0.7.0** Update to JRuby-Complete-9.1.2.0.
|
18
20
|
|
19
|
-
**v0.
|
21
|
+
**v0.7.0** Update to JRuby-Complete-9.1.2.0.
|
22
|
+
|
23
|
+
**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).
|
20
24
|
|
21
25
|
**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).
|
22
26
|
|
23
27
|
**v0.4.0.pre** Inclusion of jogl-all.jar should fix 3D if install fails try getting rid of previous versions of gem (especially if you had done local installs, foxed me first) 3D still only for linux64 and macosx, any Windows developers are welcome to extend to windows (should be easy).
|
24
28
|
|
25
29
|
**v0.3.0.pre** First pre-release of propane.gem turns out 3D was not working because of missing jar in gem (3D was only going to work on macosx and linux64 OS anyways.
|
26
|
-
|
data/lib/propane/app.rb
CHANGED
@@ -9,12 +9,17 @@ module Propane
|
|
9
9
|
Java::Monkstone::PropaneLibrary.load(JRuby.runtime)
|
10
10
|
SKETCH_ROOT = File.absolute_path('.')
|
11
11
|
|
12
|
+
module Render
|
13
|
+
java_import 'monkstone.vecmath.AppRender'
|
14
|
+
java_import 'monkstone.vecmath.ShapeRender'
|
15
|
+
end
|
16
|
+
|
12
17
|
# This class is the base class the user should inherit from when making
|
13
18
|
# their own sketch.
|
14
19
|
#
|
15
20
|
# i.e.
|
16
21
|
# require 'propane'
|
17
|
-
#
|
22
|
+
#
|
18
23
|
# class MySketch < Propane::App
|
19
24
|
#
|
20
25
|
# def draw
|
@@ -40,14 +45,14 @@ module Propane
|
|
40
45
|
|
41
46
|
# All sketches extend this class
|
42
47
|
class App < PApplet
|
43
|
-
include Math, MathTool, HelperMethods
|
48
|
+
include Math, MathTool, HelperMethods, Render
|
44
49
|
# Alias some methods for familiarity for Shoes coders.
|
45
50
|
alias oval ellipse
|
46
51
|
alias stroke_width stroke_weight
|
47
52
|
alias rgb color
|
48
53
|
alias gray color
|
49
54
|
field_reader :surface
|
50
|
-
|
55
|
+
|
51
56
|
def sketch_class
|
52
57
|
self.class.sketch_class
|
53
58
|
end
|
@@ -58,7 +63,7 @@ module Propane
|
|
58
63
|
super(subclass)
|
59
64
|
@sketch_class = subclass
|
60
65
|
end
|
61
|
-
|
66
|
+
|
62
67
|
# App should be instantiated with an optional list of options
|
63
68
|
# and array of arguments.
|
64
69
|
#
|
@@ -119,7 +124,7 @@ module Propane
|
|
119
124
|
import_opengl if /opengl/ =~ mode
|
120
125
|
super(*args)
|
121
126
|
end
|
122
|
-
|
127
|
+
|
123
128
|
def sketch_title(title)
|
124
129
|
surface.set_title(title)
|
125
130
|
end
|
@@ -155,15 +160,15 @@ module Propane
|
|
155
160
|
end
|
156
161
|
end
|
157
162
|
|
158
|
-
# Importing PConstants to access
|
159
|
-
# to
|
160
|
-
#
|
163
|
+
# Importing PConstants to access processing constants, we also need to
|
164
|
+
# 'include PConstants' to avoid requiring the `PConstants::` prefix
|
165
|
+
# `include Math etc because we expect to use them`
|
161
166
|
# Using :method_missing to mimic inner class methods
|
162
167
|
# @HACK you should consider using 'forwardable' to avoid this
|
163
168
|
# egregious hack...
|
164
169
|
module Proxy
|
165
170
|
java_import 'processing.core.PConstants'
|
166
|
-
|
171
|
+
include Math, MathTool, HelperMethods, PConstants
|
167
172
|
def respond_to_missing?(name, include_private = false)
|
168
173
|
$app.respond_to?(name) || super
|
169
174
|
end
|
data/lib/propane/version.rb
CHANGED
data/pom.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
project 'rp5extras', 'https://github.com/monkstone/propane' do
|
3
3
|
model_version '4.0.0'
|
4
|
-
id 'propane:propane', '2.0
|
4
|
+
id 'propane:propane', '2.1.0'
|
5
5
|
packaging 'jar'
|
6
6
|
description 'rp5extras for propane'
|
7
7
|
organization 'ruby-processing', 'https://ruby-processing.github.io'
|
data/pom.xml
CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
11
11
|
<modelVersion>4.0.0</modelVersion>
|
12
12
|
<groupId>propane</groupId>
|
13
13
|
<artifactId>propane</artifactId>
|
14
|
-
<version>2.0
|
14
|
+
<version>2.1.0</version>
|
15
15
|
<name>rp5extras</name>
|
16
16
|
<description>rp5extras for propane</description>
|
17
17
|
<url>https://github.com/monkstone/propane</url>
|
@@ -1,11 +1,14 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
*
|
2
|
+
* This utility allows JRubyArt users to use the processing.org color method
|
3
|
+
* in their sketches. Includes a method to efficiently convert an array of web
|
4
|
+
* strings to an array of color int, and another to convert an array of color
|
5
|
+
* int to a string that can be used in ruby code (to generate web color array).
|
6
|
+
* Copyright (c) 2015-16 Martin Prout.
|
7
|
+
* This utility is free software; you can redistribute it and/or modify
|
8
|
+
* it under the terms of the GNU Lesser General Public License as published by
|
9
|
+
* the Free Software Foundation; either version 2.1 of the License, or (at
|
10
|
+
* your option) any later version.
|
11
|
+
*
|
9
12
|
* Obtain a copy of the license at http://www.gnu.org/licenses/lgpl-2.1.html
|
10
13
|
*/
|
11
14
|
package monkstone;
|
@@ -16,9 +19,10 @@ package monkstone;
|
|
16
19
|
*/
|
17
20
|
public class ColorUtil {
|
18
21
|
|
19
|
-
|
22
|
+
/**
|
20
23
|
* Returns hex long as a positive int unless greater than Integer.MAX_VALUE
|
21
24
|
* else return the complement as a negative integer or something like that
|
25
|
+
*
|
22
26
|
* @param hexlong long
|
23
27
|
* @return rgb int
|
24
28
|
*/
|
@@ -38,32 +42,32 @@ public class ColorUtil {
|
|
38
42
|
static public int colorString(String hexstring) {
|
39
43
|
return java.awt.Color.decode(hexstring).getRGB();
|
40
44
|
}
|
41
|
-
|
45
|
+
|
42
46
|
/**
|
43
47
|
*
|
44
48
|
* @param web Array of web (hex) String
|
45
49
|
* @return array of color int according to java
|
46
50
|
*/
|
47
|
-
|
48
|
-
static public int[] webArray(String[] web){
|
51
|
+
static public int[] webArray(String[] web) {
|
49
52
|
int[] result = new int[web.length];
|
50
|
-
for (int i = 0; i < web.length; i++
|
53
|
+
for (int i = 0; i < web.length; i++) {
|
51
54
|
result[i] = java.awt.Color.decode(web[i]).getRGB();
|
52
55
|
}
|
53
56
|
return result;
|
54
57
|
}
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Return a ruby string of the form "%w(a b c)" where a, b, c are raw web
|
61
|
+
* strings. This string can be used in ruby code.
|
62
|
+
*
|
63
|
+
* @param hex int array
|
64
|
+
* @return String for use in ruby
|
65
|
+
*/
|
66
|
+
static public String rubyString(int[] hex) {
|
63
67
|
StringBuilder result = new StringBuilder("%w(");
|
64
|
-
for (int i = 0; i < hex.length; i++
|
68
|
+
for (int i = 0; i < hex.length; i++) {
|
65
69
|
result.append(String.format("#%06X", (0xFFFFFF & hex[i])));
|
66
|
-
if (i < hex.length - 1){
|
70
|
+
if (i < hex.length - 1) {
|
67
71
|
result.append(' ');
|
68
72
|
}
|
69
73
|
}
|
@@ -79,14 +83,14 @@ public class ColorUtil {
|
|
79
83
|
static public float colorLong(double hex) {
|
80
84
|
return (float) hex;
|
81
85
|
}
|
82
|
-
|
86
|
+
|
83
87
|
/**
|
84
88
|
*
|
85
89
|
* @param hexlong long
|
86
90
|
* @return hexlong int
|
87
91
|
*/
|
88
|
-
static public int colorLong(long hexlong){
|
89
|
-
|
92
|
+
static public int colorLong(long hexlong) {
|
93
|
+
return hexLong(hexlong);
|
90
94
|
}
|
91
95
|
|
92
96
|
/**
|
@@ -94,7 +98,18 @@ public class ColorUtil {
|
|
94
98
|
* @param hex double
|
95
99
|
* @return hex float
|
96
100
|
*/
|
97
|
-
static public float colorDouble(double hex){
|
98
|
-
|
101
|
+
static public float colorDouble(double hex) {
|
102
|
+
return (float) hex;
|
103
|
+
}
|
104
|
+
|
105
|
+
/**
|
106
|
+
*
|
107
|
+
* @param hue
|
108
|
+
* @param sat
|
109
|
+
* @param brightness
|
110
|
+
* @return
|
111
|
+
*/
|
112
|
+
static public int hsbToRgB(double hue, double sat, double brightness) {
|
113
|
+
return java.awt.Color.HSBtoRGB((float) hue, (float) sat, (float) brightness);
|
99
114
|
}
|
100
115
|
}
|
data/vendors/Rakefile
CHANGED
@@ -9,7 +9,7 @@ SOUND = 'sound.zip'.freeze
|
|
9
9
|
SOUND_VERSION = 'v1.3.2' # version 1.3.2
|
10
10
|
VIDEO = 'video-2.zip'
|
11
11
|
VIDEO_VERSION = '2' # version 1.0.1
|
12
|
-
EXAMPLES = '0.
|
12
|
+
EXAMPLES = '0.7'.freeze
|
13
13
|
HOME_DIR = ENV['HOME']
|
14
14
|
MAC_OR_LINUX = /linux|mac|darwin/ =~ RbConfig::CONFIG['host_os']
|
15
15
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: propane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- monkstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arcball
|