[Schmitzm-commits] r435 - branches/1.0-gt2-2.6/src/skrueger/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 5 01:33:31 CEST 2009


Author: alfonx
Date: 2009-10-05 01:33:30 +0200 (Mon, 05 Oct 2009)
New Revision: 435

Modified:
   branches/1.0-gt2-2.6/src/skrueger/swing/DialogManager.java
Log:
* Debugged AtlasStyler stand-alone with the new structure

Modified: branches/1.0-gt2-2.6/src/skrueger/swing/DialogManager.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/DialogManager.java	2009-10-04 18:38:11 UTC (rev 434)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/DialogManager.java	2009-10-04 23:33:30 UTC (rev 435)
@@ -20,10 +20,10 @@
 		
 		/** May be overridden to add Listeners **/
 		public void appendListeners(DIALOG newInstance){};
-//
-//		/** May be overridden to remove Listeners added earlier **/
-//		public void removeListeners(DIALOG newInstance){};
 
+		/** May be overridden to remove Listeners added earlier **/
+		public void removeListeners(DIALOG newInstance){};
+
 	}
 
 	protected HashMap<KEY, DIALOG> dialogCache = new HashMap<KEY, DIALOG>();
@@ -102,8 +102,8 @@
 	 * @return Always a visible and inFront instance of DIALOG for the given
 	 *         key.
 	 */
-	public DIALOG getInstanceFor(final KEY key, FactoryInterface factory) {
-		DIALOG dialog;
+	public DIALOG getInstanceFor(final KEY key, final FactoryInterface factory) {
+		final DIALOG dialog;
 		if (isVisibleFor(key)) {
 			dialog = dialogCache.get(key);
 		} else {
@@ -115,12 +115,17 @@
 			dialog.addWindowListener(new WindowAdapter() {
 				@Override
 				public void windowClosed(final WindowEvent e) {
+					factory.removeListeners(dialog);
 					disposeInstanceFor(key);
 				}
 			});
 			
 			factory.appendListeners(dialog);
 		}
+		
+		dialog.setVisible(true);
+		dialog.toFront();
+		
 		return dialog;
 	}
 



More information about the Schmitzm-commits mailing list