more major work on megabucket, new package structure, etc

This commit is contained in:
benfry
2004-07-08 06:16:46 +00:00
parent 7a75430052
commit 9893b9078d
11 changed files with 118 additions and 85 deletions
+3 -1
View File
@@ -23,6 +23,8 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import processing.core.*;
import java.io.*;
import java.util.*;
import java.util.zip.*;
@@ -365,7 +367,7 @@ public class PdeCompiler implements PdeMessageConsumer {
static public String[] makeImportsFromClassPath(String path) {
Hashtable table = new Hashtable();
String pieces[] =
BApplet.split(path, File.pathSeparatorChar);
PApplet.split(path, File.pathSeparatorChar);
for (int i = 0; i < pieces.length; i++) {
//System.out.println("checking piece '" + pieces[i] + "'");
+4 -2
View File
@@ -25,6 +25,7 @@
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.reflect.*;
import java.net.*;
import java.util.*;
import java.util.zip.*;
@@ -242,8 +243,9 @@ implements MRJAboutHandler, MRJQuitHandler, MRJPrefsHandler
new Class[] { Boolean.TYPE });
undecoratedMethod.invoke(presentationWindow,
new Object[] { Boolean.TRUE });
} catch (NoSuchMethodError e) { }
} catch (Exception e) { }
//} catch (NoSuchMethodException e) { }
//} catch (NoSuchMethodError e) { }
presentationWindow.setBounds(0, 0, screen.width, screen.height);
}
+2 -1
View File
@@ -22,6 +22,7 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import processing.core.*;
import java.awt.*;
import java.awt.event.*;
@@ -368,7 +369,7 @@ public class PdeFontBuilder extends JFrame {
try {
font = new Font(list[selection], Font.PLAIN, fontsize);
BFont f = new BFont(font, smooth);
PFont2 f = new PFont2(font, smooth);
// make sure the 'data' folder exists
if (!targetFolder.exists()) targetFolder.mkdirs();
+6 -4
View File
@@ -25,6 +25,8 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import processing.core.*;
import java.io.*;
import antlr.*;
import antlr.collections.*;
@@ -57,11 +59,11 @@ public class PdePreprocessor {
*/
public PdePreprocessor() {
defaultImports[JDK11] =
BApplet.split(PdePreferences.get("compiler.imports.jdk11"), ',');
PApplet.split(PdePreferences.get("compiler.imports.jdk11"), ',');
defaultImports[JDK13] =
BApplet.split(PdePreferences.get("compiler.imports.jdk13"), ',');
PApplet.split(PdePreferences.get("compiler.imports.jdk13"), ',');
defaultImports[JDK14] =
BApplet.split(PdePreferences.get("compiler.imports.jdk14"), ',');
PApplet.split(PdePreferences.get("compiler.imports.jdk14"), ',');
}
@@ -253,7 +255,7 @@ public class PdePreprocessor {
if (programType < JAVA) {
// open the class definition
out.print("public class " + className + " extends BApplet {");
out.print("public class " + className + " extends PApplet {");
if (programType == STATIC) {
// now that size() and background() can go inside of draw()
+30 -26
View File
@@ -22,21 +22,23 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import processing.core.*;
import java.awt.*; // for window
import java.awt.event.*; // also for window
import java.io.*;
import java.lang.reflect.*;
#ifndef RXTX
import javax.comm.*;
#else
import gnu.io.*;
#endif
//#ifndef RXTX
//import javax.comm.*;
//#else
//import gnu.io.*;
//#endif
public class PdeRuntime implements PdeMessageConsumer {
BApplet applet;
PApplet applet;
PdeException exception;
Window window;
PrintStream leechErr;
@@ -77,11 +79,11 @@ public class PdeRuntime implements PdeMessageConsumer {
if (sketch.externalRuntime) {
// if there was a saved location (this guy has been run more than
// once) then windowLocation will be set to the last position of
// the sketch window. this will be passed to the BApplet runner
// the sketch window. this will be passed to the PApplet runner
// using something like --external=e30,20 where the e stands for
// exact. otherwise --external=x,y for just the regular positioning.
String location = (windowLocation != null) ?
(BApplet.EXTERNAL_EXACT_LOCATION +
(PApplet.EXTERNAL_EXACT_LOCATION +
windowLocation.x + "," + windowLocation.y) :
(x1 + "," + y1);
@@ -90,8 +92,8 @@ public class PdeRuntime implements PdeMessageConsumer {
"-Djava.library.path=" + sketch.libraryPath, // might be ""
"-cp",
sketch.classPath,
"BApplet",
BApplet.EXTERNAL_FLAG + location,
"PApplet",
PApplet.EXTERNAL_FLAG + location,
sketch.mainClassName
};
@@ -103,21 +105,23 @@ public class PdeRuntime implements PdeMessageConsumer {
} else {
//Class c = Class.forName(className);
Class c = Class.forName(sketch.mainClassName);
applet = (BApplet) c.newInstance();
applet = (PApplet) c.newInstance();
// replaces setRuntime with BApplet having leechErr [fry]
// replaces setRuntime with PApplet having leechErr [fry]
applet.leechErr = leechErr;
// has to be before init
//applet.serialProperties(PdePreferences.properties);
applet.init();
if (applet.exception != null) {
/*
TODO: fix me
if (applet.exception instanceof PortInUseException) {
throw new PdeException("Another program is already " +
"using the serial port.");
} else {
throw new PdeException(applet.exception.getMessage());
}
*/
throw new PdeException(applet.exception.getMessage());
}
applet.start();
@@ -208,8 +212,8 @@ public class PdeRuntime implements PdeMessageConsumer {
int appletWidth = applet.width;
int appletHeight = applet.height;
if ((appletWidth == 0) || (appletHeight == 0)) {
appletWidth = BApplet.DEFAULT_WIDTH;
appletWidth = BApplet.DEFAULT_HEIGHT;
appletWidth = PApplet.DEFAULT_WIDTH;
appletWidth = PApplet.DEFAULT_HEIGHT;
}
*/
@@ -273,7 +277,7 @@ public class PdeRuntime implements PdeMessageConsumer {
// mod by fry for removal of KjcEngine
applet.finished = true;
leechErr.println(BApplet.LEECH_WAKEUP);
leechErr.println(PApplet.LEECH_WAKEUP);
e.printStackTrace(this.leechErr);
}
}
@@ -332,16 +336,16 @@ public class PdeRuntime implements PdeMessageConsumer {
public void message(String s) {
// this is BApplet sending a message (via System.out.println)
// this is PApplet sending a message (via System.out.println)
// that signals that the applet has been quit.
if (s.indexOf(BApplet.EXTERNAL_QUIT) == 0) {
if (s.indexOf(PApplet.EXTERNAL_QUIT) == 0) {
editor.doClose();
return;
}
// this is the BApplet sending us a message that the applet
// this is the PApplet sending us a message that the applet
// is being moved to a new window location
if (s.indexOf(BApplet.EXTERNAL_MOVE) == 0) {
if (s.indexOf(PApplet.EXTERNAL_MOVE) == 0) {
String nums = s.substring(s.indexOf(' ') + 1);
int space = nums.indexOf(' ');
int left = Integer.parseInt(nums.substring(0, space));
@@ -354,9 +358,9 @@ public class PdeRuntime implements PdeMessageConsumer {
//System.err.println("message " + s.length() + ":" + s);
if (s.length() > 2) System.err.println(s);
// this is BApplet sending a message saying "i'm about to spew
// a stack trace because an error occurred during BApplet.run()"
if (s.indexOf(BApplet.LEECH_WAKEUP) == 0) {
// this is PApplet sending a message saying "i'm about to spew
// a stack trace because an error occurred during PApplet.run()"
if (s.indexOf(PApplet.LEECH_WAKEUP) == 0) {
// newMessage being set to 'true' means that the next time
// message() is called, expect the first line of the actual
// error message & stack trace to be sent from the applet.
@@ -387,8 +391,8 @@ public class PdeRuntime implements PdeMessageConsumer {
java.lang.NullPointerException
at javatest.<init>(javatest.java:5)
at Temporary_2425_1153.draw(Temporary_2425_1153.java:11)
at BApplet.nextFrame(BApplet.java:481)
at BApplet.run(BApplet.java:428)
at PApplet.nextFrame(PApplet.java:481)
at PApplet.run(PApplet.java:428)
at java.lang.Thread.run(Unknown Source)
*/
+5 -3
View File
@@ -22,6 +22,8 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
import processing.core.*;
import java.awt.FileDialog;
import java.io.*;
import java.util.*;
@@ -1221,8 +1223,8 @@ public class PdeSketch {
}
if (writeHtml) {
int wide = BApplet.DEFAULT_WIDTH;
int high = BApplet.DEFAULT_HEIGHT;
int wide = PApplet.DEFAULT_WIDTH;
int high = PApplet.DEFAULT_HEIGHT;
//try {
PatternMatcher matcher = new Perl5Matcher();
@@ -1447,7 +1449,7 @@ public class PdeSketch {
static public void packClassPathIntoZipFile(String path,
ZipOutputStream zos)
throws IOException {
String pieces[] = BApplet.split(path, File.pathSeparatorChar);
String pieces[] = PApplet.split(path, File.pathSeparatorChar);
for (int i = 0; i < pieces.length; i++) {
if (pieces[i].length() == 0) continue;