From: plaa Date: Sun, 28 Aug 2011 15:14:24 +0000 (+0000) Subject: new frame positioning X-Git-Tag: upstream/1.1.9^2~17 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=93cac58fbc06a532428e5c0519c24a09e5e9c125;p=debian%2Fopenrocket new frame positioning git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@167 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/src/net/sf/openrocket/gui/main/BasicFrame.java b/src/net/sf/openrocket/gui/main/BasicFrame.java index e4b20408..cd548056 100644 --- a/src/net/sf/openrocket/gui/main/BasicFrame.java +++ b/src/net/sf/openrocket/gui/main/BasicFrame.java @@ -125,9 +125,6 @@ public class BasicFrame extends JFrame { private static final ArrayList frames = new ArrayList(); - - - /** * Whether "New" and "Open" should replace this frame. * Should be set to false on the first rocket modification. @@ -1007,6 +1004,10 @@ public class BasicFrame extends JFrame { // Close previous window if replacing if (replaceable && document.isSaved()) { + // We are replacing the frame, make new window have current location + BasicFrame newFrame = frames.get(frames.size() - 1); + newFrame.setLocation(this.getLocation()); + log.info("Closing window because it is replaceable"); closeAction(); replaceable = false; @@ -1188,6 +1189,7 @@ public class BasicFrame extends JFrame { doc.setFile(file); doc.setSaved(true); + // Open the frame log.debug("Opening new frame with the document"); BasicFrame frame = new BasicFrame(doc);