[Schmitzm-commits] r160 - in trunk/src: schmitzm/geotools/gui skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Jun 22 19:15:45 CEST 2009


Author: alfonx
Date: 2009-06-22 19:15:45 +0200 (Mon, 22 Jun 2009)
New Revision: 160

Modified:
   trunk/src/schmitzm/geotools/gui/JMapPane.java
   trunk/src/skrueger/geotools/MapPaneToolBar.java
Log:
* JMapPane: Fixed a possible NPE .. happend very seldom when clicking in a MapView the first time 
* SelectionButtons are now directly appearing

Modified: trunk/src/schmitzm/geotools/gui/JMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-06-22 14:04:47 UTC (rev 159)
+++ trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-06-22 17:15:45 UTC (rev 160)
@@ -166,7 +166,7 @@
         // Ein MapAreaChangedEvent soll nur geworfen werden, wenn auch gezoomt
         // wurde! Irgendwie wird das auch aufgerufen, wenn man mit InfoClick
         // tool nur click - also garkeit kein draggin gemacht hat.
-        if (!oldMapArea.equals(mapArea) && (getState() == ZOOM_IN || getState() == ZOOM_OUT))
+        if (( oldMapArea == null || !oldMapArea.equals(mapArea) )  && (getState() == ZOOM_IN || getState() == ZOOM_OUT))
             fireMapPaneEvent(new MapAreaChangedEvent(this, oldMapArea, mapArea));
     }
 

Modified: trunk/src/skrueger/geotools/MapPaneToolBar.java
===================================================================
--- trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-06-22 14:04:47 UTC (rev 159)
+++ trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-06-22 17:15:45 UTC (rev 160)
@@ -276,8 +276,6 @@
 		for (JComponent b : toolAndActionButtons.values())
 			add(b);
 
-		repaint();
-
 		if (!toolAndActionButtons.containsKey(selectedTool)) {
 			/**
 			 * This might be a bit specific, but IF selection buttons are
@@ -294,6 +292,8 @@
 			}
 
 		}
+		
+		revalidate();
 	}
 
 	// Space between tool buttons and action buttons



More information about the Schmitzm-commits mailing list