diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java @ 1095:f465785ed1ae

Refactored the code to fetch the km range/locations into a utility class. flys-artifacts/trunk@2598 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 26 Aug 2011 14:58:35 +0000
parents 139e7df1787c
children 29c67a76ad5d
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Fri Aug 26 14:55:18 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Fri Aug 26 14:58:35 2011 +0000
@@ -7,25 +7,26 @@
 
 import org.w3c.dom.Document;
 
+import de.intevation.artifactdatabase.data.DefaultStateData;
+import de.intevation.artifactdatabase.data.StateData;
 import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.artifactdatabase.state.DefaultOutput;
 import de.intevation.artifactdatabase.state.State;
-import de.intevation.artifactdatabase.data.StateData;
 
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.ArtifactFactory;
 import de.intevation.artifacts.CallMeta;
-import de.intevation.flys.artifacts.model.RiverFactory;
+
+import de.intevation.flys.model.Gauge;
+import de.intevation.flys.model.MainValue;
+import de.intevation.flys.model.River;
 
 import de.intevation.flys.artifacts.model.MainValuesQFacet;
 import de.intevation.flys.artifacts.model.MainValuesWFacet;
 import de.intevation.flys.artifacts.model.NamedDouble;
-import de.intevation.artifactdatabase.data.DefaultStateData;
+import de.intevation.flys.artifacts.model.RiverFactory;
 import de.intevation.flys.artifacts.states.StaticState;
-
-import de.intevation.flys.model.Gauge;
-import de.intevation.flys.model.MainValue;
-import de.intevation.flys.model.River;
+import de.intevation.flys.utils.FLYSUtils;
 
 
 /**
@@ -74,7 +75,7 @@
     protected void initialize(Artifact artifact, Object context, CallMeta meta) {
         logger.debug("MainValuesArtifact.initialize");
         WINFOArtifact winfo = (WINFOArtifact) artifact;
-        double location = winfo.getLocations()[0];
+        double location = FLYSUtils.getLocations(winfo)[0];
         addData("location", new DefaultStateData("location", null, null,
                     String.valueOf(location)));
         addData("river", winfo.getData("river"));

http://dive4elements.wald.intevation.org