changeset 6059:5f52a8079625

Get location limits from fixation overview in fixation location selection Part of issue 1277
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 22 May 2013 13:03:10 +0200
parents 939fea2b24a2
children 0a200ba54461
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/FixingsOverview.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java
diffstat 2 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FixingsOverview.java	Wed May 22 12:51:16 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FixingsOverview.java	Wed May 22 13:03:10 2013 +0200
@@ -815,5 +815,9 @@
 
         document.appendChild(fixingsElement);
     }
+
+    public Range getExtent() {
+        return extent;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java	Wed May 22 12:51:16 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/LocationSelect.java	Wed May 22 13:03:10 2013 +0200
@@ -16,6 +16,8 @@
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.states.RangeState;
+import org.dive4elements.river.artifacts.model.FixingsOverviewFactory;
+import org.dive4elements.river.artifacts.model.FixingsOverview;
 
 
 /**
@@ -47,7 +49,10 @@
     @Override
     protected double[] getMinMax(Artifact artifact) {
         D4EArtifact flysArtifact = (D4EArtifact) artifact;
-        return RiverUtils.getRiverMinMax(flysArtifact);
+        String riverName = flysArtifact.getDataAsString("river");
+        FixingsOverview overview = FixingsOverviewFactory.getOverview(riverName);
+
+        return new double[]{overview.getExtent().getStart(), overview.getExtent().getEnd()};
     }
 
 

http://dive4elements.wald.intevation.org