[Schmitzm-commits] r128 - in trunk/src: schmitzm/geotools/feature schmitzm/geotools/gui skrueger/geotools skrueger/geotools/selection

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat May 30 18:27:26 CEST 2009


Author: alfonx
Date: 2009-05-30 18:27:26 +0200 (Sat, 30 May 2009)
New Revision: 128

Modified:
   trunk/src/schmitzm/geotools/feature/FeatureUtil.java
   trunk/src/schmitzm/geotools/gui/JMapPane.java
   trunk/src/skrueger/geotools/MapPaneToolBar.java
   trunk/src/skrueger/geotools/selection/FeatureMapLayerSelectionSynchronizer.java
Log:
* Upgraded JFreeChart to 1.0.13 and JCommon to 1.0.16

Modified: trunk/src/schmitzm/geotools/feature/FeatureUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2009-05-30 14:29:58 UTC (rev 127)
+++ trunk/src/schmitzm/geotools/feature/FeatureUtil.java	2009-05-30 16:27:26 UTC (rev 128)
@@ -28,6 +28,8 @@
 import org.apache.log4j.Logger;
 import org.geotools.data.DataUtilities;
 import org.geotools.data.FeatureSource;
+import org.geotools.factory.CommonFactoryFinder;
+import org.geotools.factory.GeoTools;
 import org.geotools.feature.AttributeType;
 import org.geotools.feature.AttributeTypeFactory;
 import org.geotools.feature.DefaultFeatureCollection;
@@ -49,6 +51,7 @@
 import org.geotools.styling.Style;
 import org.geotools.styling.StyleBuilder;
 import org.geotools.styling.Symbolizer;
+import org.opengis.filter.FilterFactory2;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 
 import schmitzm.lang.LangUtil;
@@ -93,8 +96,12 @@
   public static final AttributeTypeFactory ATTRTYPE_FACTORY = AttributeTypeFactory.defaultInstance();
 
   /** Instance of {@link FilterFactory}. */
-  public static final FilterFactory FILTER_FACTORY = new FilterFactoryImpl();
+  public static final org.opengis.filter.FilterFactory FILTER_FACTORY = CommonFactoryFinder.getFilterFactory(GeoTools.getDefaultHints());
   
+  /** Instance of {@link FilterFactory2}. */
+  public static final FilterFactory2 FILTER_FACTORY2 = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
+
+  
   /** Join-Types. */
   public static enum JoinType {
     /** The feature of the left collection is taken into the result, even
@@ -317,6 +324,7 @@
    * @param lineWidth Breite der Linie
    */
   public static Style createLineStyle(Color lineColor, double lineWidth) {
+	  // TODO I don't like StyleBuilder!
     final Symbolizer symb = STYLE_BUILDER.createLineSymbolizer(lineColor, lineWidth);
     return STYLE_BUILDER.createStyle( symb );
   }

Modified: trunk/src/schmitzm/geotools/gui/JMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-05-30 14:29:58 UTC (rev 127)
+++ trunk/src/schmitzm/geotools/gui/JMapPane.java	2009-05-30 16:27:26 UTC (rev 128)
@@ -40,7 +40,6 @@
 import org.geotools.coverage.grid.GridGeometry2D;
 import org.geotools.coverage.grid.io.AbstractGridCoverage2DReader;
 import org.geotools.coverage.grid.io.AbstractGridFormat;
-import org.geotools.coverage.io.AbstractGridCoverageReader;
 import org.geotools.data.FeatureSource;
 import org.geotools.data.memory.MemoryFeatureCollection;
 import org.geotools.factory.GeoTools;

Modified: trunk/src/skrueger/geotools/MapPaneToolBar.java
===================================================================
--- trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-05-30 14:29:58 UTC (rev 127)
+++ trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-05-30 16:27:26 UTC (rev 128)
@@ -206,38 +206,38 @@
           new ImageIcon(MapView.class.getResource("resource/icons/info.png"))
       ), false );
       
