more package mania.. preproc now inserts "public" in front of void setup

This commit is contained in:
benfry
2004-07-08 21:03:06 +00:00
parent 0e432f30b5
commit d6c476c806
13 changed files with 166 additions and 167 deletions
+7 -7
View File
@@ -40,12 +40,12 @@ import javax.swing.undo.*;
/*
need to bring all the prefs into here
PdeEditor with its sketch.properties
and PdeBase with pde.properties
and PdeBase with preferences.txt
on first run:
processing.properties is created in user.home
it contains the contents of
pde.properties + pde_platform.properties
preferences.txt + pde_platform.properties
and then begins writing additional sketch.properties stuff
this class no longer uses the Properties class, since
@@ -111,7 +111,7 @@ public class PdePreferences extends JComponent {
// important was deleted from the user prefs
try {
load(PdeBase.getStream("pde.properties"));
load(PdeBase.getStream("preferences.txt"));
} catch (Exception e) {
PdeBase.showError(null, "Could not read default settings.\n" +
@@ -282,7 +282,7 @@ public class PdePreferences extends JComponent {
"More preferences can be edited directly\n" +
"in the file " + preferencesFile.getAbsolutePath();
//"More preferences are in the 'lib' folder inside text files\n" +
//"named pde.properties and pde_" +
//"named preferences.txt and pde_" +
//PdeBase.platforms[PdeBase.platform] + ".properties";
JTextArea textarea = new JTextArea(blather);
@@ -452,7 +452,7 @@ public class PdePreferences extends JComponent {
if ((PdeBase.platform == PdeBase.MACOSX) ||
(PdeBase.platform == PdeBase.MACOS9)) {
output = new FileOutputStream("lib/pde.properties");
output = new FileOutputStream("lib/preferences.txt");
} else { // win95/98/ME doesn't set cwd properly
URL url = getClass().getResource("buttons.gif");
@@ -496,7 +496,7 @@ public class PdePreferences extends JComponent {
// save() is deprecated, and didn't properly
// throw exceptions when it wasn't working
skprops.store(output, "Settings for processing. " +
"See lib/pde.properties for defaults.");
"See lib/preferences.txt for defaults.");
// need to close the stream.. didn't do this before
skprops.close();
@@ -512,7 +512,7 @@ public class PdePreferences extends JComponent {
// .................................................................
// all the information from pde.properties
// all the information from preferences.txt
//static public String get(String attribute) {
//return get(attribute, null);
+2 -1
View File
@@ -231,6 +231,7 @@ public class PdePreprocessor {
*/
void writeHeader(PrintStream out, String imports[],
String className) {
//out.print("package pootime;");
// emit emports that are needed for classes from the code folder
if (imports != null) {
@@ -247,7 +248,7 @@ public class PdePreprocessor {
if (jdkVersionStr.equals("1.3")) { jdkVersion = JDK13; };
if (jdkVersionStr.equals("1.4")) { jdkVersion = JDK14; };
for (int i = 0; i < jdkVersion; i++) {
for (int i = 0; i <= jdkVersion; i++) {
for (int j = 0; j < defaultImports[i].length; j++) {
out.print("import " + defaultImports[i][j] + ".*; ");
}
+2 -2
View File
@@ -92,7 +92,7 @@ public class PdeRuntime implements PdeMessageConsumer {
"-Djava.library.path=" + sketch.libraryPath, // might be ""
"-cp",
sketch.classPath,
"PApplet",
"processing.core.PApplet",
PApplet.EXTERNAL_FLAG + location,
sketch.mainClassName
};
@@ -143,7 +143,6 @@ public class PdeRuntime implements PdeMessageConsumer {
//System.out.println("draw mode");
while ((applet.frame != 1) && (!applet.finished)) {
try {
//System.out.println("waiting to complete drawing");
Thread.sleep(100);
} catch (InterruptedException e) { }
}
@@ -336,6 +335,7 @@ public class PdeRuntime implements PdeMessageConsumer {
public void message(String s) {
//System.err.println("M" + s.length() + ":" + s);
// this is PApplet sending a message (via System.out.println)
// that signals that the applet has been quit.
if (s.indexOf(PApplet.EXTERNAL_QUIT) == 0) {
+4
View File
@@ -1354,11 +1354,15 @@ public class PdeSketch {
}
// add the appropriate bagel to the classpath
/*
String jdkVersion = PdePreferences.get("compiler.jdk_version");
String bagelJar = "lib/export11.jar"; // default
if (jdkVersion.equals("1.3") || jdkVersion.equals("1.4")) {
bagelJar = "lib/export13.jar";
}
*/
String bagelJar = "lib/core.jar";
//if (jdkVersionStr.equals("1.3")) { bagelJar = "export13.jar" };
//if (jdkVersionStr.equals("1.4")) { bagelJar = "export14.jar" };
packClassPathIntoZipFile(bagelJar, zos);