new frame positioning
authorplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sun, 28 Aug 2011 15:14:24 +0000 (15:14 +0000)
committerplaa <plaa@180e2498-e6e9-4542-8430-84ac67f01cd8>
Sun, 28 Aug 2011 15:14:24 +0000 (15:14 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@167 180e2498-e6e9-4542-8430-84ac67f01cd8

src/net/sf/openrocket/gui/main/BasicFrame.java

index e4b2040821d17782b5cc27b6bbe18933a2be6c7b..cd548056f5ba089dd5a3a8384a44c103493ae233 100644 (file)
@@ -125,9 +125,6 @@ public class BasicFrame extends JFrame {
        private static final ArrayList<BasicFrame> frames = new ArrayList<BasicFrame>();
        
 
-
-
-
        /**
         * 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);