changeset 4857:c7133c1f8ede

CrossSectionArtifact, Calculation4Access: Updated to use RangeAccess instead of FLYSUtils.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 23 Jan 2013 13:02:27 +0100
parents d9ef525bff08
children 56fbdcdb7ff2
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/CrossSectionArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/Calculation4Access.java
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CrossSectionArtifact.java	Wed Jan 23 13:01:21 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/CrossSectionArtifact.java	Wed Jan 23 13:02:27 2013 +0100
@@ -12,6 +12,7 @@
 import de.intevation.artifacts.ArtifactFactory;
 import de.intevation.artifacts.CallMeta;
 
+import de.intevation.flys.artifacts.access.RangeAccess;
 import de.intevation.flys.artifacts.model.CrossSectionFacet;
 import de.intevation.flys.artifacts.model.FastCrossSectionLineFactory;
 
@@ -153,8 +154,10 @@
         Object   context,
         CallMeta callMeta)
     {
-        FLYSArtifact winfo = (FLYSArtifact) artifact;
-        double[] range = FLYSUtils.getKmRange(winfo);
+        FLYSArtifact flys = (FLYSArtifact) artifact;
+
+        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        double[] range = rangeAccess.getKmRange();
         double min = 0.0f;
         if (range != null && range.length > 0) {
             min = range[0];
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/Calculation4Access.java	Wed Jan 23 13:01:21 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/Calculation4Access.java	Wed Jan 23 13:02:27 2013 +0100
@@ -13,7 +13,7 @@
 import de.intevation.flys.utils.FLYSUtils;
 
 public class Calculation4Access
-extends      RiverAccess
+extends      RangeAccess
 {
     private static Logger log = Logger.getLogger(Calculation4Access.class);
 
@@ -25,11 +25,9 @@
 
     protected Boolean isRange;
 
-    public Calculation4Access() {
-    }
 
     public Calculation4Access(FLYSArtifact artifact) {
-        super(artifact);
+        super(artifact, null);
     }
 
     public List<Segment> getSegments() {
@@ -70,7 +68,8 @@
             }
 
             // XXX: FLYSArtifact sucks!
-            double [] fromTo = FLYSUtils.getKmRange(artifact);
+            // TODO further use RangeAccess functionality.
+            double [] fromTo = getKmRange();
 
             if (fromTo == null) {
                 return null;

http://dive4elements.wald.intevation.org