save tab pane location, make windows height narrower for prettiness

This commit is contained in:
benfry
2003-07-29 18:47:02 +00:00
parent 6c054e6d55
commit c5cf666b25
3 changed files with 64 additions and 51 deletions

View File

@@ -192,13 +192,19 @@ public class PdeEditor extends JPanel {
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
textarea, consolePanel);
splitPane.setOneTouchExpandable(true);
// repaint child panes while resizing
splitPane.setContinuousLayout(true);
// if window increases in size, give all of increase to textarea (top pane)
splitPane.setResizeWeight(1D);
// the default size on windows is too small and kinda ugly
int dividerSize = PdeBase.getInteger("editor.divider.size", 0);
if (dividerSize != 0) {
splitPane.setDividerSize(dividerSize);
}
rightPanel.add(splitPane, BorderLayout.CENTER);
// end swing version from danh
@@ -401,6 +407,14 @@ public class PdeEditor extends JPanel {
String what = path + File.separator + name + ".pde";
//System.out.println(what);
if (windowX != -1) {
String dividerLocation =
skprops.getProperty("editor.divider.location");
if (dividerLocation != null) {
splitPane.setDividerLocation(Integer.parseInt(dividerLocation));
}
}
if (new File(what).exists()) {
userName = user;
skOpen(path, name);
@@ -1740,6 +1754,8 @@ afterwards, some of these steps need a cleanup function
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", PdeBase.get("serial.port", "unspecified"));