Processing Setup on Eclipse
- Create new Java project
- Right click on project name in the package explorer
- Select Build Path...Configure Build Path
- Select Java Build Path from left-hand menu of dialog box
- Select the Libraries tab
- Select Add External Jar
- Navigate to /Applications/Processing.app/Contents/Resources/Java
... this didn't seem to work
so I just modified the .classpath file directly:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/Applications/Processing 0155.app/Contents/Resources/Java/antlr.jar"/>
<classpathentry kind="lib" path="/Applications/Processing 0155.app/Contents/Resources/Java/core.jar"/>
<classpathentry kind="lib" path="/Applications/Processing 0155.app/Contents/Resources/Java/ecj.jar"/>
<classpathentry kind="lib" path="/Applications/Processing 0155.app/Contents/Resources/Java/jna.jar"/>
<classpathentry kind="lib" path="/Applications/Processing 0155.app/Contents/Resources/Java/pde.jar"/>
<classpathentry kind="lib" path="/Applications/Processing 0155.app/Contents/Resources/Java/quaqua.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Patches
Can't seem to create colors, so I use int[] of rgb.
private final static int[] background = new int[] { 255, 204, 0 };
and then, instead of using background and fill directly I have a slight indirection
void set_background(int[] rgb) { background(rgb[0], rgb[1], rgb[2]); } void set_fill(int[] rgb) { fill(rgb[0], rgb[1], rgb[2]); } void set_stroke(int[] rgb) { stroke(rgb[0], rgb[1], rgb[2]); }
replace int(5.0 * 2.3) with (int)(5.0 * 2.3)