[Schmitzm-commits] r865 - in trunk/src: schmitzm/geotools/grid schmitzm/geotools/gui skrueger/geotools skrueger/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 25 16:10:00 CEST 2010


Author: alfonx
Date: 2010-05-25 16:09:59 +0200 (Tue, 25 May 2010)
New Revision: 865

Modified:
   trunk/src/schmitzm/geotools/grid/GridUtil.java
   trunk/src/schmitzm/geotools/gui/XMapPaneAction_Select.java
   trunk/src/skrueger/geotools/GeomFilterGenerator.java
   trunk/src/skrueger/geotools/SelectXMapPaneMouseListener.java
   trunk/src/skrueger/swing/AtlasDialog.java
Log:
Make use of the FeatureUtil.GEOMETRY_FACTORY constant wherever a GeometryFactory is needed (and organized imports)

Modified: trunk/src/schmitzm/geotools/grid/GridUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/grid/GridUtil.java	2010-05-24 23:28:45 UTC (rev 864)
+++ trunk/src/schmitzm/geotools/grid/GridUtil.java	2010-05-25 14:09:59 UTC (rev 865)
@@ -65,6 +65,7 @@
 import schmitzm.data.WritableGrid;
 import schmitzm.data.WritableGridArray;
 import schmitzm.geotools.GTUtil;
+import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.styling.StylingUtil;
 import schmitzm.lang.LangUtil;
 import schmitzm.swing.SwingUtil;
@@ -772,7 +773,7 @@
     double     cellHeight   = realHeight / rasterHeight;
 
     Coordinate[]    cellBounds = new Coordinate[] { new Coordinate(), new Coordinate(), new Coordinate(), new Coordinate() };
-    GeometryFactory geomFac    = new GeometryFactory();
+    GeometryFactory geomFac    = FeatureUtil.GEOMETRY_FACTORY;
 
     // determine the cells of the LineStrings start/end point
     com.vividsolutions.jts.geom.Envelope lsBB = ls.getEnvelopeInternal();
@@ -862,7 +863,7 @@
     // Check all raster cells inside the BB of the Geometry, whether they
     // really intersect the Geometry
     Coordinate[]    cellBounds = new Coordinate[] { new Coordinate(), new Coordinate(), new Coordinate(), new Coordinate(), new Coordinate() };
-    GeometryFactory geomFac    = new GeometryFactory();
+    GeometryFactory geomFac    = FeatureUtil.GEOMETRY_FACTORY;
     for (double y = bbMinY; y<=bbMaxY; y+=cellHeight)
       for (double x = bbMinX; x<=bbMaxX; x+=cellWidth) {
         cellBounds[0].x = x;

Modified: trunk/src/schmitzm/geotools/gui/XMapPaneAction_Select.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPaneAction_Select.java	2010-05-24 23:28:45 UTC (rev 864)
+++ trunk/src/schmitzm/geotools/gui/XMapPaneAction_Select.java	2010-05-25 14:09:59 UTC (rev 865)
@@ -16,13 +16,13 @@
 import org.opengis.feature.simple.SimpleFeatureType;
 import org.opengis.geometry.DirectPosition;
 
+import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.map.event.FeatureSelectedEvent;
 import skrueger.geotools.GeomFilterGenerator.PointFilterGenerator;
 
 import com.vividsolutions.jts.geom.Coordinate;
 import com.vividsolutions.jts.geom.Envelope;
 import com.vividsolutions.jts.geom.Geometry;
-import com.vividsolutions.jts.geom.GeometryFactory;
 
 public abstract class XMapPaneAction_Select implements XMapPaneAction {
 	//	
@@ -77,7 +77,7 @@
 
 					Iterator<SimpleFeature> fcIt = fc.iterator();
 					try {
-						com.vividsolutions.jts.geom.Point mousePoint = new GeometryFactory()
+						com.vividsolutions.jts.geom.Point mousePoint = FeatureUtil.GEOMETRY_FACTORY
 								.createPoint(new Coordinate(geoPoint.getX(),
 										geoPoint.getY()));
 

Modified: trunk/src/skrueger/geotools/GeomFilterGenerator.java
===================================================================
--- trunk/src/skrueger/geotools/GeomFilterGenerator.java	2010-05-24 23:28:45 UTC (rev 864)
+++ trunk/src/skrueger/geotools/GeomFilterGenerator.java	2010-05-25 14:09:59 UTC (rev 865)
@@ -18,6 +18,7 @@
 
 import schmitzm.geotools.FilterUtil;
 import schmitzm.geotools.JTSUtil;
+import schmitzm.geotools.feature.FeatureUtil;
 import schmitzm.geotools.io.GeoImportUtil;
 
 import com.vividsolutions.jts.geom.Coordinate;
@@ -183,15 +184,7 @@
 		private final static Logger LOGGER = Logger
 				.getLogger(PointFilterGenerator.class);
 
-		private static final GeometryFactory GF = new GeometryFactory(); // TODO
-		// do
-		// we
-		// have
-		// a
-		// application
-		// wide
-		// one?
-
+		private static final GeometryFactory GF = FeatureUtil.GEOMETRY_FACTORY; 
 		/**
 		 * Holds the base constraint (coordinate) relative to the
 		 * {@linkplain GeomFilterGenerator#baseCRS base CRS}.

Modified: trunk/src/skrueger/geotools/SelectXMapPaneMouseListener.java
===================================================================
--- trunk/src/skrueger/geotools/SelectXMapPaneMouseListener.java	2010-05-24 23:28:45 UTC (rev 864)
+++ trunk/src/skrueger/geotools/SelectXMapPaneMouseListener.java	2010-05-25 14:09:59 UTC (rev 865)
@@ -1,3 +1,4 @@
+
 //package skrueger.geotools;
 //
 //import java.awt.Cursor;
@@ -116,7 +117,7 @@
 //
 //					Iterator<SimpleFeature> fcIt = fc.iterator();
 //					try {
-//						com.vividsolutions.jts.geom.Point mousePoint = new GeometryFactory()
+//						com.vividsolutions.jts.geom.Point mousePoint = FeatureUtil.GEOMETRY_FACTORY
 //						.createPoint(new Coordinate(geoCoord.getX(), geoCoord.getY()));
 //
 //						while (fcIt.hasNext()) {

Modified: trunk/src/skrueger/swing/AtlasDialog.java
===================================================================
--- trunk/src/skrueger/swing/AtlasDialog.java	2010-05-24 23:28:45 UTC (rev 864)
+++ trunk/src/skrueger/swing/AtlasDialog.java	2010-05-25 14:09:59 UTC (rev 865)
@@ -13,7 +13,6 @@
 import javax.swing.KeyStroke;
 
 import net.miginfocom.swing.MigLayout;
-
 import schmitzm.swing.SwingUtil;
 
 /**



More information about the Schmitzm-commits mailing list