[Schmitzm-commits] r1149 - in trunk/src/schmitzm: geotools geotools/feature geotools/gui geotools/io io

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Oct 18 11:21:47 CEST 2010


Author: alfonx
Date: 2010-10-18 11:21:46 +0200 (Mon, 18 Oct 2010)
New Revision: 1149

Modified:
   trunk/src/schmitzm/geotools/FilterUtil.java
   trunk/src/schmitzm/geotools/feature/FeatureUtil.java
   trunk/src/schmitzm/geotools/gui/XMapPane.java
   trunk/src/schmitzm/geotools/io/GeoImportUtil.java
   trunk/src/schmitzm/io/IOUtil.java
Log:
Increased backward compatibility with older TextRule SLDs created with Versions prior to 1.5. 

Modified: trunk/src/schmitzm/geotools/FilterUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/FilterUtil.java	2010-10-18 08:11:57 UTC (rev 1148)
+++ trunk/src/schmitzm/geotools/FilterUtil.java	2010-10-18 09:21:46 UTC (rev 1149)
@@ -56,20 +56,8 @@
 			.getFilterFactory2(null);
 	/** Instanz von {@link GeometryFactory}. */
 	public static final GeometryFactory GEOMETRY_FAC = new GeometryFactory();
-//
-//	/**
-//	 * Erzeugt eine Kopie eines Filters
-//	 * 
-//	 * @param filter
-//	 *            ein Filter
-//	 * 
-//	 *            TODO GT 26 Das wird in Atlas und Schmitzm nicht benötigt. Wir
-//	 *            können die Methode als theoretisch einfach mal entfernen..
-//	 *            Ansonsten habe ich auch eine Mail auf die gt-user geschickt.
-//	 */
-//	public static Filter cloneFilter(Filter filter) {
-//		DuplicatingFilterVisitor dfv = new DuplicatingFilterVisitor(FILTER_FAC2);
-//		Filter newFilter = (Filter) dfv.visit(filter, (Object) null);
-//		return newFilter;
-//	}
+
+	public static final Filter ALLWAYS_TRUE_FILTER = FILTER_FAC2.equals(
+			FILTER_FAC2.literal("1"), FILTER_FAC2.literal("1"));
+
 }

Modified: trunk/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2010-10-18 08:11:57 UTC (rev 1148)
+++ trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2010-10-18 09:21:46 UTC (rev 1149)
@@ -150,7 +150,7 @@
 		return attrType instanceof GeometryAttributeType
 				|| attrType instanceof GeometryDescriptor;
 	}
-
+	
 	/**
 	 * This is a cheap and not good hack to extract the names of attributes used
 	 * in a ECQL expression. This is not the way to do it, but a try.

Modified: trunk/src/schmitzm/geotools/gui/XMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPane.java	2010-10-18 08:11:57 UTC (rev 1148)
+++ trunk/src/schmitzm/geotools/gui/XMapPane.java	2010-10-18 09:21:46 UTC (rev 1149)
@@ -100,11 +100,12 @@
  * A logo/icon to float in the lower left corner may be set with
  * {@link #setMapImage(BufferedImage)}<br>
  * 
+ * It is recommended to execute {@link #dispose()} when not using the
+ * {@link XMapPane} instance anymore, as this way resources are released faster.
+ * 
  * @see SelectableXMapPane - an extension of {@link XMapPane} that supports
  *      selecting features.
  * 
- * @author stefan
- * 
  */
 public class XMapPane extends JPanel {
 
@@ -1010,7 +1011,7 @@
 	public void dispose() {
 		if (isDisposed())
 			return;
-		
+
 		disposed = true;
 
 		Translation.removeActiveLangListener(activeLanguageChangeListener);
@@ -1020,7 +1021,6 @@
 		resizeTimer.stop();
 		startRenderThreadsTimer.stop();
 
-
 		if (bgExecuter != null) {
 			bgExecuter.cancelTask();
 			bgExecuter.dispose();

Modified: trunk/src/schmitzm/geotools/io/GeoImportUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/io/GeoImportUtil.java	2010-10-18 08:11:57 UTC (rev 1148)
+++ trunk/src/schmitzm/geotools/io/GeoImportUtil.java	2010-10-18 09:21:46 UTC (rev 1149)
@@ -1061,22 +1061,20 @@
 				StringTokenizer st = new StringTokenizer(line);
 				tfwValues.add(Double.parseDouble(st.nextToken(" \n;,#|/")));
 			} catch (Exception err) {
-				System.err.println("WorldFile-Error in line " + lineNo + ": "
+				LOGGER.error("WorldFile-Error in line " + lineNo + ": "
 						+ err);
 
-				// (SK)
-				// System.err.println("WorldFile-Error in '"+file.getAbsolutePath()+"' (line "+lineNo+"): "+err);
-				System.err.println("   >> expected value is set to 1.0");
+				LOGGER.error("   >> expected value is set to 1.0");
 				tfwValues.add(1.0);
 			}
 		}
 
 		while (tfwValues.size() < 6) {
-			System.err.println("WorldFile-Error: value " + tfwValues.size()
+			LOGGER.error("WorldFile-Error: value " + tfwValues.size()
 					+ " missing!");
 			// (SK)
 			// System.err.println("WorldFile-Error in '"+file.getAbsolutePath()+"': value "+tfwValues.size()+" missing!");
-			System.err.println("   >> expected value is set to 1.0");
+			LOGGER.error("   >> expected value is set to 1.0");
 			tfwValues.add(1.0);
 		}
 

Modified: trunk/src/schmitzm/io/IOUtil.java
===================================================================
--- trunk/src/schmitzm/io/IOUtil.java	2010-10-18 08:11:57 UTC (rev 1148)
+++ trunk/src/schmitzm/io/IOUtil.java	2010-10-18 09:21:46 UTC (rev 1149)
@@ -623,14 +623,14 @@
 	 */
 	public static void main(final String[] arg) {
 		if (arg.length == 0) {
-			System.err.println("Missing arguments.");
+			LOGGER.error("Missing arguments.");
 			return;
 		}
 
 		String func = arg[0].toUpperCase();
 		if (func.equals("DELDIR")) {
 			if (arg.length < 2) {
-				System.err.println("Missing arguments for DELDIR.");
+				LOGGER.error("Missing arguments for DELDIR.");
 			}
 			File currDir = new File(".");
 			FileFilter filter = createSimpleFileFilter(arg[1],



More information about the Schmitzm-commits mailing list