[Schmitzm-commits] r473 - in trunk: dist src/org/geotools/data/shapefile src/schmitzm/geotools/gui src/skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Oct 15 00:57:37 CEST 2009


Author: alfonx
Date: 2009-10-15 00:57:27 +0200 (Thu, 15 Oct 2009)
New Revision: 473

Modified:
   trunk/dist/schmitzm-1.1.x.jar
   trunk/dist/schmitzm-1.1.x.jar.zip
   trunk/src/org/geotools/data/shapefile/ShapefileDataStoreFactory.java
   trunk/src/schmitzm/geotools/gui/JMapPane.java
   trunk/src/skrueger/geotools/LegendIconFeatureRenderer.java
Log:
* Some final cleanup. Closing this session.

Modified: trunk/dist/schmitzm-1.1.x.jar
===================================================================
(Binary files differ)

Modified: trunk/dist/schmitzm-1.1.x.jar.zip
===================================================================
(Binary files differ)

Modified: trunk/src/org/geotools/data/shapefile/ShapefileDataStoreFactory.java
===================================================================
--- trunk/src/org/geotools/data/shapefile/ShapefileDataStoreFactory.java	2009-10-14 22:48:50 UTC (rev 472)
+++ trunk/src/org/geotools/data/shapefile/ShapefileDataStoreFactory.java	2009-10-14 22:57:27 UTC (rev 473)
@@ -524,7 +524,7 @@
 			 * reconstruct the other URLs.
 			 */
 
-			LOGGER.info("Patch in ShapefileDataStorefactory is applied! That is good! Sorry for this anoying debug msg, but it seems that the exported atlases don't call this method.");
+//			LOGGER.info("Patch in ShapefileDataStorefactory is applied! That is good! Sorry for this anoying debug msg, but it seems that the exported atlases don't call this method.");
 			/**
 			 * TODO ACHTUNG PATCH!!!
 			 * 

Modified: trunk/src/schmitzm/geotools/gui/JMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-10-14 22:48:50 UTC (rev 472)
+++ trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-10-14 22:57:27 UTC (rev 473)
@@ -349,10 +349,12 @@
 	/** An (transparent) image to paint over the map in the lower right corner **/
 	private BufferedImage mapImage = null;
 
-    /** Holds a flag for each layer, whether it is regarded or ignored on 
-     *  {@link #SELECT_TOP}, {@link #SELECT_ALL} and {@link #SELECT_ONE_FROM_TOP}
-     *  actions. */
-    protected HashMap<MapLayer, Boolean> mapLayerSelectable = new HashMap<MapLayer, Boolean>();
+	/**
+	 * Holds a flag for each layer, whether it is regarded or ignored on
+	 * {@link #SELECT_TOP}, {@link #SELECT_ALL} and {@link #SELECT_ONE_FROM_TOP}
+	 * actions.
+	 */
+	protected HashMap<MapLayer, Boolean> mapLayerSelectable = new HashMap<MapLayer, Boolean>();
 
 	/**
 	 * Erzeugt ein neues MapPane.
@@ -401,7 +403,8 @@
 				isDoubleBuffered != null ? isDoubleBuffered : true,
 				renderer != null ? renderer : new TransitionShapefileRenderer(),
 				// renderer != null ? renderer : new StreamingRenderer(),
-				context != null ? context : new DefaultMapContext(GeoImportUtil.getDEFAULT_CRS()));
+				context != null ? context : new DefaultMapContext(GeoImportUtil
+						.getDEFAULT_CRS()));
 
 		// Dieser Hint sorgt wohl dafuer, dass die Rasterpixel nicht
 		// interpoliert werden
@@ -412,15 +415,15 @@
 		getRenderer().setJava2DHints(hints);
 
 		/**
-		 * In GT2.6 this hint is important to avaoid regular "Bursa Wolf Parameters missing" 
-		 * exceptions during every zoom. The exceptions appeared for example in maps that consisted 
-		 * only of layers of DHDN2 CRS.
+		 * In GT2.6 this hint is important to avaoid regular
+		 * "Bursa Wolf Parameters missing" exceptions during every zoom. The
+		 * exceptions appeared for example in maps that consisted only of layers
+		 * of DHDN2 CRS.
 		 */
 		getRenderer().getRendererHints().put(
 				StreamingRenderer.SCALE_COMPUTATION_METHOD_KEY,
 				StreamingRenderer.SCALE_OGC);
 
-
 		// hints.add( new RenderingHints(RenderingHints.KEY_ANTIALIASING,
 		// RenderingHints.VALUE_ANTIALIAS_OFF ) );
 		// hints.add( new RenderingHints(RenderingHints.KEY_INTERPOLATION,
@@ -545,7 +548,10 @@
 								}
 							} catch (Exception err) {
 								LOGGER
-								         .warn("CRS could not be determined from map layer. "+GeoImportUtil.getDEFAULT_CRS().getName()+"  used.");
+										.warn("CRS could not be determined from map layer. "
+												+ GeoImportUtil
+														.getDEFAULT_CRS()
+														.getName() + "  used.");
 								// err.printStackTrace();
 								crs = GeoImportUtil.getDEFAULT_CRS();
 							}
@@ -562,20 +568,20 @@
 						}
 					}
 				});
