svn - r34373 - branches/2.6.x/modules/library/render/src/main/java/org/geotools/renderer/lite

1 message Options
Embed this post
Permalink
svn_geotools

svn - r34373 - branches/2.6.x/modules/library/render/src/main/java/org/geotools/renderer/lite

Reply Threaded More More options
Print post
Permalink
Author: aaime
Date: 2009-11-12 11:28:58 -0500 (Thu, 12 Nov 2009)
New Revision: 34373

Modified:
   branches/2.6.x/modules/library/render/src/main/java/org/geotools/renderer/lite/FastBBOX.java
Log:
Make FastBBOX implement the deprecated GeometryFilter interface for backward compatibility

Modified: branches/2.6.x/modules/library/render/src/main/java/org/geotools/renderer/lite/FastBBOX.java
===================================================================
--- branches/2.6.x/modules/library/render/src/main/java/org/geotools/renderer/lite/FastBBOX.java 2009-11-12 16:28:35 UTC (rev 34372)
+++ branches/2.6.x/modules/library/render/src/main/java/org/geotools/renderer/lite/FastBBOX.java 2009-11-12 16:28:58 UTC (rev 34373)
@@ -17,10 +17,14 @@
 package org.geotools.renderer.lite;
 
 import org.geotools.factory.CommonFactoryFinder;
+import org.geotools.filter.Filter;
+import org.geotools.filter.FilterVisitorFilterWrapper;
+import org.geotools.filter.GeometryFilter;
 import org.geotools.filter.IllegalFilterException;
 import org.geotools.geometry.jts.ReferencedEnvelope;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.filter.BinaryComparisonOperator;
+import org.opengis.filter.FilterFactory;
 import org.opengis.filter.FilterVisitor;
 import org.opengis.filter.expression.Expression;
 import org.opengis.filter.spatial.BBOX;
@@ -40,10 +44,11 @@
  * @author aaime
  *
  */
-class FastBBOX implements BBOX, BinarySpatialOperator, BinaryComparisonOperator {
+class FastBBOX implements BBOX, BinarySpatialOperator, BinaryComparisonOperator, GeometryFilter {
     
     String property;
     Envelope envelope;
+    FilterFactory factory = CommonFactoryFinder.getFilterFactory(null);
     
     public FastBBOX(String propertyName, Envelope env) {
         this.property = propertyName;
@@ -127,9 +132,59 @@
         
         return other.getEnvelopeInternal().intersects(envelope);
     }
+    
+    // THIS GARGABE IS HERE TO ALLOW OLD DATASTORES NOT USING PROPER OGC FILTERS TO WORK
+    // WILL BE REMOVED WHEN THERE IS NOTHING LEFT USING THEM
 
     public boolean isMatchingCase() {
         return false;
     }
 
+    public void addLeftGeometry(org.geotools.filter.Expression leftGeometry)
+            throws IllegalFilterException {
+        throw new UnsupportedOperationException("This filter cannot be modified");
+        
+    }
+
+    public void addRightGeometry(org.geotools.filter.Expression rightGeometry)
+            throws IllegalFilterException {
+        throw new UnsupportedOperationException("This filter cannot be modified");
+    }
+
+    public boolean contains(SimpleFeature feature) {
+        return evaluate((Object) feature);
+    }
+
+    public org.geotools.filter.Expression getLeftGeometry() {
+        return (org.geotools.filter.Expression) getExpression1();
+    }
+
+    public org.geotools.filter.Expression getRightGeometry() {
+        return (org.geotools.filter.Expression) getExpression2();
+    }
+
+    public void accept(org.geotools.filter.FilterVisitor visitor) {
+        accept(new FilterVisitorFilterWrapper(visitor),null);        
+    }
+
+    public Filter and(org.opengis.filter.Filter filter) {        
+        return (Filter) factory.and(this, filter);
+    }
+
+    public Filter or(org.opengis.filter.Filter filter) {
+        return (Filter) factory.or(this, filter);
+    }
+
+    public Filter not() {
+        return (Filter) factory.not(this);
+    }
+
+    public boolean evaluate(SimpleFeature feature) {
+        return evaluate((Object) feature);
+    }
+
+    public short getFilterType() {
+        return Filter.GEOMETRY_BBOX;
+    }
+
 }


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits