diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java @ 1765:5d8b3880a553

Do not store association of states to facets, let artifacts keep facets in a pure list. flys-artifacts/trunk@3083 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 26 Oct 2011 12:23:47 +0000
parents 33ade8153d74
children c62ff9e72cea
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Wed Oct 26 12:03:59 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Wed Oct 26 12:23:47 2011 +0000
@@ -71,29 +71,30 @@
         Document        data)
     {
         logger.debug("MainValuesArtifact.setup");
-        state = new StaticState("state.mainvalue.static", "state.mainvalue.static");
-        List<Facet> fs = new ArrayList<Facet>();
-        Facet qfacet = new MainValuesQFacet(Resources.getMsg(callMeta,
-                   "facet.discharge_curves.mainvalues.q",
-                   "facet.discharge_curves.mainvalues.q"));
-        Facet wfacet = new MainValuesWFacet(Resources.getMsg(callMeta,
-                   "facet.discharge_curves.mainvalues.w",
-                   "facet.discharge_curves.mainvalues.w"));
-        fs.add(qfacet);
-        fs.add(wfacet);
-        facets.put(state.getID(), fs);
+        state = new StaticState(
+            "state.mainvalue.static",
+            "state.mainvalue.static");
+        Facet qfacet = new MainValuesQFacet(Resources.getMsg(
+            callMeta,
+            "facet.discharge_curves.mainvalues.q",
+            "facet.discharge_curves.mainvalues.q"));
+        Facet wfacet = new MainValuesWFacet(Resources.getMsg(
+            callMeta,
+            "facet.discharge_curves.mainvalues.w",
+            "facet.discharge_curves.mainvalues.w"));
+        facets.add(qfacet);
+        facets.add(wfacet);
         spawnState();
         super.setup(identifier, factory, context, callMeta, data);
     }
 
     protected State spawnState() {
         state = new StaticState("state.mainvalue.static", "state.mainvalue.static");
-        List<Facet> fs = (List<Facet>) facets.get("state.mainvalue.static");
         DefaultOutput mainValuesOutput2 = new DefaultOutput(
-                    "computed_discharge_curve",
-                    "output.computed_discharge_curve", "image/png",
-                    fs,
-                    "chart");
+            "computed_discharge_curve",
+            "output.computed_discharge_curve", "image/png",
+            facets,
+            "chart");
 
         state.getOutputs().add(mainValuesOutput2);
         return state;

http://dive4elements.wald.intevation.org