mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 10:55:38 +01:00
using swingworker to fix the hanging bug (also in opengl)
This commit is contained in:
@@ -608,12 +608,12 @@ public class PdeBase {
|
||||
Image image = null;
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
|
||||
if ((PdeBase.platform == PdeBase.MACOSX) ||
|
||||
(PdeBase.platform == PdeBase.MACOS9)) {
|
||||
image = tk.getImage("lib/" + name);
|
||||
} else {
|
||||
image = tk.getImage(who.getClass().getResource(name));
|
||||
}
|
||||
//if ((PdeBase.platform == PdeBase.MACOSX) ||
|
||||
//(PdeBase.platform == PdeBase.MACOS9)) {
|
||||
image = tk.getImage("lib/" + name);
|
||||
//} else {
|
||||
//image = tk.getImage(who.getClass().getResource(name));
|
||||
//}
|
||||
|
||||
//image = tk.getImage("lib/" + name);
|
||||
//URL url = PdeApplet.class.getResource(name);
|
||||
@@ -629,20 +629,18 @@ public class PdeBase {
|
||||
}
|
||||
|
||||
|
||||
static public InputStream getStream(String filename)
|
||||
throws IOException {
|
||||
if ((PdeBase.platform == PdeBase.MACOSX) ||
|
||||
(PdeBase.platform == PdeBase.MACOS9)) {
|
||||
// macos doesn't seem to think that files in the lib folder
|
||||
// are part of the resources, unlike windows or linux.
|
||||
// actually, this is only the case when running as a .app,
|
||||
// since it works fine from run.sh, but not Processing.app
|
||||
return new FileInputStream("lib/" + filename);
|
||||
}
|
||||
static public InputStream getStream(String filename) throws IOException {
|
||||
//if (PdeBase.platform == PdeBase.MACOSX) {
|
||||
// macos doesn't seem to think that files in the lib folder
|
||||
// are part of the resources, unlike windows or linux.
|
||||
// actually, this is only the case when running as a .app,
|
||||
// since it works fine from run.sh, but not Processing.app
|
||||
return new FileInputStream("lib/" + filename);
|
||||
//}
|
||||
|
||||
// all other, more reasonable operating systems
|
||||
//return cls.getResource(filename).openStream();
|
||||
return PdeBase.class.getResource(filename).openStream();
|
||||
//return PdeBase.class.getResource(filename).openStream();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -123,6 +123,7 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
processInput = new SystemOutSiphon(process.getInputStream());
|
||||
processError = new PdeMessageSiphon(process.getErrorStream(), this);
|
||||
processOutput = process.getOutputStream();
|
||||
|
||||
//processOutput.write(' ');
|
||||
//processOutput.flush();
|
||||
|
||||
@@ -375,7 +376,7 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
// this is PApplet sending a message (via System.out.println)
|
||||
// that signals that the applet has been quit.
|
||||
if (s.indexOf(PApplet.EXTERNAL_QUIT) == 0) {
|
||||
System.out.println("external: quit");
|
||||
//System.out.println("external: quit");
|
||||
editor.doClose();
|
||||
return;
|
||||
}
|
||||
@@ -388,7 +389,7 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
int left = Integer.parseInt(nums.substring(0, space));
|
||||
int top = Integer.parseInt(nums.substring(space + 1));
|
||||
editor.appletLocation = new Point(left, top);
|
||||
System.out.println("external: move to " + left + " " + top);
|
||||
//System.out.println("external: move to " + left + " " + top);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user