X copying files from 'data' dir is not recursive.. fixed

X move structure of app/application dirs around a bit
X make a new 'dist' function for building
X save window position (only during session) of sketch run window
X shouldn't substitute f's for: "Univers76.vlw.gz";
X   need lots of testing--this changes lots of things
X fixed commentsCodec which was mangling things
o present mode doesn't work for draw()
X   tested, seems to be fine?
X console - convert tabs to spaces
o   line wrapping (but save info for resize? noo..)
X fix to line numbers being off for KjcEngine exception highlights
X changed error color slightly for console to fit status error
X size() not being called in setup is gonna cause lots of headaches
X   hack: put exception handler around setup and re-call if necessary
X linefeeds were wrong in BApplet
This commit is contained in:
benfry
2002-07-28 03:46:25 +00:00
parent 36ab099a19
commit c91f655e78
6 changed files with 121 additions and 115 deletions

View File

@@ -43,7 +43,10 @@ public class PdeEditor extends Panel {
//String lastFile;
//PdeRunner runner;
KjcEngine engine;
//KjcEngine engine;
PdeEngine engine;
Point appletLocation; //= new Point(0, 0);
Point presentLocation; // = new Point(0, 0);
Frame frame;
Window presentationWindow;
@@ -186,19 +189,20 @@ public class PdeEditor extends Panel {
try {
String program = textarea.getText();
if (program.length() != 0) {
String buildPath = "lib" + File.separator + "build"; // TEMPORARY
File buildDir = new File(buildPath);
if (!buildDir.exists()) buildDir.mkdirs();
//if (program.length() != 0) {
String buildPath = "lib" + File.separator + "build"; // TEMPORARY
File buildDir = new File(buildPath);
if (!buildDir.exists()) buildDir.mkdirs();
String dataPath =
sketchFile.getParent() + File.separator + "data";
//editor.sketchFile.getParent() + File.separator + "data";
String dataPath =
sketchFile.getParent() + File.separator + "data";
//editor.sketchFile.getParent() + File.separator + "data";
engine = new KjcEngine(this, program, buildPath, dataPath);
engine.start();
//System.out.println("done iwth engine.start()");
}
engine = new KjcEngine(this, program, buildPath, dataPath);
//engine.start();
engine.start(presenting ? presentLocation : appletLocation);
//System.out.println("done iwth engine.start()");
//}
} catch (PdeException e) {
//state = RUNNER_ERROR;
@@ -297,7 +301,7 @@ public class PdeEditor extends Panel {
//if (frame != null) frame.toFront();
try {
//((KjcEngine)(runner.engine)).window.toFront();
engine.front();
engine.window.toFront();
} catch (Exception ex) { }
}
}
@@ -320,7 +324,7 @@ public class PdeEditor extends Panel {
try {
//((KjcEngine)(runner.engine)).window.toFront();
engine.front();
engine.window.toFront();
} catch (Exception e) {
// rather than writing code to check all the posible
@@ -380,6 +384,20 @@ public class PdeEditor extends Panel {
// may just roll this in with the other code
// -> keep this around for closing the external window
public void doClose() {
// grab window position
if (engine != null) {
if ((presentationWindow == null) ||
(!presentationWindow.isVisible())) {
appletLocation = engine.window.getLocation();
}
// prone to bugs and doesn't work yet
// if ((presentationWindow != null) &&
// (presentationWindow.isVisible())) {
// presentLocation = engine.window.getLocation();
// }
}
if (running) {
//System.out.println("was running, will call doStop()");
doStop();
@@ -610,6 +628,9 @@ public class PdeEditor extends Panel {
//header.setProject(file.getName(), projectDir);
header.reset();
presentLocation = null;
appletLocation = null;
} catch (FileNotFoundException e1) {
e1.printStackTrace();