-//      // Set Selection
-//      addTool( new MapPaneToolBarAction(
-//          TOOL_SELECTION_SET, 
-//          this, 
-//          "",
-//          new ImageIcon(MapView.class.getResource("resource/icons/selection_set.png"))
-//      ), false );
-//
-//      // Add Selection
-//      addTool( new MapPaneToolBarAction(
-//    		  TOOL_SELECTION_ADD, 
-//    		  this, 
-//    		  "",
-//    		  new ImageIcon(MapView.class.getResource("resource/icons/selection_add.png"))
-//      ), false );
-//
-//      // Remove Selection
-//      addTool( new MapPaneToolBarAction(
-//    		  TOOL_SELECTION_REMOVE, 
-//    		  this, 
-//    		  "",
-//    		  new ImageIcon(MapView.class.getResource("resource/icons/selection_remove.png"))
-//      ), false );
-//      
-//      // ResetSelection
-//      addAction( new MapPaneToolBarAction(
-//    		  TOOL_SELECTION_CLEAR, 
-//    		  this, 
-//    		  "",
-//    		  new ImageIcon(MapView.class.getResource("resource/icons/selection_clear.png"))
-//      ), false );
+      // Set Selection
+      addTool( new MapPaneToolBarAction(
+          TOOL_SELECTION_SET, 
+          this, 
+          "",
+          new ImageIcon(MapView.class.getResource("resource/icons/selection_set.png"))
+      ), false );
+
+      // Add Selection
+      addTool( new MapPaneToolBarAction(
+    		  TOOL_SELECTION_ADD, 
+    		  this, 
+    		  "",
+    		  new ImageIcon(MapView.class.getResource("resource/icons/selection_add.png"))
+      ), false );
+
+      // Remove Selection
+      addTool( new MapPaneToolBarAction(
+    		  TOOL_SELECTION_REMOVE, 
+    		  this, 
+    		  "",
+    		  new ImageIcon(MapView.class.getResource("resource/icons/selection_remove.png"))
+      ), false );
       
+      // ResetSelection
+      addAction( new MapPaneToolBarAction(
+    		  TOOL_SELECTION_CLEAR, 
+    		  this, 
+    		  "",
+    		  new ImageIcon(MapView.class.getResource("resource/icons/selection_clear.png"))
+      ), false );
+      
       // Zoom in
       addTool( new MapPaneToolBarAction(
           TOOL_ZOOMIN,

Modified: trunk/src/skrueger/geotools/selection/FeatureMapLayerSelectionSynchronizer.java
===================================================================
--- trunk/src/skrueger/geotools/selection/FeatureMapLayerSelectionSynchronizer.java	2009-05-30 14:29:58 UTC (rev 127)
+++ trunk/src/skrueger/geotools/selection/FeatureMapLayerSelectionSynchronizer.java	2009-05-30 16:27:26 UTC (rev 128)
@@ -149,18 +149,13 @@
 				// TODO The default style is not good here. We need
 				// .createSelectionStyle(normalStyle, geoObj);
 				selectionMapStyle = StylingUtil
-						.createDefaultStyle(styledMapLayer.getGeoObject());
+						.createSelectionStyle(styledMapLayer.getGeoObject());
+//				selectionMapStyle = StylingUtil
+//				.createDefaultStyle(styledMapLayer.getGeoObject());
 
 				selectionMapStyle.getFeatureTypeStyles()[0]
 						.setName(SELECTION_STYLING);
 
-				// Symbolizer sss =
-				// selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0].getSymbolizers()[0];
-				// if (sss instanceof PolygonSymbolizer) {
-				// PolygonSymbolizer ps = (PolygonSymbolizer) sss;
-				// ps.getFill().setOpacity( FilterUtil.FILTER_FAC.literal(0.5));
-				// }
-
 				// Rule selectedRule = StylingUtil.STYLE_FACTORY.createRule();
 				selectionMapStyle.getFeatureTypeStyles()[0].getRules()[0]
 						.setFilter(new Filter() {
@@ -201,31 +196,13 @@
 				} else {
 					newFeatureTypes = originalFeatureTypeStyles;
 				}
-				//				
-				// // REMOVE any Selection_Styling FTS (usually the last one)
-				//				
-				// for (FeatureTypeStyle fts : originalFeatureTypeStyles){
-				// if (fts.getName().equals(SELECTION_STYLING)) continue;
-				// newFeatureTypes =
-				//					
-				// LangUtil.extendArray(
-				// originalFeatureTypeStyles, selectionMapStyle
-				// .getFeatureTypeStyles());
-				// }
-
+				
 				// The last FTS is the selection FTS
 				newFeatureTypes = LangUtil.extendArray(newFeatureTypes,
 						selectionMapStyle.getFeatureTypeStyles());
 
 				selectionMapStyle.setFeatureTypeStyles(newFeatureTypes);
 
-				// selectionMapStyle.setFeatureTypeStyles(originalStyle.getF)
-
-				// Flat copy the style
-
-				// selectionMapStyle =
-				// StylingUtil.createDefaultStyle(styledMapLayer.getGeoObject());
-
 			}
 
 			mapLayer.setStyle(selectionMapStyle);



More information about the Schmitzm-commits mailing list