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

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sun Jun 14 20:23:36 CEST 2009


Author: alfonx
Date: 2009-06-14 20:23:36 +0200 (Sun, 14 Jun 2009)
New Revision: 141

Modified:
   trunk/src/schmitzm/geotools/gui/JMapPane.java
   trunk/src/schmitzm/geotools/io/GeoImportUtil.java
   trunk/src/skrueger/geotools/MapPaneToolBar.java
Log:
* Have to go now.. The basic idea of seleciton-related buttons appearing only when AttribTableDialog or a ChartDialog are open has been implemented.

Modified: trunk/src/schmitzm/geotools/gui/JMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-06-14 17:24:44 UTC (rev 140)
+++ trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-06-14 18:23:36 UTC (rev 141)
@@ -1449,7 +1449,6 @@
 					filter = distancefilter.and(layerFilter);
 				}
 			}
-			;
 
 			try {
 				// Filter auf Layer des Features anwenden
@@ -1462,10 +1461,13 @@
 				// Liefert eine FeatureCollection zurück, in welcher nur
 				// Features enthalten sind, welche bei der aktuellen
 				// Anzeigeskala aufgrund des Styles gerendert werden.
-				if (!fc.isEmpty())
+				
+				LOGGER.debug("Atlas sometimes hangs here... layertitle = "+layer.getTitle());
+				LOGGER.debug("Atlas sometimes hangs here... fc.size = "+fc.size());
+				if (!fc.isEmpty()) {
+
 					fc = filterSLDVisibleOnly(fc, layer.getStyle());
 
-				if (!fc.isEmpty()) {
 					result.put(layer, fc);
 					// Beim Modus "oberstes Layer selektieren" die Schleife
 					// beenden

Modified: trunk/src/schmitzm/geotools/io/GeoImportUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/io/GeoImportUtil.java	2009-06-14 17:24:44 UTC (rev 140)
+++ trunk/src/schmitzm/geotools/io/GeoImportUtil.java	2009-06-14 18:23:36 UTC (rev 141)
@@ -81,12 +81,11 @@
 
 	/** These postfixes are associated with ESRI SHape files */
 	static public enum SHP_POSTFIXES {
-		shp, sbx, sbn, dbf,
-
+		shp, sbx, sbn, dbf, shx, 
 		qix, fix	// Non-ESRI QuadTree Index stuff
 	};
 
-	/** These postfixes are associated with ordenary image files, excluding GeoTIFF endings please */
+	/** These postfixes are associated with ordinary image files, excluding GeoTIFF endings please */
 	static public enum IMAGE_POSTFIXES {
 		png, gif, jpg, jpeg
 	};

Modified: trunk/src/skrueger/geotools/MapPaneToolBar.java
===================================================================
--- trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-06-14 17:24:44 UTC (rev 140)
+++ trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-06-14 18:23:36 UTC (rev 141)
@@ -246,7 +246,7 @@
 	 * Clears the GUI of all components and adds all tool and action buttons to
 	 * the tool bar.
 	 */
-	protected void initToolBar() {
+	public void initToolBar() {
 		setAlignmentY(1f);
 		removeAll();
 		// Separator to the left of the tool actions to start
@@ -256,6 +256,25 @@
 		// Tool buttons
 		for (JComponent b : toolAndActionButtons.values())
 			add(b);
+
+		repaint();
+
+		if (!toolAndActionButtons.containsKey(selectedTool)) {
+			/**
+			 * This might be a bit specific, but IF selection buttons are
+			 * available, select one of them.. if not, select the INFO tool.
+			 */
+
+			if (toolAndActionButtons.containsKey(TOOL_SELECTION_SET)) {
+				setSelectedTool(TOOL_SELECTION_SET);
+			} else if (toolAndActionButtons.containsKey(TOOL_INFO)) {
+				setSelectedTool(TOOL_INFO);
+			} else {
+				// TODO What to do now?!
+				setSelectedTool(null);
+			}
+
+		}
 	}
 
 	// Space between tool buttons and action buttons
@@ -294,10 +313,10 @@
 			// Set the mouse tool to "Info"
 			mapPane.setWindowSelectionState(JMapPane.NONE);
 			mapPane.setState(JMapPane.SELECT_TOP); // Why not:
-													// JMapPane.SELECT_TOP_ONEONLY
+			// JMapPane.SELECT_TOP_ONEONLY
 			mapPane.setHighlight(false);// SK: Was true, but since it not works
-										// properly removed it to save
-										// performance
+			// properly removed it to save
+			// performance
 			mapPane.setNormalCursor(SwingUtil.CROSSHAIR_CURSOR);
 			break;
 		case TOOL_ZOOMIN:
@@ -314,22 +333,24 @@
 			mapPane.setHighlight(false);
 			mapPane.setNormalCursor(SwingUtil.ZOOMOUT_CURSOR);
 			break;
-//		default:
-//			// Set map actions to default
-//			mapPane.setWindowSelectionState(JMapPane.NONE);
-//			mapPane.setState(JMapPane.NONE);
-//			mapPane.setHighlight(false);
-//			mapPane.setNormalCursor(null);
-//			break;
+		default:
+			// Set map actions to default
+			mapPane.setWindowSelectionState(JMapPane.NONE);
+			mapPane.setState(JMapPane.NONE);
+			mapPane.setHighlight(false);
+			mapPane.setNormalCursor(null);
+			break;
 		}
 		mapPane.updateCursor();
 	}
-	
+
 	/**
-	 * @param id The ID of the Component to remove
+	 * @param id
+	 *            The ID of the Component to remove. The change will not be
+	 *            visible until {@link #initToolBar()} is called.
 	 * @return <code>null</code> or the component that has been removed.
 	 */
-	public JComponent removeId(int id){
+	public JComponent removeId(int id) {
 		return toolAndActionButtons.remove(id);
 	}
 
@@ -519,6 +540,8 @@
 			return;
 		button.setSelected(true);
 		button.getAction().actionPerformed(null);
+
+		selectedTool = tool;
 	}
 
 	/**



More information about the Schmitzm-commits mailing list