[Schmitzm-commits] r1673 - trunk/schmitzm-core/src/main/java/de/schmitzm/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Aug 15 16:18:40 CEST 2011


Author: mojays
Date: 2011-08-15 16:18:39 +0200 (Mon, 15 Aug 2011)
New Revision: 1673

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java
Log:
Resize minimized frames to normal extend on DialogManager.showInstanceFor(.)

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java	2011-08-11 22:59:37 UTC (rev 1672)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/DialogManager.java	2011-08-15 14:18:39 UTC (rev 1673)
@@ -9,6 +9,7 @@
 import java.util.HashSet;
 
 import javax.swing.JDialog;
+import javax.swing.JFrame;
 
 import org.apache.log4j.Logger;
 
@@ -164,8 +165,13 @@
 	public DIALOG showInstanceFor(KEY key, Component owner, Object... constArgs) {
 	  DIALOG dialog = getInstanceFor(key, owner, constArgs);
 	  if ( dialog != null ) {
-//	    if ( dialog.isMinimumSizeSet() )
-//	      dialog.
+	    // if frame is currently minimized resize it
+	    // to normal extend
+	    if ( dialog instanceof JFrame ) {
+	      JFrame frame = (JFrame)dialog;
+	      if ( frame.getExtendedState() == JFrame.ICONIFIED )
+	        frame.setExtendedState(JFrame.NORMAL);
+	    }
 	    dialog.setVisible(true);
 	    dialog.toFront();
 	  }



More information about the Schmitzm-commits mailing list