Issue 117: Load from default display_layout.xml when user's customized display_new_layout.xml does not exist.

* Updated the default display_layout.xml to look good on a Windows XP 1024x768 display.
* Updated GuiDisplay4.java to load from default layout if user's "new" layout does not exist.
* We have not had display_new_layout.xml in the repository for some time, but that is a related change.

Bug: 117
This commit is contained in:
Braids
2011-08-21 16:05:15 +00:00
parent 4ffcc7ce0a
commit 6afac1c7e0
2 changed files with 70 additions and 57 deletions

View File

@@ -762,7 +762,11 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
@Override
public void windowClosed(WindowEvent e) {
// Write the layout to the new file, usually
// res/gui/display_new_layout.xml
File f = ForgeProps.getFile(LAYOUT_NEW);
Node layout = pane.getMultiSplitLayout().getModel();
try {
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(f)));
@@ -776,7 +780,16 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
//making the multi split pane
Node model;
// Try to load the latest saved layout, usually
// res/gui/display_new_layout.xml
File f = ForgeProps.getFile(LAYOUT_NEW);
// If the new file does not exist, read the configuration from the
// default layout, usually res/gui/display_layout.xml
if (!f.exists()) {
f = ForgeProps.getFile(LAYOUT);
}
try {
XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(f)));
model = (Node) decoder.readObject();