Author: mvw
Date: 2008-02-06 13:48:10-0800
New Revision: 14083

Modified:
   trunk/src_new/org/argouml/application/Main.java
   trunk/src_new/org/argouml/application/api/Argo.java
   trunk/src_new/org/argouml/ui/ProjectBrowser.java

Log:
Fix for issue 4802: Remember the maximized state of the Frame.

Modified: trunk/src_new/org/argouml/application/Main.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/Main.java?view=diff&rev=14083&p1=trunk/src_new/org/argouml/application/Main.java&p2=trunk/src_new/org/argouml/application/Main.java&r1=14082&r2=14083
==============================================================================
--- trunk/src_new/org/argouml/application/Main.java     (original)
+++ trunk/src_new/org/argouml/application/Main.java     2008-02-06 13:48:10-0800
@@ -26,6 +26,7 @@
 
 import java.awt.Cursor;
 import java.awt.EventQueue;
+import java.awt.Frame;
 import java.awt.GraphicsEnvironment;
 import java.awt.Rectangle;
 import java.io.File;
@@ -851,6 +852,9 @@
         int y = Configuration.getInteger(Argo.KEY_SCREEN_TOP_Y, 0);
         pb.setLocation(x, y);
         pb.setSize(w, h);
+        pb.setExtendedState(Configuration.getBoolean(
+                Argo.KEY_SCREEN_MAXIMIZED, false) 
+                ? Frame.MAXIMIZED_BOTH : Frame.NORMAL);
         
         UIManager.put("Button.focusInputMap", new UIDefaults.LazyInputMap(
                 new Object[] {

Modified: trunk/src_new/org/argouml/application/api/Argo.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/application/api/Argo.java?view=diff&rev=14083&p1=trunk/src_new/org/argouml/application/api/Argo.java&p2=trunk/src_new/org/argouml/application/api/Argo.java&r1=14082&r2=14083
==============================================================================
--- trunk/src_new/org/argouml/application/api/Argo.java (original)
+++ trunk/src_new/org/argouml/application/api/Argo.java 2008-02-06 13:48:10-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -130,6 +130,13 @@
        Configuration.makeKey("screen", "height");
 
     /**
+     * Key for screen extended state, i.e. NORMAL, MAXIMIZED;
+     * (see Frame documentation).
+     */
+    public static final ConfigurationKey KEY_SCREEN_MAXIMIZED =
+        Configuration.makeKey("screen", "maximized");
+    
+    /**
      * Key for southwest pane width.
      */
     public static final ConfigurationKey KEY_SCREEN_SOUTHWEST_WIDTH =

Modified: trunk/src_new/org/argouml/ui/ProjectBrowser.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/ProjectBrowser.java?view=diff&rev=14083&p1=trunk/src_new/org/argouml/ui/ProjectBrowser.java&p2=trunk/src_new/org/argouml/ui/ProjectBrowser.java&r1=14082&r2=14083
==============================================================================
--- trunk/src_new/org/argouml/ui/ProjectBrowser.java    (original)
+++ trunk/src_new/org/argouml/ui/ProjectBrowser.java    2008-02-06 13:48:10-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -974,11 +974,16 @@
             Configuration.setInteger(Argo.KEY_SCREEN_NORTHEAST_WIDTH,
                     northEastPane.getWidth());
         }
-        
-        Configuration.setInteger(Argo.KEY_SCREEN_WIDTH, getWidth());
-        Configuration.setInteger(Argo.KEY_SCREEN_HEIGHT, getHeight());
-        Configuration.setInteger(Argo.KEY_SCREEN_LEFT_X, getX());
-        Configuration.setInteger(Argo.KEY_SCREEN_TOP_Y, getY());
+
+        boolean maximized = getExtendedState() == MAXIMIZED_BOTH;
+        if (!maximized) {
+            Configuration.setInteger(Argo.KEY_SCREEN_WIDTH, getWidth());
+            Configuration.setInteger(Argo.KEY_SCREEN_HEIGHT, getHeight());
+            Configuration.setInteger(Argo.KEY_SCREEN_LEFT_X, getX());
+            Configuration.setInteger(Argo.KEY_SCREEN_TOP_Y, getY());
+        }
+        Configuration.setBoolean(Argo.KEY_SCREEN_MAXIMIZED, 
+                maximized);
     }
 
     /**

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to