mirror of
https://github.com/processing/processing4.git
synced 2026-02-08 16:19:31 +01:00
properly delete .class files from applet folder, and error msg for
reference
This commit is contained in:
@@ -426,8 +426,17 @@ public class PdeBase extends Frame
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (editor.textarea.isSelectionActive()) {
|
||||
String text = editor.textarea.getSelectedText();
|
||||
String referenceFile = (String) keywords.get(text);
|
||||
showReference(referenceFile);
|
||||
if (text.length() == 0) {
|
||||
editor.message("First select a word to find in the reference.");
|
||||
|
||||
} else {
|
||||
String referenceFile = (String) keywords.get(text);
|
||||
if (referenceFile == null) {
|
||||
editor.message("No reference available for \"" + text + "\"");
|
||||
} else {
|
||||
showReference(referenceFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1225,70 +1225,18 @@ public class PdeEditor extends JPanel {
|
||||
// create the project directory
|
||||
// pass null for datapath because the files shouldn't be
|
||||
// copied to the build dir.. that's only for the temp stuff
|
||||
|
||||
//File projectDir = new File(appletDir, projectName);
|
||||
//projectDir.mkdirs();
|
||||
appletDir.mkdirs();
|
||||
|
||||
///
|
||||
|
||||
// build the sketch
|
||||
exportSketchName =
|
||||
build(program, exportSketchName, appletDir.getPath(), true);
|
||||
|
||||
// (already reported) error during export, exit this function
|
||||
if (exportSketchName == null) {
|
||||
buttons.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
// preprocess the program
|
||||
//
|
||||
PdePreprocessor preprocessor = null;
|
||||
if (PdeBase.getBoolean("preprocessor.antlr", true)) {
|
||||
preprocessor = new PdePreprocessor(program,
|
||||
appletDir.getPath());
|
||||
try {
|
||||
exportSketchName =
|
||||
preprocessor.writeJava(exportSketchName,
|
||||
base.normalItem.getState(),
|
||||
true);
|
||||
} catch (Exception ex) {
|
||||
// if there was an issue (including unrecoverable parse errors)
|
||||
// try falling back to the old preprocessor
|
||||
preprocessor =
|
||||
new PdePreprocessorOro(program, appletDir.getPath());
|
||||
exportSketchName =
|
||||
preprocessor.writeJava(exportSketchName,
|
||||
base.normalItem.getState(),
|
||||
true);
|
||||
}
|
||||
} else { // use old preproc
|
||||
preprocessor =
|
||||
new PdePreprocessorOro(program, appletDir.getPath());
|
||||
|
||||
exportSketchName =
|
||||
preprocessor.writeJava(exportSketchName,
|
||||
base.normalItem.getState(), true);
|
||||
}
|
||||
|
||||
PdeCompiler compiler =
|
||||
new PdeCompiler(appletDir.getPath(), exportSketchName, this);
|
||||
|
||||
// this will catch and parse errors during compilation
|
||||
messageStream = new PdeMessageStream(compiler);
|
||||
PrintStream leechErr = new PrintStream(messageStream);
|
||||
|
||||
if (!compiler.compileJava(leechErr)) {
|
||||
//throw new Exception("error while compiling, couldn't export");
|
||||
// message() will already have error message in this case
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
///
|
||||
|
||||
|
||||
int wide = BApplet.DEFAULT_WIDTH;
|
||||
int high = BApplet.DEFAULT_HEIGHT;
|
||||
|
||||
@@ -1461,9 +1409,18 @@ public class PdeEditor extends JPanel {
|
||||
zos.closeEntry();
|
||||
}
|
||||
}
|
||||
|
||||
// remove the .class files from the applet folder. if they're not
|
||||
// removed, the msjvm will complain about an illegal access error,
|
||||
// since the classes are outside the jar file.
|
||||
for (int i = 0; i < classfiles.length; i++) {
|
||||
if (classfiles[i].endsWith(".class")) {
|
||||
new File(appletDir, classfiles[i]).delete(); // not yet
|
||||
File deadguy = new File(appletDir, classfiles[i]);
|
||||
if (!deadguy.delete()) {
|
||||
System.err.println(classfiles[i] +
|
||||
" could not be deleted from the applet folder.");
|
||||
System.err.println("You'll need to remove it by hand.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1868,6 +1825,8 @@ public class PdeEditor extends JPanel {
|
||||
offset += bytesRead;
|
||||
if (bytesRead == 0) break;
|
||||
}
|
||||
input.close(); // weren't properly being closed
|
||||
input = null;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
15
todo.txt
15
todo.txt
@@ -13,16 +13,20 @@ X save("blah.tif") will save the current frame as blah.tif.
|
||||
X the syntax is either saveFrame() or saveFrame("blah-####.tif")
|
||||
X either no properties passed-in or a name INCL. the ####'s
|
||||
X save() is not color-coded as a proper P5-command!
|
||||
X IllegalAccessError when running examples with inner classes in msjvm
|
||||
X problem is that .class files are in both the applet folder and jar
|
||||
X need to remove them from the applet folder
|
||||
X weren't properly removed on windows b/c file was left open
|
||||
X if no reference found, provide message
|
||||
X watch out for people selecting the parens or part of the function
|
||||
|
||||
_ serious sluggishness with applets
|
||||
_ beginShape/endShape.. 3D scenes with boxes..
|
||||
|
||||
_ IllegalAccessError when running examples with inner classes in msjvm
|
||||
|
||||
_ if no reference found, provide message
|
||||
_ watch out for people selecting the parens or part of the function
|
||||
_ red of the console color is difficult to read
|
||||
|
||||
_ remove .DS_Store files from windows build (oops)
|
||||
|
||||
cr X some new examples to fix noBackground and setPixel problems
|
||||
cr X image/transparency is broken (removing noBackground() is fixing it...)
|
||||
cr X form/vertices_3d: background() is still within setup()
|
||||
@@ -80,6 +84,9 @@ bf b _ main sticking point will be serial/qtjava in exports
|
||||
|
||||
|
||||
LOWER (post beta tweaks, non-structural)
|
||||
_ error if you try to hit export twice on a sketch
|
||||
_ "C:/ProgramFiles/proce55ing/processing-0060/sketchbook/default/double_export_tesuble_export_test.java:1:625:7:2: Semantic Error: Unable to write file
|
||||
_ "C:/ProgramFiles/proce55ing/processing-0060/sketchbook/default/double_export_tesuble_export_test.class"."
|
||||
_ clean up PdeTokenMarker, probably just alphabetize
|
||||
_ remove .DS_Store boogers, especially from win/linux distributions
|
||||
_ NullPointerException when alt is pressed
|
||||
|
||||
Reference in New Issue
Block a user