changeset 2651:9e9eb9d97548

Initial transition configuration and artifact/state stubs for fixation analysis. flys-artifacts/trunk@4312 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 26 Apr 2012 15:08:51 +0000
parents a6fa128e4654
children 9d2a06c3a134
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/fixanalysis.xml flys-artifacts/doc/conf/conf.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/FixationArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/AnalysisPeriods.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationPeriod.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationSelect.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationVolmerCompute.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/GaugeRange.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/LocationSelect.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/PreprocessingSelect.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/QSelect.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/ReferencePeriod.java flys-artifacts/src/main/resources/messages.properties flys-artifacts/src/main/resources/messages_de.properties flys-artifacts/src/main/resources/messages_de_DE.properties flys-artifacts/src/main/resources/messages_en.properties
diffstat 19 files changed, 937 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu Apr 26 13:38:56 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu Apr 26 15:08:51 2012 +0000
@@ -1,3 +1,37 @@
+2012-04-26  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Initial transition configuration and artifact/state stubs for fixation
+	analysis.
+
+	* doc/conf/artifacts/fixanalysis.xml:
+	  New. Initial transition configuration.
+
+	* doc/conf/conf.xml:
+	  Added artifact and factory entry to config.
+
+	* src/main/java/de/intevation/flys/artifacts/FixationArtifact.java:
+	  New. Stub with initial implementation.
+
+	* src/main/java/de/intevation/flys/artifacts/states/fixation,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/QSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/ReferencePeriod.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/FixationSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/FixationVolmerCompute.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/PreprocessingSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/FixationPeriod.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/GaugeRange.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/LocationSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/AnalysisPeriods.java,
+	  src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java:
+	  New. Stubs for fixation states.
+
+	* src/main/resources/messages.properties,
+	  src/main/resources/messages_de_DE.properties,
+	  src/main/resources/messages_en.properties,
+	  src/main/resources/messages_de.properties:
+	  Added i18n strings.
+
 2012-04-26	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/geom/Lines.java:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/doc/conf/artifacts/fixanalysis.xml	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<artifact name="fixanalysis">
