random fixes heading towards rev 9

This commit is contained in:
benfry
2001-09-28 21:20:44 +00:00
parent b9da77e0ad
commit 6cf86efa55
4 changed files with 53 additions and 95 deletions
-68
View File
@@ -61,74 +61,6 @@ implements ActionListener
frame.add("Center", this);
init();
/*
// check for updates from the server, if enabled
if (getBoolean("update.enabled", false)) {
// open the update file to get the latest version
long lastUpdate = 0;
try {
DataInputStream dis = new DataInputStream(new FileInputStream("lib/version"));
lastUpdate = dis.readLong();
} catch (IOException e) { }
String baseUrl = get("update.url");
try {
URL url = new URL(baseUrl + "version");
URLConnection conn = url.openConnection();
//conn.connect();
//System.out.println("date of last update" + conn.getDate());
long newDate = conn.getDate();
if (newDate > lastUpdate) {
System.out.println("new update available");
DataOutputStream vos =
new DataOutputStream(new FileOutputStream("lib/version.update"));
vos.writeLong(newDate);
vos.flush();
vos.close();
url = new URL(baseUrl + "pde.jar");
conn = url.openConnection();
// move the old pde.jar file out of the way
//File pdeJar = new File("lib/pde.jar");
//pdeJar.renameTo("lib/pde.old.jar");
// download the new pde.jar file
FileOutputStream os = new FileOutputStream("lib/pde.jar.update");
//Object object = conn.getContent();
//System.out.println(object);
InputStream is = conn.getInputStream();
copyStream(is, os);
os.close();
// if everything copied ok, rename new/old files
// this probably needs to be way more bulletproof
File file = new File("lib/version");
if (file.exists()) file.renameTo(new File("lib/version.old"));
file = new File("lib/version.update");
file.renameTo(new File("lib/version"));
file = new File("lib/pde.jar");
file.renameTo(new File("lib/pde.jar.old"));
file = new File("lib/pde.jar.update");
file.renameTo(new File("lib/pde.jar"));
// restart or relaunch
System.out.println("done copying new version, restart");
System.exit(0);
}
} catch (IOException e1) {
e1.printStackTrace();
//} catch (MalformedURLException e2) {
//e2.printStackTrace();
}
}
*/
Insets insets = frame.getInsets();
Toolkit tk = Toolkit.getDefaultToolkit();
Dimension screen = tk.getScreenSize();
+5
View File
@@ -753,6 +753,11 @@ public class PdeEditor extends Panel implements PdeEnvironment {
// unless there's a method in AppletContext
if (frame != null) frame.toFront();
try {
//System.out.println("my parent is " + getParent());
((PdeApplication)getParent()).frame.toFront();
} catch (Exception e) { }
try {
((KjcEngine)(runner.engine)).window.toFront();
} catch (Exception e) {
+7 -7
View File
@@ -78,13 +78,13 @@ public class PdeRunner implements Runnable {
#endif
*/
} else if (program.indexOf("extends ProcessingApplet") != -1) {
#ifdef JAVAC
engine = new JavacEngine(program, graphics);
engine.start();
#else
throw new Exception("javac support not included");
#endif
// } else if (program.indexOf("extends ProcessingApplet") != -1) {
//#ifdef JAVAC
// engine = new JavacEngine(program, graphics);
// engine.start();
//#else
// throw new Exception("javac support not included");
//#endif
} else if (program.indexOf("// dbn") == 0) {
#ifdef DBN