Revision: 15270
http://gate.svn.sourceforge.net/gate/?rev=15270&view=rev
Author: markagreenwood
Date: 2012-01-30 23:29:59 +0000 (Mon, 30 Jan 2012)
Log Message:
-----------
as well as saving the width/height of the frame we also save if it was in the
maximized state or not so we can restore this next time -- this has bugged me
for so many years I can't believe I've only just got around to doing something
about it!
Modified Paths:
--------------
gate/trunk/src/gate/GateConstants.java
gate/trunk/src/gate/gui/MainFrame.java
Modified: gate/trunk/src/gate/GateConstants.java
===================================================================
--- gate/trunk/src/gate/GateConstants.java 2012-01-30 23:28:31 UTC (rev
15269)
+++ gate/trunk/src/gate/GateConstants.java 2012-01-30 23:29:59 UTC (rev
15270)
@@ -50,6 +50,9 @@
/** The key for the main window height */
public static final String MAIN_FRAME_HEIGHT = "Main_frame_height";
+
+ /** The key for determining if the main window should be maximized **/
+ public static final String MAIN_FRAME_MAXIMIZED = "Main_frame_maximized";
/** The key for the save options on exit value */
public static final String SAVE_OPTIONS_ON_EXIT = "Save_options_on_exit";
Modified: gate/trunk/src/gate/gui/MainFrame.java
===================================================================
--- gate/trunk/src/gate/gui/MainFrame.java 2012-01-30 23:28:31 UTC (rev
15269)
+++ gate/trunk/src/gate/gui/MainFrame.java 2012-01-30 23:29:59 UTC (rev
15270)
@@ -552,6 +552,8 @@
Gate.getUserConfig().getInt(GateConstants.MAIN_FRAME_HEIGHT);
this.setSize(new Dimension(width == null ? 800 : width,
height == null ? 600 : height));
+ if (Gate.getUserConfig().getBoolean(GateConstants.MAIN_FRAME_MAXIMIZED))
+ setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setIconImage(Toolkit.getDefaultToolkit().getImage(
Files.getGateResource("/img/gate-icon.png")));
@@ -3773,6 +3775,7 @@
Integer height = MainFrame.this.getHeight();
userConfig.put(GateConstants.MAIN_FRAME_WIDTH, width);
userConfig.put(GateConstants.MAIN_FRAME_HEIGHT, height);
+ userConfig.put(GateConstants.MAIN_FRAME_MAXIMIZED,
MainFrame.this.getExtendedState() == JFrame.MAXIMIZED_BOTH);
Gate.writeUserConfig();
}
else {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs