From b1eb42b2abe7740a6ceaae8da752abb8f79aedec Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 9 Apr 2005 01:22:53 +0000 Subject: [PATCH] proper packaging of all processing.app classes --- processing/app/PdeBase.java | 4 +- processing/app/PdeClassLoader.java | 2 + processing/app/PdeCode.java | 12 ++--- processing/app/PdeCompiler.java | 2 + processing/app/PdeEditor.java | 23 ++++++---- processing/app/PdeEditorButtons.java | 2 + processing/app/PdeEditorConsole.java | 2 + processing/app/PdeEditorFind.java | 2 + processing/app/PdeEditorHeader.java | 2 + processing/app/PdeEditorLineStatus.java | 4 ++ processing/app/PdeEditorStatus.java | 2 + processing/app/PdeException.java | 9 ++-- processing/app/PdeMessageConsumer.java | 6 ++- processing/app/PdeMessageSiphon.java | 2 + processing/app/PdeMessageStream.java | 14 +++--- processing/app/PdePreferences.java | 4 ++ processing/app/PdeRuntime.java | 2 + processing/app/PdeSketch.java | 37 ++++++---------- processing/app/PdeSketchbook.java | 2 + processing/app/PresentMode.java | 1 + processing/app/SwingWorker.java | 34 +++++++------- processing/app/tools/Archiver.java | 59 +++++++++++++------------ processing/build/linux/make.sh | 7 ++- processing/build/macosx/dist.sh | 8 +++- processing/build/macosx/make.sh | 19 ++++++-- processing/build/macosx/run.sh | 2 +- processing/build/windows/make.sh | 7 ++- processing/core/PMethods.java | 26 +++-------- processing/todo.txt | 5 +++ 29 files changed, 179 insertions(+), 122 deletions(-) diff --git a/processing/app/PdeBase.java b/processing/app/PdeBase.java index da8cb468f..82a3621d4 100644 --- a/processing/app/PdeBase.java +++ b/processing/app/PdeBase.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import java.io.*; @@ -47,7 +49,7 @@ import processing.core.*; * files and images, etc) that comes from that. */ public class PdeBase { - static final String VERSION = "0082 Alpha"; + static final String VERSION = "0083 Alpha"; /** * Path of filename opened on the command line, diff --git a/processing/app/PdeClassLoader.java b/processing/app/PdeClassLoader.java index dc6ab6f81..5cf9025b3 100755 --- a/processing/app/PdeClassLoader.java +++ b/processing/app/PdeClassLoader.java @@ -17,6 +17,8 @@ * OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. */ +package processing.app; + import java.io.*; import java.net.*; import java.util.*; diff --git a/processing/app/PdeCode.java b/processing/app/PdeCode.java index b407776a2..06777f0b3 100644 --- a/processing/app/PdeCode.java +++ b/processing/app/PdeCode.java @@ -17,11 +17,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.io.*; @@ -31,7 +33,7 @@ public class PdeCode { int flavor; String program; - boolean modified; + public boolean modified; //PdeHistory history; // TODO add history information String preprocName; // name of .java file after preproc @@ -57,8 +59,8 @@ public class PdeCode { //program = null; /* } catch (IOException e) { - PdeBase.showWarning("Error loading file", - "Error while opening the file\n" + + PdeBase.showWarning("Error loading file", + "Error while opening the file\n" + file.getPath(), e); program = null; // just in case */ diff --git a/processing/app/PdeCompiler.java b/processing/app/PdeCompiler.java index 528f5df05..06cdd1664 100644 --- a/processing/app/PdeCompiler.java +++ b/processing/app/PdeCompiler.java @@ -23,6 +23,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import processing.core.*; import java.io.*; diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index 6ca765ed0..71b946de2 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -22,6 +22,11 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + +import processing.app.syntax.*; +import processing.app.tools.*; + import java.awt.*; import java.awt.event.*; import java.io.*; @@ -53,7 +58,7 @@ public class PdeEditor extends JFrame // otherwise, if the window is resized with the message label // set to blank, it's preferredSize() will be fukered - static final String EMPTY = + static public final String EMPTY = " " + " " + " "; @@ -345,14 +350,14 @@ public class PdeEditor extends JFrame // disable line highlight and turn off the caret when disabling Color color = PdePreferences.getColor("editor.external.bgcolor"); painter.setBackground(color); - painter.lineHighlight = false; + painter.setLineHighlightEnabled(false); textarea.setCaretVisible(false); } else { Color color = PdePreferences.getColor("editor.bgcolor"); painter.setBackground(color); - painter.lineHighlight = - PdePreferences.getBoolean("editor.linehighlight"); + boolean highlight = PdePreferences.getBoolean("editor.linehighlight"); + painter.setLineHighlightEnabled(highlight); textarea.setCaretVisible(true); } @@ -585,7 +590,8 @@ public class PdeEditor extends JFrame item = new JMenuItem("Create Font..."); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - new PdeFontBuilder().show(sketch.dataFolder); + //new CreateFont().show(sketch.dataFolder); + new CreateFont(PdeEditor.this).show(); } }); menu.add(item); @@ -593,9 +599,10 @@ public class PdeEditor extends JFrame item = new JMenuItem("Archive Sketch"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - Archiver archiver = new Archiver(); - archiver.setup(PdeEditor.this); - archiver.show(); + new Archiver(PdeEditor.this).show(); + //Archiver archiver = new Archiver(); + //archiver.setup(PdeEditor.this); + //archiver.show(); } }); menu.add(item); diff --git a/processing/app/PdeEditorButtons.java b/processing/app/PdeEditorButtons.java index e80c2bfa8..c04c75ebb 100644 --- a/processing/app/PdeEditorButtons.java +++ b/processing/app/PdeEditorButtons.java @@ -24,6 +24,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import java.awt.font.*; diff --git a/processing/app/PdeEditorConsole.java b/processing/app/PdeEditorConsole.java index 1935fcb1b..49ccd5e9c 100644 --- a/processing/app/PdeEditorConsole.java +++ b/processing/app/PdeEditorConsole.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import java.io.*; diff --git a/processing/app/PdeEditorFind.java b/processing/app/PdeEditorFind.java index edefcda8e..5e6ec9943 100644 --- a/processing/app/PdeEditorFind.java +++ b/processing/app/PdeEditorFind.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import javax.swing.*; diff --git a/processing/app/PdeEditorHeader.java b/processing/app/PdeEditorHeader.java index 479877334..fb3755e89 100644 --- a/processing/app/PdeEditorHeader.java +++ b/processing/app/PdeEditorHeader.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import java.io.*; diff --git a/processing/app/PdeEditorLineStatus.java b/processing/app/PdeEditorLineStatus.java index edd124cf5..09f65b8b6 100644 --- a/processing/app/PdeEditorLineStatus.java +++ b/processing/app/PdeEditorLineStatus.java @@ -21,6 +21,10 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + +import processing.app.syntax.*; + import java.awt.*; import java.awt.event.*; diff --git a/processing/app/PdeEditorStatus.java b/processing/app/PdeEditorStatus.java index f5f2ae39c..d0ab6a5cc 100644 --- a/processing/app/PdeEditorStatus.java +++ b/processing/app/PdeEditorStatus.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import javax.swing.*; diff --git a/processing/app/PdeException.java b/processing/app/PdeException.java index de741b37e..befaea525 100644 --- a/processing/app/PdeException.java +++ b/processing/app/PdeException.java @@ -17,11 +17,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; public class PdeException extends Exception { public int file = -1; @@ -55,10 +56,10 @@ public class PdeException extends Exception { /** - * Nix the java.lang crap out of an exception message + * Nix the java.lang crap out of an exception message * because it scares the children. * - * This function must be static to be used with super() + * This function must be static to be used with super() * in each of the constructors above. */ static public final String massage(String msg) { diff --git a/processing/app/PdeMessageConsumer.java b/processing/app/PdeMessageConsumer.java index 5ed25ad46..40d9c21a3 100644 --- a/processing/app/PdeMessageConsumer.java +++ b/processing/app/PdeMessageConsumer.java @@ -17,11 +17,13 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + // Different instances of PdeMessageStream need to do different things with // messages. In particular, a stream instance used for parsing output from // the compiler compiler has to interpret its messages differently than one diff --git a/processing/app/PdeMessageSiphon.java b/processing/app/PdeMessageSiphon.java index b2860b34e..1a70483f3 100644 --- a/processing/app/PdeMessageSiphon.java +++ b/processing/app/PdeMessageSiphon.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.io.*; diff --git a/processing/app/PdeMessageStream.java b/processing/app/PdeMessageStream.java index a38947224..413700a2c 100644 --- a/processing/app/PdeMessageStream.java +++ b/processing/app/PdeMessageStream.java @@ -17,19 +17,21 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.io.*; -/** - * this is used by PdeEditor, System.err is set to +/** + * this is used by PdeEditor, System.err is set to * new PrintStream(new PdeMessageStream()) * - * it's also used by PdeCompiler + * it's also used by PdeCompiler */ class PdeMessageStream extends OutputStream { @@ -50,7 +52,7 @@ class PdeMessageStream extends OutputStream { public void flush() { } - public void write(byte b[]) { + public void write(byte b[]) { // this never seems to get called System.out.println("leech1: " + new String(b)); } diff --git a/processing/app/PdePreferences.java b/processing/app/PdePreferences.java index abaab63e2..5fb636d9a 100644 --- a/processing/app/PdePreferences.java +++ b/processing/app/PdePreferences.java @@ -22,6 +22,10 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + +import processing.app.syntax.*; + import java.awt.*; import java.awt.event.*; import java.io.*; diff --git a/processing/app/PdeRuntime.java b/processing/app/PdeRuntime.java index 4f5cb8d7b..470da9b95 100644 --- a/processing/app/PdeRuntime.java +++ b/processing/app/PdeRuntime.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import processing.core.*; import java.awt.*; diff --git a/processing/app/PdeSketch.java b/processing/app/PdeSketch.java index 5eec9604e..3c408488b 100644 --- a/processing/app/PdeSketch.java +++ b/processing/app/PdeSketch.java @@ -22,6 +22,9 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + +import processing.app.preproc.*; import processing.core.*; import java.awt.FileDialog; @@ -54,13 +57,13 @@ public class PdeSketch { boolean library; // true if it's a library public File folder; //sketchFolder; - File dataFolder; - File codeFolder; + public File dataFolder; + public File codeFolder; static final int PDE = 0; static final int JAVA = 1; - PdeCode current; + public PdeCode current; int codeCount; PdeCode code[]; @@ -1462,7 +1465,6 @@ public class PdeSketch { int wide = PApplet.DEFAULT_WIDTH; int high = PApplet.DEFAULT_HEIGHT; - //try { PatternMatcher matcher = new Perl5Matcher(); PatternCompiler compiler = new Perl5Compiler(); @@ -1471,8 +1473,10 @@ public class PdeSketch { // this way, no warning is shown if size() isn't actually // used in the applet, which is the case especially for // beginners that are cutting/pasting from the reference. + // modified for 83 to match size(XXX, ddd String sizing = - "[\\s\\;]size\\s*\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\);"; + "[\\s\\;]size\\s*\\(\\s*(\\S+)\\s*,\\s*(\\d+)"; + //"[\\s\\;]size\\s*\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\);"; Pattern pattern = compiler.compile(sizing); // adds a space at the beginning, in case size() is the very @@ -1498,25 +1502,10 @@ public class PdeSketch { } } // else no size() command found - /* - // try to get / ** blah * / stuff - // the plus gets / ***** and **** / if that's what they used - matcher = new Perl5Matcher(); - compiler = new Perl5Compiler(); - String description = ""; - //pattern = compiler.compile("\\/\\*\\*+(.*)\\*\\/"); - pattern = compiler.compile("\\/\\*\\*+(.+)"); - //pattern = compiler.compile("\\/\\*\\*+(.*)\\*+\\/"); - System.out.println("this compiled"); - input = new PatternMatcherInput(" " + code[0].program); - if (matcher.contains(input, pattern)) { - MatchResult result = matcher.getMatch(); - System.out.println("contains " + result.group(0)); - String stuff = result.group(1).toString(); - String lines[] = PApplet.split(stuff, '\n'); - PApplet.printarr(lines); - } - */ + // originally tried to grab this with a regexp matcher, + // but it wouldn't span over multiple lines for the match. + // this could prolly be forced, but since that's the case + // better just to parse by hand. StringBuffer dbuffer = new StringBuffer(); String lines[] = PApplet.split(code[0].program, '\n'); for (int i = 0; i < lines.length; i++) { diff --git a/processing/app/PdeSketchbook.java b/processing/app/PdeSketchbook.java index 838c208ed..041e386d8 100644 --- a/processing/app/PdeSketchbook.java +++ b/processing/app/PdeSketchbook.java @@ -22,6 +22,8 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; + import java.awt.*; import java.awt.event.*; import java.io.*; diff --git a/processing/app/PresentMode.java b/processing/app/PresentMode.java index dc4098d66..3186e3ace 100644 --- a/processing/app/PresentMode.java +++ b/processing/app/PresentMode.java @@ -21,6 +21,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +package processing.app; import java.awt.*; import java.awt.event.*; diff --git a/processing/app/SwingWorker.java b/processing/app/SwingWorker.java index 1b2c46464..feffc9fb4 100644 --- a/processing/app/SwingWorker.java +++ b/processing/app/SwingWorker.java @@ -1,3 +1,5 @@ +package processing.app; + import javax.swing.SwingUtilities; /** @@ -5,7 +7,7 @@ import javax.swing.SwingUtilities; * SwingWorker 3), an abstract class that you subclass to * perform GUI-related work in a dedicated thread. For * instructions on and examples of using this class, see: - * + * * http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html * * Note that the API changed slightly in the 3rd version: @@ -15,7 +17,7 @@ import javax.swing.SwingUtilities; public abstract class SwingWorker { private Object value; // see getValue(), setValue() - /** + /** * Class to maintain reference to current worker thread * under separate synchronization control. */ @@ -28,23 +30,23 @@ public abstract class SwingWorker { private ThreadVar threadVar; - /** - * Get the value produced by the worker thread, or null if it + /** + * Get the value produced by the worker thread, or null if it * hasn't been constructed yet. */ - protected synchronized Object getValue() { - return value; + protected synchronized Object getValue() { + return value; } - /** - * Set the value produced by worker thread + /** + * Set the value produced by worker thread */ - private synchronized void setValue(Object x) { - value = x; + private synchronized void setValue(Object x) { + value = x; } - /** - * Compute the value to be returned by the get method. + /** + * Compute the value to be returned by the get method. */ public abstract Object construct(); @@ -68,14 +70,14 @@ public abstract class SwingWorker { } /** - * Return the value created by the construct method. + * Return the value created by the construct method. * Returns null if either the constructing thread or the current * thread was interrupted before a value was produced. - * + * * @return the value created by the construct method */ public Object get() { - while (true) { + while (true) { Thread t = threadVar.get(); if (t == null) { return getValue(); @@ -100,7 +102,7 @@ public abstract class SwingWorker { public void run() { finished(); } }; - Runnable doConstruct = new Runnable() { + Runnable doConstruct = new Runnable() { public void run() { try { setValue(construct()); diff --git a/processing/app/tools/Archiver.java b/processing/app/tools/Archiver.java index 46229ffbc..6e8a55ae5 100755 --- a/processing/app/tools/Archiver.java +++ b/processing/app/tools/Archiver.java @@ -4,8 +4,7 @@ Archiver - plugin tool for archiving sketches Part of the Processing project - http://processing.org - Except where noted, code is written by Ben Fry and - Copyright (c) 2001-04 Massachusetts Institute of Technology + Copyright (c) 2004-05 Ben Fry and Casey Reas This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,12 +16,14 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -//package processing.app.tools; // for 0071+ +package processing.app.tools; + +import processing.app.*; import java.io.*; import java.text.*; @@ -41,7 +42,7 @@ public class Archiver { SimpleDateFormat dateFormat; - public void setup(PdeEditor editor) { + public Archiver(PdeEditor editor) { this.editor = editor; numberFormat = NumberFormat.getInstance(); @@ -65,15 +66,15 @@ public class Archiver { int index = 0; do { if (useDate) { - String purty = dateFormat.format(new Date()); - String stamp = purty + ((char) ('a' + index)); - namely = name + "-" + stamp; - newbie = new File(parent, namely + ".zip"); + String purty = dateFormat.format(new Date()); + String stamp = purty + ((char) ('a' + index)); + namely = name + "-" + stamp; + newbie = new File(parent, namely + ".zip"); } else { - String diggie = numberFormat.format(index + 1); - namely = name + "-" + diggie; - newbie = new File(parent, namely + ".zip"); + String diggie = numberFormat.format(index + 1); + namely = name + "-" + diggie; + newbie = new File(parent, namely + ".zip"); } index++; } while (newbie.exists()); @@ -98,31 +99,31 @@ public class Archiver { } - public void buildZip(File dir, String sofar, - ZipOutputStream zos) throws IOException { + public void buildZip(File dir, String sofar, + ZipOutputStream zos) throws IOException { String files[] = dir.list(); for (int i = 0; i < files.length; i++) { - if (files[i].equals(".") || - files[i].equals("..")) continue; + if (files[i].equals(".") || + files[i].equals("..")) continue; File sub = new File(dir, files[i]); - String nowfar = (sofar == null) ? + String nowfar = (sofar == null) ? files[i] : (sofar + "/" + files[i]); if (sub.isDirectory()) { - // directories are empty entries and have / at the end - ZipEntry entry = new ZipEntry(nowfar + "/"); - //System.out.println(entry); - zos.putNextEntry(entry); - zos.closeEntry(); - buildZip(sub, nowfar, zos); + // directories are empty entries and have / at the end + ZipEntry entry = new ZipEntry(nowfar + "/"); + //System.out.println(entry); + zos.putNextEntry(entry); + zos.closeEntry(); + buildZip(sub, nowfar, zos); } else { - ZipEntry entry = new ZipEntry(nowfar); - entry.setTime(sub.lastModified()); - zos.putNextEntry(entry); - zos.write(PdeBase.grabFile(sub)); - zos.closeEntry(); + ZipEntry entry = new ZipEntry(nowfar); + entry.setTime(sub.lastModified()); + zos.putNextEntry(entry); + zos.write(PdeBase.grabFile(sub)); + zos.closeEntry(); } } } diff --git a/processing/build/linux/make.sh b/processing/build/linux/make.sh index 14db50480..154d2595c 100755 --- a/processing/build/linux/make.sh +++ b/processing/build/linux/make.sh @@ -11,6 +11,11 @@ else BUILD_PREPROC=true cp -r ../shared work + # needs to make the dir because of packaging goofiness + mkdir -p work/classes/processing/app/preproc + mkdir -p work/classes/processing/app/syntax + mkdir -p work/classes/processing/app/tools + cp -r ../../lib work/libraries cp -r ../../net work/libraries/ cp -r ../../opengl work/libraries/ @@ -97,7 +102,7 @@ cd app CLASSPATH="../build/linux/work/lib/core.jar:../build/linux/work/lib/mrj.jar:../build/linux/work/lib/antlr.jar:../build/linux/work/lib/oro.jar:../build/linux/work/lib/registry.jar:../build/linux/work/java/lib/rt.jar" -../build/linux/work/jikes -target 1.3 +D -classpath $CLASSPATH -d ../build/linux/work/classes *.java jeditsyntax/*.java preprocessor/*.java tools/*.java +../build/linux/work/jikes -target 1.3 +D -classpath $CLASSPATH:../build/linux/work/classes -d ../build/linux/work/classes *.java jeditsyntax/*.java preprocessor/*.java tools/*.java cd ../build/linux/work/classes rm -f ../lib/pde.jar diff --git a/processing/build/macosx/dist.sh b/processing/build/macosx/dist.sh index d09dfc99f..de8163d66 100755 --- a/processing/build/macosx/dist.sh +++ b/processing/build/macosx/dist.sh @@ -91,7 +91,13 @@ cp dist/jikes processing/ chmod a+x processing/jikes chmod a+x processing/Processing.app/Contents/MacOS/JavaApplicationStub - + +cd ../.. +javadoc -public -d doc app/*.java app/preproc/*.java app/syntax/*.java core/*.java opengl/*.java net/*.java video/*.java serial/*.java +cd build/macosx +pwd +exit + #cp dist/lib/pde_macosx.properties processing/lib/ # convert notes.txt to windows LFs diff --git a/processing/build/macosx/make.sh b/processing/build/macosx/make.sh index 3d3399963..3f7d56062 100755 --- a/processing/build/macosx/make.sh +++ b/processing/build/macosx/make.sh @@ -20,6 +20,11 @@ else cp -r ../shared work + # needs to make the dir because of packaging goofiness + mkdir -p work/classes/processing/app/preproc + mkdir -p work/classes/processing/app/syntax + mkdir -p work/classes/processing/app/tools + cp -r ../../lib work/libraries cp -r ../../net work/libraries/ cp -r ../../opengl work/libraries/ @@ -81,9 +86,11 @@ cd ../app ### -- BUILD PARSER --------------------------------------------- +#BUILD_PREPROC=true + if $BUILD_PREPROC then - cd preprocessor + cd preproc # build classes/grammar for preprocessor echo Building antlr grammar code... # first build the default java goop @@ -93,7 +100,6 @@ then cd .. fi - ### -- BUILD PDE ------------------------------------------------ echo Building the PDE... @@ -101,13 +107,20 @@ echo Building the PDE... # compile the code as java 1.3, so that the application will run and # show the user an error, rather than crapping out with some strange # "class not found" crap -../build/macosx/work/jikes -target 1.3 +D -classpath ../build/macosx/work/lib/core.jar:../build/macosx/work/lib/antlr.jar:../build/macosx/work/lib/oro.jar:../build/macosx/work/lib/registry.jar:$CLASSPATH -d ../build/macosx/work/classes *.java jeditsyntax/*.java preprocessor/*.java tools/*.java +#../build/macosx/work/jikes -target 1.3 +D -classpath ../build/macosx/work/classes:../build/macosx/work/lib/core.jar:../build/macosx/work/lib/antlr.jar:../build/macosx/work/lib/oro.jar:../build/macosx/work/lib/registry.jar:$CLASSPATH -d ../build/macosx/work/classes *.java syntax/*.java preproc/*.java tools/*.java +../build/macosx/work/jikes -target 1.3 +D -classpath ../build/macosx/work/classes:../build/macosx/work/lib/core.jar:../build/macosx/work/lib/antlr.jar:../build/macosx/work/lib/oro.jar:../build/macosx/work/lib/registry.jar:$CLASSPATH -d ../build/macosx/work/classes tools/*.java preproc/*.java syntax/*.java *.java cd ../build/macosx/work/classes rm -f ../lib/pde.jar zip -0rq ../lib/pde.jar . cd ../.. +# i fought the packages and the packages won +#cd ../.. +#WORKLIB=processing/build/macosx/work/lib +#./processing/build/macosx/work/jikes -d . -target 1.3 +D -classpath $WORKLIB/core.jar:$WORKLIB/antlr.jar:$WORKLIB/oro.jar:$WORKLIB/registry.jar:$CLASSPATH -d . processing/app/*.java processing/app/preproc/*.java processing/app/syntax/*.java processing/app/tools/*.java +#zip -rq $WORKLIB/pde.jar processing/app/*.class processing/app/preproc/*.class processing/app/syntax/*.class processing/app/tools/*.class + # get the libs mkdir -p work/Processing.app/Contents/Resources/Java/ cp work/lib/*.jar work/Processing.app/Contents/Resources/Java/ diff --git a/processing/build/macosx/run.sh b/processing/build/macosx/run.sh index 9f8b05e24..06a851db3 100755 --- a/processing/build/macosx/run.sh +++ b/processing/build/macosx/run.sh @@ -6,4 +6,4 @@ CLASSPATH=/System/Library/Java/Extensions/QTJava.zip:lib:lib/build:lib/pde.jar:l export CLASSPATH #cd work && /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Commands/java -Dcom.apple.macos.useScreenMenuBar=true PdeBase -cd work && java -Dapple.laf.useScreenMenuBar=true -Dapple.awt.showGrowBox=false PdeBase +cd work && java -Dapple.laf.useScreenMenuBar=true -Dapple.awt.showGrowBox=false processing.app.PdeBase diff --git a/processing/build/windows/make.sh b/processing/build/windows/make.sh index 9cd916652..90c6662bc 100755 --- a/processing/build/windows/make.sh +++ b/processing/build/windows/make.sh @@ -14,6 +14,11 @@ else rm -f work/.DS_Store # in case one of those little mac poopers show up + # needs to make the dir because of packaging goofiness + mkdir -p work/classes/processing/app/preproc + mkdir -p work/classes/processing/app/syntax + mkdir -p work/classes/processing/app/tools + cp -r ../../lib work/libraries cp -r ../../net work/libraries/ cp -r ../../opengl work/libraries/ @@ -132,7 +137,7 @@ CLASSPATH="..\\build\\windows\\work\\lib\\core.jar;..\\build\\windows\\work\\lib # compile the code as java 1.3, so that the application will run and # show the user an error, rather than crapping out with some strange # "class not found" crap -../build/windows/work/jikes -target 1.3 +D -classpath $CLASSPATH -d ..\\build\\windows\\work/classes *.java jeditsyntax/*.java preprocessor/*.java tools/*.java +../build/windows/work/jikes -target 1.3 +D -classpath "$CLASSPATH;..\\build\\windows\\work/classes" -d ..\\build\\windows\\work/classes *.java preproc/*.java syntax/*.java tools/*.java #/cygdrive/c/jdk-1.4.2_05/bin/javac.exe -classpath $CLASSPATH -d ..\\build\\windows\\work/classes *.java jeditsyntax/*.java preprocessor/*.java cd ../build/windows/work/classes diff --git a/processing/core/PMethods.java b/processing/core/PMethods.java index da707ecf8..cbeeae53e 100755 --- a/processing/core/PMethods.java +++ b/processing/core/PMethods.java @@ -1,3 +1,4 @@ +/* package processing.core; @@ -318,13 +319,13 @@ public interface PMethods { public void lightDiffuse(int num, float x, float y, float z); public void lightSpecular(int num, float x, float y, float z); - + public void lightDirection(int num, float x, float y, float z); public void lightFalloff(int num, float constant, float linear, float quadratic); - + public void lightSpotAngle(int num, float spotAngle); - + public void lightSpotConcentration(int num, float concentration); // @@ -488,22 +489,6 @@ public interface PMethods { // - /* - // WOULD LIKE TO THINK OF NICER NAMES FOR ALL THESE - - static public boolean saveHeaderTIFF(OutputStream output, - int width, int height); - - static public boolean saveTIFF(OutputStream output, int pixels[], - int width, int height); - - static public boolean saveHeaderTGA(OutputStream output, - int width, int height); - - static public boolean saveTGA(OutputStream output, int pixels[], - int width, int height); - */ - public void save(String filename); public void postSetup(); @@ -542,7 +527,7 @@ public interface PMethods { public void specular(float x, float y, float z, float a); public void shininess(float shine); - + public void emissive(int rgb); public void emissive(float gray); @@ -576,3 +561,4 @@ public interface PMethods { public int createSpotLight(float lr, float lg, float lb, float x, float y, float z, float nx, float ny, float nz, float angle); } +*/ \ No newline at end of file diff --git a/processing/todo.txt b/processing/todo.txt index cac261cc1..a286e36cc 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -1,5 +1,10 @@ 0083 pde +_ need to add classes dir to cp for jikes make (on win and linux) +_ how to get preproc to automatically prepend packages +_ only build preproc from preproc/make.sh? +_ and check in the preproc'd code to cvs? + _ npe is a runtimeex, so any npe in setup comes up weird _ maybe the renderer exception is something different? newrendex?