+    <states>
+        <state id="state.fix.river" description="state.fix.river"
+            state="de.intevation.flys.artifacts.states.RiverSelect">
+            <data name="river" type="String" />
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.river"/>
+            <to state="state.fix.calculation.mode"/>
+        </transition>
+
+        <state id="state.fix.calculation.mode"
+            description="state.fix.calcuation.mode"
+            state="de.intevation.flys.artifacts.states.fixation.FixationSelect">
+            <data name="calculation.mode" type="String"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.calculation.mode"/>
+            <to state="state.fix.location"/>
+        </transition>
+
+        <state id="state.fix.location" description="state.fix.location"
+            state="de.intevation.flys.artifacts.states.fixation.LocationSelect">
+            <data name="location" type="Double[]"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.location"/>
+            <to state="state.fix.period"/>
+        </transition>
+
+        <state id="state.fix.period" description="state.fix.period"
+            state="de.intevation.flys.artifacts.states.fixation.FixationPeriod">
+            <data name="period" type="Long[]"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.period"/>
+            <to state="state.fix.gaugerange"/>
+        </transition>
+
+        <state id="state.fix.gaugerange" description="state.fix.gaugerange"
+            state="de.intevation.flys.artifacts.states.fixation.GaugeRange">
+            <data name="gaugerange" type="Integer[]"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.ValueCompareTransition">
+            <from state="state.fix.gaugerange"/>
+            <to state="state.fix.analysis.referenceperiod"/>
+            <condition data="calculation.mode" value="calculation.analysis"
+                operator="equal"/>
+        </transition>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.ValueCompareTransition">
+            <from state="state.fix.gaugerange"/>
+            <to state="state.fix.volmer.function"/>
+            <condition data="calculation.mode" value="calculation.volmer"
+                operator="equal"/>
+        </transition>
+
+        <state id="state.fix.analysis.referenceperiod"
+            description="state.fix.analysis.referenceperiod"
+            state="de.intevation.flys.artifacts.states.fixation.ReferencePeriod">
+            <data name="referenceperiod" type="Long[]"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.analysis.referenceperiod"/>
+            <to state="state.fix.analysis.analysisperiods"/>
+        </transition>
+
+        <state id="state.fix.analysis.analysisperiods"
+            description="state.fix.analysis.analysisperiods"
+            state="de.intevation.flys.artifacts.states.fixation.AnalysisPeriods">
+            <data name="analysisperiods" type="Long[]"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.analysis.analysisperiods"/>
+            <to state="state.fix.analysis.function"/>
+        </transition>
+
+        <state id="state.fix.analysis.function"
+            description="state.fix.analysis.function"
+            state="de.intevation.flys.artifacts.states.fixation.FunctionSelect">
+            <data name="function" type="String"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.analysis.function"/>
+            <to state="state.fix.analysis.preprocessing"/>
+        </transition>
+
+        <state id="state.fix.analysis.preprocessing"
+            description="state.fix.analysis.preprocessing"
+            state="de.intevation.flys.artifacts.states.fixation.PreprocessingSelect">
+            <data name="preprocessing" type="Boolean"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.analysis.preprocessing"/>
+            <to state="state.fix.analysis.compute"/>
+        </transition>
+
+        <state id="state.fix.analysis.compute"
+            description="state.fix.analysis.compute"
+            state="de.intevation.flys.artifacts.states.fixation.FixationCompute">
+            <outputmodes>
+                <outputmode>
+                    <facets>
+                        <facet/>
+                    </facets>
+                </outputmode>
+            </outputmodes>
+        </state>
+
+        <state id="state.fix.volmer.function"
+            description="state.fix.volmer.function"
+            state="de.intevation.flys.artifacts.states.fixation.FunctionSelect">
+            <data name="function" type="String"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.volmer.function"/>
+            <to state="state.fix.volmer.preprocessing"/>
+        </transition>
+
+        <state id="state.fix.volmer.preprocessing"
+            description="state.fix.volmer.preprocessing"
+            state="de.intevation.flys.artifacts.states.fixation.PreprocessingSelect">
+            <data name="preprocessing" type="Boolean"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.volmer.preprocessing"/>
+            <to state="state.fix.volmer.qs"/>
+        </transition>
+
+        <state id="state.fix.volmer.qs" description="state.fix.volmer.qs"
+            state="de.intevation.flys.artifacts.states.fixation.QSelect">
+            <data name="qs" type="Double[]"/>
+        </state>
+
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.fix.volmer.qs"/>
+            <to state="state.fix.volmer.compute"/>
+        </transition>
+
+        <state id="state.fix.volmer.compute"
+            description="state.fix.volmer.compute"
+            state="de.intevation.flys.artifacts.states.fixation.FixationVolmerCompute">
+            <outputmodes>
+                <outputmode>
+                    <facets>
+                        <facet/>
+                    </facets>
+                </outputmode>
+            </outputmodes>
+        </state>
+    </states>
+</artifact>
--- a/flys-artifacts/doc/conf/conf.xml	Thu Apr 26 13:38:56 2012 +0000
+++ b/flys-artifacts/doc/conf/conf.xml	Thu Apr 26 15:08:51 2012 +0000
@@ -86,6 +86,9 @@
             <artifact-factory name="manualpoints" description="Factory to create an artifact for storing and editing points added by the user."
                 ttl="3600000"
                 artifact="de.intevation.flys.artifacts.ManualPointsArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
+            <artifact-factory name="fixanalysis" description="Factory to create an artifact to be used in fixation analysis."
+                ttl="3600000"
+                artifact="de.intevation.flys.artifacts.FixationArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
         </artifact-factories>
 
         <user-factory name="default" description="Factory to create new users">de.intevation.artifactdatabase.DefaultUserFactory</user-factory>
@@ -166,6 +169,7 @@
         <artifact name="new_map" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/map.xml" />
         <artifact name="new_chart" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/chart.xml" />
         <artifact name="staticwqkms" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/staticwqkms.xml" />
