Revision: 1745
          http://svn.sourceforge.net/spring-rich-c/?rev=1745&view=rev
Author:   jhoskens
Date:     2007-04-16 07:15:14 -0700 (Mon, 16 Apr 2007)

Log Message:
-----------
The frame that is created behind the scenes will be set as RootFrame in swing 
through the JOptionPane class.
Other dialogs/windows without which need a Frame before the application is 
started can then reuse this one.

The old behaviour can be selected if property rootFrame is set to false.

Modified Paths:
--------------
    
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/splash/AbstractSplashScreen.java

Modified: 
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/splash/AbstractSplashScreen.java
===================================================================
--- 
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/splash/AbstractSplashScreen.java
   2007-04-16 11:03:30 UTC (rev 1744)
+++ 
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/splash/AbstractSplashScreen.java
   2007-04-16 14:15:14 UTC (rev 1745)
@@ -21,6 +21,7 @@
 import java.net.URL;
 
 import javax.swing.JFrame;
+import javax.swing.JOptionPane;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -56,6 +57,8 @@
 
        protected final Log logger = LogFactory.getLog(getClass());
 
+       private boolean rootFrame = true;
+
        /**
         * Returns the location of the image to be used as the icon for the 
splash
         * screen's frame. The splash screen produced by this class is 
undecorated,
@@ -122,6 +125,9 @@
         */
        public final void splash() {
                frame = shadowBorder ? new ShadowBorderFrame() : new JFrame();
+               if (isRootFrame())
+                       JOptionPane.setRootFrame(frame);
+
                frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                frame.setUndecorated(true);
 
@@ -194,4 +200,24 @@
        public void setShadowBorder(boolean shadowBorder) {
                this.shadowBorder = shadowBorder;
        }
+
+       /**
+        * The frame that is used to display this splashscreen can be used as
+        * rootFrame for other dialogs/windows that need a Frame before the
+        * applicationFrame is created. (eg login).
+        * 
+        * @param rootFrame <code>true</code> if the created frame must be set 
as
+        * rootFrame. Defaults to <code>true</code>.
+        * @see JOptionPane#setRootFrame(java.awt.Frame)
+        */
+       public void setRootFrame(boolean rootFrame) {
+               this.rootFrame = rootFrame;
+       }
+
+       /**
+        * @return <code>true</code> if the created frame must be set as 
rootFrame.
+        */
+       public boolean isRootFrame() {
+               return this.rootFrame;
+       }
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to