mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
random fixes heading towards rev 9
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user