-        // The default is to regard a layer on selection
-        // actions
-        getContext().addMapLayerListListener(
-            new MapLayerListAdapter() {
-              @Override
-              public void layerAdded(MapLayerListEvent e) {
-                setMapLayerSelectable(e.getLayer(),true);
-              }
-              @Override
-              public void layerRemoved(MapLayerListEvent e) {
-                // remove reference to layer
-                mapLayerSelectable.remove(e.getLayer());
-              }
-        });
+		// The default is to regard a layer on selection
+		// actions
+		getContext().addMapLayerListListener(new MapLayerListAdapter() {
+			@Override
+			public void layerAdded(MapLayerListEvent e) {
+				setMapLayerSelectable(e.getLayer(), true);
+			}
+
+			@Override
+			public void layerRemoved(MapLayerListEvent e) {
+				// remove reference to layer
+				mapLayerSelectable.remove(e.getLayer());
+			}
+		});
 	}
 
 	/**
@@ -1278,30 +1284,31 @@
 
 							Iterator<Feature> fcIt = fc.iterator();
 							try {
-								
-							while (fcIt.hasNext()) {
-								Feature f = fcIt.next();
-								Object obj = f.getAttribute(0);
 
-								if (obj instanceof Geometry) {
-									// Bei Punkten ja noch ganz einfach:
-									Geometry featureGeometry = (Geometry) obj;
-									double distance = featureGeometry
-											.distance(mousePoint);
+								while (fcIt.hasNext()) {
+									Feature f = fcIt.next();
+									Object obj = f.getAttribute(0);
 
-									if ((nearestFeature == null)
-											|| (distance < nearestDist)) {
-										nearestFeature = f;
-										nearestDist = distance;
+									if (obj instanceof Geometry) {
+										// Bei Punkten ja noch ganz einfach:
+										Geometry featureGeometry = (Geometry) obj;
+										double distance = featureGeometry
+												.distance(mousePoint);
+
+										if ((nearestFeature == null)
+												|| (distance < nearestDist)) {
+											nearestFeature = f;
+											nearestDist = distance;
+										}
+									} else {
+										LOGGER
+												.info("!obj instanceof Geometry      obj = "
+														+ obj
+																.getClass()
+																.getSimpleName());
 									}
-								} else {
-									LOGGER
-											.info("!obj instanceof Geometry      obj = "
-													+ obj.getClass()
-															.getSimpleName());
+
 								}
-
-							}
 							} finally {
 								fc.close(fcIt);
 							}
@@ -1559,10 +1566,11 @@
 			MapLayer layer = layerList[i];
 			if (!layer.isVisible())
 				continue;
-            if ( !isMapLayerSelectable(layer) ) {
-              LOGGER.debug("Ignoring layer " + layer.getTitle() + " because it is not declared as selectable!");
-              continue;
-            }
+			if (!isMapLayerSelectable(layer)) {
+				LOGGER.debug("Ignoring layer " + layer.getTitle()
+						+ " because it is not declared as selectable!");
+				continue;
+			}
 
 			LOGGER.debug("mode = " + mode);
 
@@ -2711,26 +2719,29 @@
 
 	}
 
-    /**
-     * Sets whether a layer is regarded or ignored on 
-     * {@link #SELECT_TOP}, {@link #SELECT_ALL} and {@link #SELECT_ONE_FROM_TOP}
-     * actions. 
-     * @param layer a layer
-     * @param selectable if {@code false} the layer is ignored during the
-     *        upper mentioned actions
-     */
-    public void setMapLayerSelectable(MapLayer layer, boolean selectable) {
-      mapLayerSelectable.put(layer, selectable);
-    }
+	/**
+	 * Sets whether a layer is regarded or ignored on {@link #SELECT_TOP},
+	 * {@link #SELECT_ALL} and {@link #SELECT_ONE_FROM_TOP} actions.
+	 * 
+	 * @param layer
+	 *            a layer
+	 * @param selectable
+	 *            if {@code false} the layer is ignored during the upper
+	 *            mentioned actions
+	 */
+	public void setMapLayerSelectable(MapLayer layer, boolean selectable) {
+		mapLayerSelectable.put(layer, selectable);
+	}
 
-    /**
-     * Returns whether a layer is regarded or ignored on 
-     * {@link #SELECT_TOP}, {@link #SELECT_ALL} and {@link #SELECT_ONE_FROM_TOP}
-     * actions. 
-     * @param layer a layer
-     */
-    public boolean isMapLayerSelectable(MapLayer layer) {
-      Boolean selectable = mapLayerSelectable.get(layer);
-      return selectable != null && selectable;
-    }
+	/**
+	 * Returns whether a layer is regarded or ignored on {@link #SELECT_TOP},
+	 * {@link #SELECT_ALL} and {@link #SELECT_ONE_FROM_TOP} actions.
+	 * 
+	 * @param layer
+	 *            a layer
+	 */
+	public boolean isMapLayerSelectable(MapLayer layer) {
+		Boolean selectable = mapLayerSelectable.get(layer);
+		return selectable != null && selectable;
+	}
 }

Modified: trunk/src/skrueger/geotools/LegendIconFeatureRenderer.java
===================================================================
--- trunk/src/skrueger/geotools/LegendIconFeatureRenderer.java	2009-10-14 22:48:50 UTC (rev 472)
+++ trunk/src/skrueger/geotools/LegendIconFeatureRenderer.java	2009-10-14 22:57:27 UTC (rev 473)
@@ -494,8 +494,8 @@
 				Symbolizer symbolizer = symbolizers[sIdx];
 
 				if (symbolizer instanceof TextSymbolizer) {
-					LOGGER
-							.warn("createImageForRule for a TextSymbolizer. Sure we want that?");
+//					LOGGER
+//							.warn("createImageForRule for a TextSymbolizer. Sure we want that?");
 					continue;
 				}
 



More information about the Schmitzm-commits mailing list