more bug fixing

This commit is contained in:
benfry
2011-01-26 19:01:31 +00:00
parent 54bf1c34a0
commit 9da9c94b18
6 changed files with 22 additions and 20 deletions

View File

@@ -423,6 +423,7 @@ public abstract class EditorToolbar extends JComponent implements MouseInputList
// currentRollover = -1;
if (rollover != null) {
rollover.setState(INACTIVE, true);
rollover = null;
}
}
@@ -446,7 +447,8 @@ public abstract class EditorToolbar extends JComponent implements MouseInputList
// handlePressed(sel);
// }
if (rollover != null) {
handlePressed(rollover);
//handlePressed(rollover);
handlePressed(e, buttons.indexOf(rollover));
}
}
@@ -457,14 +459,12 @@ public abstract class EditorToolbar extends JComponent implements MouseInputList
public void mouseReleased(MouseEvent e) { }
public void handlePressed(Button b) {
handlePressed(buttons.indexOf(b));
}
// public void handlePressed(Button b) {
// handlePressed(buttons.indexOf(b));
// }
public void handlePressed(int index) {
// override me!
}
abstract public void handlePressed(MouseEvent e, int index);
/**

View File

@@ -245,6 +245,7 @@ public abstract class Mode {
// categoryItem.setEnabled(false);
// menu.add(categoryItem);
base.addSketches(menu, sub, false);
menu.addSeparator();
}
// get library examples
@@ -267,6 +268,7 @@ public abstract class Mode {
}
}
if (any) {
menu.addSeparator();
Base.addDisabledItem(menu, "Contributed");
for (Library lib : contribLibraries) {
if (lib.hasExamples()) {

View File

@@ -47,7 +47,6 @@ public class JavaBuild {
public static final String PACKAGE_REGEX =
"(?:^|\\s|;)package\\s+(\\S+)\\;";
// Editor editor;
protected Sketch sketch;
// what happens in the build, stays in the build.
@@ -137,11 +136,7 @@ public class JavaBuild {
* @throws RunnerException
*/
public String build() throws SketchException {
srcFolder = sketch.makeTempFolder();
binFolder = sketch.makeTempFolder();
// System.out.println("src: " + srcFolder);
// System.out.println("bin: " + binFolder);
return build(srcFolder, binFolder);
return build(sketch.makeTempFolder(), sketch.makeTempFolder());
}
@@ -155,6 +150,12 @@ public class JavaBuild {
* @return null if compilation failed, main class name if not
*/
public String build(File srcFolder, File binFolder) throws SketchException {
this.srcFolder = srcFolder;
this.binFolder = binFolder;
Base.openFolder(srcFolder);
Base.openFolder(binFolder);
// run the preprocessor
String classNameFound = preprocess(srcFolder);
@@ -215,7 +216,7 @@ public class JavaBuild {
sketch.ensureExistence();
// System.out.println("srcFolder is " + srcFolder);
classPath = srcFolder.getAbsolutePath();
classPath = binFolder.getAbsolutePath();
// figure out the contents of the code folder to see if there
// are files that need to be added to the imports

View File

@@ -164,7 +164,6 @@ public class JavaMode extends Mode {
/**
* Implements Sketch → Run.
* @param present Set true to run in full screen (present mode).
* @throws SketchException
*/
public void handleRun(Sketch sketch, RunnerListener listener) throws SketchException {

View File

@@ -67,12 +67,12 @@ public class JavaToolbar extends EditorToolbar {
static public String getTitle(int index, boolean shift) {
switch (index) {
case RUN: return shift ? "Run" : "Present";
case RUN: return !shift ? "Run" : "Present";
case STOP: return "Stop";
case NEW: return shift ? "New" : "New Editor Window";
case OPEN: return shift ? "Open" : "Open in Another Window";
case NEW: return !shift ? "New" : "New Editor Window";
case OPEN: return !shift ? "Open" : "Open in Another Window";
case SAVE: return "Save";
case EXPORT: return shift ? "Export Applet" : "Export Application";
case EXPORT: return !shift ? "Export Applet" : "Export Application";
}
return null;
}

View File

@@ -180,7 +180,7 @@ public class Runner implements MessageConsumer {
String outgoing[] = new String[params.size()];
params.toArray(outgoing);
//PApplet.println(outgoing);
// PApplet.println(outgoing);
// PApplet.println(PApplet.split(outgoing[0], ":"));
// PApplet.println();
// PApplet.println("class path");