changeset 4058:174ff436971b

Added Percentage-Input state to extreme value analysis state model.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 08 Oct 2012 12:09:26 +0200
parents c3b959de4d83
children c63f0b4ac1b4
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/winfo.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/extreme/PercentInput.java
diffstat 3 files changed, 65 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Mon Oct 08 11:01:20 2012 +0200
+++ b/flys-artifacts/ChangeLog	Mon Oct 08 12:09:26 2012 +0200
@@ -1,3 +1,11 @@
+2012-10-08	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* flys-artifacts/doc/conf/artifacts/winfo.xm: Introduce another
+	  dummyish state for extreme value analysis.
+
+	* flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/extreme/PercentInput.java:
+	  New State to get percentage as input.
+
 2012-10-08	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* flys-artifacts/doc/conf/artifacts/winfo.xm: Introduce dummyish states for
--- a/flys-artifacts/doc/conf/artifacts/winfo.xml	Mon Oct 08 11:01:20 2012 +0200
+++ b/flys-artifacts/doc/conf/artifacts/winfo.xml	Mon Oct 08 12:09:26 2012 +0200
@@ -172,10 +172,16 @@
 
         <transition transition="de.intevation.flys.artifacts.transitions.ValueCompareTransition">
             <from state="state.winfo.function_select"/>
-            <to state="state.winfo.extreme.curve"/>
+            <to state="state.winfo.extreme.percent"/>
             <condition data="calculation_mode" value="calc.extreme.curve" operator="equal"/>
         </transition>
 
+        <transition transition="de.intevation.flys.artifacts.transitions.DefaultTransition">
+            <from state="state.winfo.extreme.percent"/>
+            <to state="state.winfo.extreme.curve"/>
+        </transition>
+
+
         <state id="state.winfo.wq" description="state.winfo.wq" state="de.intevation.flys.artifacts.states.WQSelect" helpText="help.winfo.wsp.wq">
             <data name="wq_isq" type="Boolean" />
             <data name="wq_isfree" type="Boolean" />
@@ -582,6 +588,12 @@
             <data name="function" type="String"/>
         </state>
 
+        <state id="state.winfo.extreme.percent"
+            description="state.winfo.extreme.percent"
+            state="de.intevation.flys.artifacts.states.extreme.PercentInput">
+            <data name="percent" type="Double"/>
+        </state>
+
         <state id="state.winfo.extreme.curve" description="state.winfo.extreme.curve" state="de.intevation.flys.artifacts.states.extreme.ExtremeCompute" helpText="https://flys-intern.intevation.de/Flys-3.0">
             <outputmodes>
                 <outputmode name="longitudinal_section" description="output.longitudinal_section" mime-type="image/png" type="chart">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/extreme/PercentInput.java	Mon Oct 08 12:09:26 2012 +0200
@@ -0,0 +1,44 @@
+package de.intevation.flys.artifacts.states.extreme;
+
+import org.apache.log4j.Logger;
+
+import de.intevation.artifactdatabase.data.StateData;
+import de.intevation.artifacts.CallContext;
+import de.intevation.flys.artifacts.states.DefaultState;
+
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class PercentInput extends DefaultState {
+
+    /** The logger used in this class. */
+    private static Logger logger = Logger.getLogger(PercentInput.class);
+
+    public static final String PARAMETER_NAME = "percent";
+
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public PercentInput () {
+    }
+
+
+    /** Tell UI what to display for input. */
+    @Override
+    protected String getUIProvider() {
+        return "percent_input";
+    }
+
+
+    @Override
+    protected String[] getDefaultsFor(CallContext context, StateData data) {
+        if (data != null && data.getName().equals(PARAMETER_NAME)) {
+            return new String[] {"5", "5"};
+        }
+
+        return null;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org