+        <artifact name="fixanalysis" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="${artifacts.config.dir}/artifacts/fixanalysis.xml" />
     </artifacts>
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FixationArtifact.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,176 @@
+package de.intevation.flys.artifacts;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.common.utils.XMLUtils;
+import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;
+import de.intevation.artifacts.common.ArtifactNamespaceContext;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+import de.intevation.artifactdatabase.state.State;
+import de.intevation.artifactdatabase.state.StateEngine;
+import de.intevation.artifactdatabase.state.Output;
+import de.intevation.artifactdatabase.transition.TransitionEngine;
+
+import de.intevation.flys.artifacts.model.FacetTypes;
+import de.intevation.flys.artifacts.context.FLYSContext;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+import de.intevation.flys.utils.FLYSUtils;
+
+/**
+ * The default fixation analysis artifact.
+ *
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class FixationArtifact
+extends      FLYSArtifact
+implements   FacetTypes {
+
+    /** The logger for this class. */
+    private static Logger logger = Logger.getLogger(FixationArtifact.class);
+
+    /** The name of the artifact. */
+    public static final String ARTIFACT_NAME = "fixanalysis";
+
+    /**
+     * The default constructor.
+     */
+    public FixationArtifact() {
+    }
+
+    /**
+     * Returns the name of the concrete artifact.
+     *
+     * @return the name of the concrete artifact.
+     */
+    public String getName() {
+        return ARTIFACT_NAME;
+    }
+
+    public Document describe(Document data, CallContext context) {
+        logger.debug("Describe: the current state is: " + getCurrentStateId());
+
+        if (logger.isDebugEnabled()) {
+            dumpArtifact();
+        }
+
+        FLYSContext flysContext = FLYSUtils.getFlysContext(context);
+
+        StateEngine stateEngine = (StateEngine) flysContext.get(
+            FLYSContext.STATE_ENGINE_KEY);
+
+        TransitionEngine transitionEngine = (TransitionEngine) flysContext.get(
+            FLYSContext.TRANSITION_ENGINE_KEY);
+
+        List<State> reachable = transitionEngine.getReachableStates(
+            this, getCurrentState(context), stateEngine);
+
+        Document description            = XMLUtils.newDocument();
+        XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
+            description,
+            ArtifactNamespaceContext.NAMESPACE_URI,
+            ArtifactNamespaceContext.NAMESPACE_PREFIX);
+
+        Element root = ProtocolUtils.createRootNode(creator);
+        description.appendChild(root);
+
+        State current = getCurrentState(context);
+
+        ProtocolUtils.appendDescribeHeader(creator, root, identifier(), hash());
+        ProtocolUtils.appendState(creator, root, current);
+        ProtocolUtils.appendReachableStates(creator, root, reachable);
+
+        Element ui = ProtocolUtils.createArtNode(
+            creator, "ui", null, null);
+
+        Element staticUI  = ProtocolUtils.createArtNode(
+            creator, "static", null, null);
+
+        Element outs = ProtocolUtils.createArtNode(
+            creator, "outputmodes", null, null);
+        appendOutputModes(description, outs, context, identifier());
+
+        appendStaticUI(description, staticUI, context, identifier());
+
+
+        Element name = ProtocolUtils.createArtNode(
+            creator, "name",
+            new String[] { "value" },
+            new String[] { getName() });
+
+        Element dynamic = current.describe(
+            this,
+            description,
+            root,
+            context,
+            identifier());
+
+        if (dynamic != null) {
+            ui.appendChild(dynamic);
+        }
+
+        ui.appendChild(staticUI);
+
+        root.appendChild(name);
+        root.appendChild(ui);
+        root.appendChild(outs);
+
+        return description;
+    }
+
+
+    /**
+     * Append output mode nodes to a document.
+     */
+    protected void appendOutputModes(
+        Document    doc,
+        Element     outs,
+        CallContext context,
+        String      uuid)
+    {
+        List<Output> generated = getOutputs(context);
+        logger.debug("This Artifact has " + generated.size() + " Outputs.");
+
+        ProtocolUtils.appendOutputModes(doc, outs, generated);
+    }
+
+
+    /**
+     * This method appends the static data - that has already been inserted by
+     * the user - to the static node of the DESCRIBE document.
+     *
+     * @param doc The document.
+     * @param ui The root node.
+     * @param context The CallContext.
+     * @param uuid The identifier of the artifact.
+     */
+    protected void appendStaticUI(
+        Document    doc,
+        Node        ui,
+        CallContext context,
+        String uuid)
+    {
+        List<String> stateIds = getPreviousStateIds();
+
+        FLYSContext flysContext = FLYSUtils.getFlysContext(context);
+        StateEngine engine      = (StateEngine) flysContext.get(
+            FLYSContext.STATE_ENGINE_KEY);
+
+        for (String stateId: stateIds) {
+            logger.debug("Append static data for state: " + stateId);
+            DefaultState state = (DefaultState) engine.getState(stateId);
+
+            ui.appendChild(state.describeStatic(this, doc, ui, context, uuid));
+        }
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/AnalysisPeriods.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,99 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class AnalysisPeriods extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(AnalysisPeriods.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public AnalysisPeriods() {
+    }
+
+
+    /**
+     * Initialize the state based on the state node in the configuration.
+     *
+     * @param config The state configuration node.
+     */
+    public void setup(Node config) {
+        super.setup(config);
+    }
+
+
+    protected Element createData(
+        XMLUtils.ElementCreator cr,
+        Artifact    artifact,
+        StateData   data,
+        CallContext context)
+    {
+        Element select = ProtocolUtils.createArtNode(
+            cr, "select",
+            new String[] { "uiprovider" },
+            new String[] { "time_range_selector" });
+        cr.addAttr(select, "name", data.getName(), true);
+
+        Element label = ProtocolUtils.createArtNode(
+            cr, "label", null, null);
+
+        select.appendChild(label);
+
+        label.setTextContent(Resources.getMsg(
+            context.getMeta(),
+            getID(),
+            getID()));
+
+        return select;
+    }
+
+
+    @Override
+    protected Element[] createItems(
+        XMLUtils.ElementCreator cr,
+        Artifact    artifact,
+        String      name,
+        CallContext context)
+    {
+        return null;
+    }
+
+
+    protected Object getLower(FLYSArtifact artifact) {
+        return null;
+    }
+
+
+    protected Object getUpper(FLYSArtifact artifact) {
+        return null;
+    }
+
+
+    @Override
+    protected String getUIProvider() {
+        return "time_range_selector";
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationCompute.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class FixationCompute extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(FixationCompute.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public FixationCompute() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationPeriod.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class FixationPeriod extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(FixationPeriod.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public FixationPeriod() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationSelect.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,79 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+import de.intevation.artifacts.CallMeta;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class FixationSelect extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(FixationSelect.class);
+
+
+    /** Constant value for the default fixation calculation. */
+    public static final String CALCULATION_DEFAULT = "calc.fixation.default";
+
+    /** Constant value for the volmer fixation analysis. */
+    public static final String CALCULATION_VOLMER = "calc.fixation.volmer";
+
+    /** An Array that holds all available calculation modes.*/
+    public static final String[] CALCULATIONS = {
+        CALCULATION_DEFAULT,
+        CALCULATION_VOLMER
+    };
+
+    /** Error message that is thrown if no mode has been chosen. */
+    public static final String ERROR_NO_CALCULATION_MODE =
+        "error_feed_no_calculation_mode";
+
+    /** Error message that is thrown if an invalid calculation mode has been
+     * chosen. */
+    public static  final String ERROR_INVALID_CALCULATION_MODE =
+        "error_feed_invalid_calculation_mode";
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public FixationSelect() {
+    }
+
+
+    @Override
+    protected Element[] createItems(
+        XMLUtils.ElementCreator ec,
+        Artifact                artifact,
+        String                  name,
+        CallContext             context)
+    {
+        CallMeta meta = context.getMeta();
+        Element[] calculations = new Element[CALCULATIONS.length];
+
+        for (int i = 0; i < CALCULATIONS.length; i++) {
+            String calc = CALCULATIONS[i];
+            calculations[i] = createItem(
+                ec,
+                new String[] {Resources.getMsg(meta, calc, calc), calc});
+        }
+        return calculations;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixationVolmerCompute.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class FixationVolmerCompute extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(FixationVolmerCompute.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public FixationVolmerCompute() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FunctionSelect.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class FunctionSelect extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(FunctionSelect.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public FunctionSelect() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/GaugeRange.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class GaugeRange extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(GaugeRange.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public GaugeRange() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/LocationSelect.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,71 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.utils.FLYSUtils;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.RangeState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class LocationSelect extends RangeState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(LocationSelect.class);
+
+    private static final String LOWER = "from";
+
+    private static final String UPPER = "to";
+
+    private static final String STEP = "step";
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public LocationSelect() {
+    }
+
+    @Override
+    protected String getUIProvider() {
+        return "fix.location_panel";
+    }
+
+    @Override
+    protected double[] getMinMax(Artifact artifact) {
+        FLYSArtifact flysArtifact = (FLYSArtifact) artifact;
+        return FLYSUtils.getRiverMinMax(flysArtifact);
+    }
+
+    @Override
+    protected String getLowerField() {
+        return LOWER;
+    }
+
+    @Override
+    protected String getUpperField() {
+        return UPPER;
+    }
+
+    @Override
+    protected String getStepField() {
+        return STEP;
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/PreprocessingSelect.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class PreprocessingSelect extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(PreprocessingSelect.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public PreprocessingSelect() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/QSelect.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class QSelect extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(QSelect.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public QSelect() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/ReferencePeriod.java	Thu Apr 26 15:08:51 2012 +0000
@@ -0,0 +1,37 @@
+package de.intevation.flys.artifacts.states.fixation;
+
+import org.apache.log4j.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import de.intevation.artifacts.Artifact;
+import de.intevation.artifacts.CallContext;
+
+import de.intevation.artifacts.common.utils.XMLUtils;
+
+import de.intevation.artifactdatabase.ProtocolUtils;
+import de.intevation.artifactdatabase.data.StateData;
+
+import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class ReferencePeriod extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(ReferencePeriod.class);
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public ReferencePeriod() {
+    }
+
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/flys-artifacts/src/main/resources/messages.properties	Thu Apr 26 13:38:56 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages.properties	Thu Apr 26 15:08:51 2012 +0000
@@ -18,6 +18,8 @@
 state.winfo.historicalq.mode = Selecion of analyses
 state.winfo.reference.curve.input.start = Chosen Reference
 state.winfo.reference.curve.input.end = Chosen Evaluation
+state.fix.river = River
+state.fix.calculation.mode = Calculation Mode
 
 historical.mode.w = Waterlevel Analyse
 historical.mode.q = Discharge Analyse
@@ -30,6 +32,8 @@
 calc.w.differences = Differences
 calc.historical.discharge.curve = Historical Discharge Curve
 calc.reference.curve = Reference Curve
+calc.fixation.default = Fixation
+calc.fixation.volmer = Balanced Waterlevel
 
 state.chart.river = River
 state.chart.type = Charttype
--- a/flys-artifacts/src/main/resources/messages_de.properties	Thu Apr 26 13:38:56 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de.properties	Thu Apr 26 15:08:51 2012 +0000
@@ -18,6 +18,8 @@
 state.winfo.historicalq.mode = Wahl der Analyseart
 state.winfo.reference.curve.input.start = Bezugsort
 state.winfo.reference.curve.input.end = Zielort(e)
+state.fix.river = Gew\u00e4sser
+state.fix.calculation.mode = Berechnungsart
 
 historical.mode.w = Wasserstandsanalyse
 historical.mode.q = Abflussanalyse
@@ -30,6 +32,8 @@
 calc.w.differences = Differenzen
 calc.historical.discharge.curve = Hist. Abflusskurven
 calc.reference.curve = Bezugslinie
+calc.fixation.default = Fixierungsanalyse
+calc.fixation.volmer = Ausgeglichene Wasserspiegellage
 
 state.chart.river = Gew\u00e4sser
 state.chart.type = Diagrammtyp
--- a/flys-artifacts/src/main/resources/messages_de_DE.properties	Thu Apr 26 13:38:56 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_de_DE.properties	Thu Apr 26 15:08:51 2012 +0000
@@ -18,6 +18,8 @@
 state.winfo.historicalq.mode = Wahl der Analyseart
 state.winfo.reference.curve.input.start = Bezugsort
 state.winfo.reference.curve.input.end = Zielort(e)
+state.fix.river = Gew\u00e4sser
+state.fix.calculation.mode = Berechnungsart
 
 historical.mode.w = Wasserstandsanalyse
 historical.mode.q = Abflussanalyse
--- a/flys-artifacts/src/main/resources/messages_en.properties	Thu Apr 26 13:38:56 2012 +0000
+++ b/flys-artifacts/src/main/resources/messages_en.properties	Thu Apr 26 15:08:51 2012 +0000
@@ -18,6 +18,8 @@
 state.winfo.historicalq.mode = Selecion of analyses
 state.winfo.reference.curve.input.start = Chosen Reference
 state.winfo.reference.curve.input.end = Chosen Evaluation
+state.fix.river = River
+state.fix.calculation.mode = Calculation Mode
 
 historical.mode.w = Waterlevel Analyse
 historical.mode.q = Discharge Analyse
@@ -30,6 +32,8 @@
 calc.w.differences = Differences
 calc.historical.discharge.curve = Historical Discharge Curve
 calc.reference.curve = Reference Curve
+calc.fixation.default = Fixation
+calc.fixation.volmer = Balanced Waterlevel
 
 state.chart.river = River
 state.chart.type = Charttype

http://dive4elements.wald.intevation.org