mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 17:40:48 +01:00
finishing up with breaking the build
This commit is contained in:
@@ -1607,65 +1607,7 @@ public class PdeEditor extends JPanel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PdePreferences.save();
|
||||
// write sketch.properties
|
||||
try {
|
||||
FileOutputStream output = null;
|
||||
|
||||
if (PdeBase.platform == PdeBase.MACOSX) {
|
||||
//String pkg = "Proce55ing.app/Contents/Resources/Java/";
|
||||
//output = new FileOutputStream(pkg + "sketch.properties");
|
||||
output = new FileOutputStream("lib/sketch.properties");
|
||||
|
||||
} else if (PdeBase.platform == PdeBase.MACOS9) {
|
||||
output = new FileOutputStream("lib/sketch.properties");
|
||||
|
||||
} else { // win95/98/ME doesn't set cwd properly
|
||||
URL url = getClass().getResource("buttons.gif");
|
||||
String urlstr = url.getFile();
|
||||
urlstr = urlstr.substring(0, urlstr.lastIndexOf("/") + 1) +
|
||||
"sketch.properties";
|
||||
#ifdef JDK13
|
||||
// the ifdef is weird, but it's set for everything but
|
||||
// macos9, and this will never get hit
|
||||
output = new FileOutputStream(URLDecoder.decode(urlstr));
|
||||
#else
|
||||
System.err.println("bad error while writing sketch.properties");
|
||||
System.err.println("you should never see this message");
|
||||
#endif
|
||||
}
|
||||
|
||||
Properties skprops = new Properties();
|
||||
|
||||
//Rectangle window = PdeBase.frame.getBounds();
|
||||
Rectangle window = base.getBounds();
|
||||
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
|
||||
|
||||
skprops.put("window.x", String.valueOf(window.x));
|
||||
skprops.put("window.y", String.valueOf(window.y));
|
||||
skprops.put("window.w", String.valueOf(window.width));
|
||||
skprops.put("window.h", String.valueOf(window.height));
|
||||
|
||||
skprops.put("screen.w", String.valueOf(screen.width));
|
||||
skprops.put("screen.h", String.valueOf(screen.height));
|
||||
|
||||
skprops.put("sketch.name", sketchName);
|
||||
skprops.put("sketch.directory", sketchDir.getCanonicalPath());
|
||||
skprops.put("user.name", userName);
|
||||
|
||||
skprops.put("editor.external", externalEditor ? "true" : "false");
|
||||
skprops.put("editor.divider.location",
|
||||
String.valueOf(splitPane.getDividerLocation()));
|
||||
|
||||
//skprops.put("serial.port", PdePreferences.get("serial.port", "unspecified"));
|
||||
|
||||
skprops.save(output, "auto-generated by pde, please don't touch");
|
||||
|
||||
} catch (IOException e) {
|
||||
System.err.println("doQuit: error saving properties");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//System.out.println("exiting here");
|
||||
System.exit(0);
|
||||
|
||||
Reference in New Issue
Block a user