[Dive4elements-commits] [PATCH 13 of 19] CrossSectionArtifact, Calculation4Access: Updated to use RangeAccess instead of FLYSUtils

Wald Commits scm-commit at wald.intevation.org
Thu Jan 24 14:14:25 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1358942547 -3600
# Node ID c7133c1f8edec633f9dd481688d079c444be855a
# Parent  d9ef525bff08318468f53bc98b147e887b9a3b45
CrossSectionArtifact, Calculation4Access: Updated to use RangeAccess instead of FLYSUtils.

diff -r d9ef525bff08 -r c7133c1f8ede flys-artifacts/src/main/java/de/intevation/flys/artifacts/CrossSectionArtifact.java
--- 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];
diff -r d9ef525bff08 -r c7133c1f8ede flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/Calculation4Access.java
--- 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;


More information about the Dive4elements-commits mailing list