Skip to content

Commit bd694b8

Browse files
committed
Merge branch 'buster' of https://github.com/ruby-processing/PiCrate into buster
2 parents 52b8e3f + becc7a5 commit bd694b8

File tree

11 files changed

+4198
-4283
lines changed

11 files changed

+4198
-4283
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
v2.0.0 Use JDK11+ update to processing-3.5.4
2+
13
v1.2.4 Extract picrate examples to ~/projects/examples instead of ~/picrate_samples for tighter integration with geany editor. Remove non-functioning sound library as an install option (direct toward minim as option).
24

35
v1.2.3 Favor latest beta Video2 library over GLVideo.

Rakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ task :init do
1212
# for Archlinux etc
1313
# processing_root = File.dirname(`readlink -f $(which processing)`)
1414
# alternative for debian linux etc
15-
processing_root = File.join(HOME_DIR, 'processing-3.5.3')
15+
processing_root = File.join(HOME_DIR, 'processing-3.5.4')
1616
jar_dir = File.join(processing_root, 'core', 'library')
1717
opengl = Dir.entries(jar_dir).grep(/amd64|armv6hf/).select { |jar| jar =~ /linux/ }
1818
opengl.concat %w[jogl-all.jar gluegen-rt.jar]

pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
1111
<modelVersion>4.0.0</modelVersion>
1212
<groupId>ruby-processing</groupId>
1313
<artifactId>picrate</artifactId>
14-
<version>1.2.4</version>
14+
<version>2.0.0.pre</version>
1515
<name>picrate</name>
1616
<description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
1717
<url>http://maven.apache.org</url>
@@ -119,11 +119,11 @@ DO NOT MODIFIY - GENERATED CODE
119119
<plugins>
120120
<plugin>
121121
<artifactId>maven-resources-plugin</artifactId>
122-
<version>3.1.0</version>
122+
<version>2.7</version>
123123
</plugin>
124124
<plugin>
125125
<artifactId>maven-dependency-plugin</artifactId>
126-
<version>3.1.1</version>
126+
<version>2.8</version>
127127
</plugin>
128128
<plugin>
129129
<artifactId>maven-compiler-plugin</artifactId>

src/main/java/processing/awt/PGraphicsJava2D.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class PGraphicsJava2D extends PGraphics {
8686
float[] curveDrawY;
8787

8888
int transformCount;
89-
AffineTransform transformStack[] =
89+
AffineTransform[] transformStack =
9090
new AffineTransform[MATRIX_STACK_DEPTH];
9191
double[] transform = new double[6];
9292

@@ -817,7 +817,7 @@ public void vertex(float x, float y) {
817817
//float vertex[];
818818

819819
if (vertexCount == vertices.length) {
820-
float temp[][] = new float[vertexCount<<1][VERTEX_FIELD_COUNT];
820+
float[][] temp = new float[vertexCount<<1][VERTEX_FIELD_COUNT];
821821
System.arraycopy(vertices, 0, temp, 0, vertexCount);
822822
vertices = temp;
823823
//message(CHATTER, "allocating more vertices " + vertices.length);
@@ -2002,7 +2002,7 @@ protected void handleTextSize(float size) {
20022002

20032003

20042004
@Override
2005-
protected float textWidthImpl(char buffer[], int start, int stop) {
2005+
protected float textWidthImpl(char[] buffer, int start, int stop) {
20062006
if (textFont == null) {
20072007
defaultFontOrDeath("textWidth");
20082008
}
@@ -2066,12 +2066,12 @@ protected float textWidthImpl(char buffer[], int start, int stop) {
20662066
// TEXT IMPL
20672067

20682068

2069-
//protected void textLineAlignImpl(char buffer[], int start, int stop,
2069+
//protected void textLineAlignImpl(char[] buffer, int start, int stop,
20702070
// float x, float y)
20712071

20722072

20732073
@Override
2074-
protected void textLineImpl(char buffer[], int start, int stop,
2074+
protected void textLineImpl(char[] buffer, int start, int stop,
20752075
float x, float y) {
20762076
Font font = (Font) textFont.getNative();
20772077
// if (font != null && (textFont.isStream() || hints[ENABLE_NATIVE_FONTS])) {
@@ -2884,7 +2884,7 @@ public void updatePixels(int x, int y, int c, int d) {
28842884
// GET/SET
28852885

28862886

2887-
static int getset[] = new int[1];
2887+
static int[] getset = new int[1];
28882888

28892889

28902890
@Override

src/main/java/processing/awt/PSurfaceAWT.java

-20
Original file line numberDiff line numberDiff line change
@@ -668,26 +668,6 @@ protected void setProcessingIcon(Frame frame) {
668668

669669
} catch (Exception e) {
670670
} // harmless; keep this to ourselves
671-
672-
// } else { // handle OS X differently
673-
// if (!dockIconSpecified()) { // don't override existing -Xdock param
674-
// // On OS X, set this for AWT surfaces, which handles the dock image
675-
// // as well as the cmd-tab image that's shown. Just one size, I guess.
676-
// URL url = PApplet.class.getResource("/icon/icon-512.png");
677-
// // Seems dangerous to have this in code instead of using reflection, no?
678-
// //ThinkDifferent.setIconImage(Toolkit.getDefaultToolkit().getImage(url));
679-
// try {
680-
// final String td = "processing.core.ThinkDifferent";
681-
// Class<?> thinkDifferent =
682-
// Thread.currentThread().getContextClassLoader().loadClass(td);
683-
// Method method =
684-
// thinkDifferent.getMethod("setIconImage", new Class[] { java.awt.Image.class });
685-
// method.invoke(null, new Object[] { Toolkit.getDefaultToolkit().getImage(url) });
686-
// } catch (Exception e) {
687-
// e.printStackTrace(); // That's unfortunate
688-
// }
689-
// }
690-
// }
691671
}
692672

693673
/**

src/main/java/processing/core/PApplet.java

+14-15
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,11 @@
5252
import javax.swing.JFileChooser;
5353

5454
// set the look and feel, if specified
55-
import javax.swing.UIManager;
5655

5756
// used by link()
5857
import java.awt.Desktop;
5958

6059
// used by desktopFile() method
61-
import javax.swing.filechooser.FileSystemView;
6260

6361
// loadXML() error handling
6462
import javax.xml.parsers.ParserConfigurationException;
@@ -78,7 +76,6 @@
7876
import java.util.concurrent.ThreadFactory;
7977
import java.util.regex.*;
8078
import java.util.zip.*;
81-
import javax.swing.UnsupportedLookAndFeelException;
8279

8380
import processing.data.*;
8481
import processing.event.*;
@@ -328,7 +325,7 @@ public class PApplet implements PConstants {
328325
* is doubled. As a result, all operations that use pixels (like
329326
* <b>loadPixels()</b>, <b>get()</b>, <b>set()</b>, etc.) happen in this
330327
* doubled space. As a convenience, the variables <b>pixelWidth</b>
331-
* and <b>pixelHeight<b> hold the actual width and height of the sketch in
328+
* and <b>pixelHeight</b> hold the actual width and height of the sketch in
332329
* pixels. This is useful for any sketch that uses the <b>pixels[]</b>
333330
* array, for instance, because the number of elements in the array will be
334331
* <b>pixelWidth*pixelHeight</b>, not <b>width*height</b>.
@@ -1451,17 +1448,19 @@ protected int findIndex(Object object) {
14511448
* @param target the target object that should receive the event
14521449
*/
14531450
public void registerMethod(String methodName, Object target) {
1454-
if (methodName.equals("mouseEvent")) {
1455-
registerWithArgs("mouseEvent", target, new Class[]{processing.event.MouseEvent.class});
1456-
1457-
} else if (methodName.equals("keyEvent")) {
1458-
registerWithArgs("keyEvent", target, new Class[]{processing.event.KeyEvent.class});
1459-
1460-
} else if (methodName.equals("touchEvent")) {
1461-
registerWithArgs("touchEvent", target, new Class[]{processing.event.TouchEvent.class});
1462-
1463-
} else {
1464-
registerNoArgs(methodName, target);
1451+
switch (methodName) {
1452+
case "mouseEvent":
1453+
registerWithArgs("mouseEvent", target, new Class[]{processing.event.MouseEvent.class});
1454+
break;
1455+
case "keyEvent":
1456+
registerWithArgs("keyEvent", target, new Class[]{processing.event.KeyEvent.class});
1457+
break;
1458+
case "touchEvent":
1459+
registerWithArgs("touchEvent", target, new Class[]{processing.event.TouchEvent.class});
1460+
break;
1461+
default:
1462+
registerNoArgs(methodName, target);
1463+
break;
14651464
}
14661465
}
14671466

0 commit comments

Comments
 (0)