changeset 9073:cd650cacc926

work on bundu.bezugswst states
author gernotbelger
date Thu, 17 May 2018 13:06:12 +0200
parents 02739b8c010d
children 766890addcb2
files artifacts/doc/conf/artifacts/bundu.xml artifacts/doc/conf/artifacts/sinfo.xml artifacts/doc/conf/artifacts/uinfo.xml artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/FixationChoice.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadEpochSelect.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadMultipleEpochSelectState.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadMultipleYearSelectState.java artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadYearSelect.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/LoadSingleYearSelectState.java artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/LoadYearSelect.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java gwt-client/src/main/java/org/dive4elements/river/client/shared/model/BUNDUArtifact.java
diffstat 14 files changed, 193 insertions(+), 132 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/artifacts/bundu.xml	Wed May 16 17:43:47 2018 +0200
+++ b/artifacts/doc/conf/artifacts/bundu.xml	Thu May 17 13:06:12 2018 +0200
@@ -324,8 +324,31 @@
     </transition>
 
 
-    <state id="state.bundu.yearselect" helpText="state.bundu.yearselect" description="state.bundu.yearselect" state="org.dive4elements.river.artifacts.uinfo.inundationduration.LoadYearSelect">
-      <data name="yearselect" type="String" />
+    <state id="state.bundu.yearselect" helpText="state.bundu.yearselect" description="state.bundu.yearselect" state="org.dive4elements.river.artifacts.states.LoadSingleYearSelectState">
+      <data name="singleyear" type="String" />
     </state>
+
+
+    <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
+      <from state="state.bundu.yearselect" />
+      <to state="state.bundu.fixationchoice" />
+      <condition data="calculation_mode" value="bundu_bezugswst" operator="equal" />
+    </transition>
+
+    <state id="state.bundu.fixationchoice" helpText="state.bundu.fixationchoice" description="state.bundu.fixationchoice" state="org.dive4elements.river.artifacts.bundu.bezugswst.FixationChoice">
+      <data name="fix_choice" type="String" />
+    </state>
+ 
+   
+   <!-- <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
+      <from state="state.bundu.fixationchoice" />
+      <to state="state.bundu.yearselect" />
+      <condition data="fix_choice" value="bundu_bezugswst" operator="equal" />
+    </transition>
+    TODO: to be continued -->  
+
+
+
+
   </states>
 </artifact>
--- a/artifacts/doc/conf/artifacts/sinfo.xml	Wed May 16 17:43:47 2018 +0200
+++ b/artifacts/doc/conf/artifacts/sinfo.xml	Thu May 17 13:06:12 2018 +0200
@@ -250,11 +250,11 @@
 
 
 
-    <state id="state.sinfo.load.year" description="state.sinfo.load.year" state="org.dive4elements.river.artifacts.sinfo.collision.LoadYearSelect" helpText="help.state.sinfo.load.year">
+    <state id="state.sinfo.load.year" description="state.sinfo.load.year" state="org.dive4elements.river.artifacts.sinfo.collision.LoadMultipleYearSelectState" helpText="help.state.sinfo.load.year">
       <data name="years" type="String" />
     </state>
 
-    <state id="state.sinfo.load.epoch" description="state.sinfo.load.epoch" state="org.dive4elements.river.artifacts.sinfo.collision.LoadEpochSelect" helpText="help.state.sinfo.load.epoch">
+    <state id="state.sinfo.load.epoch" description="state.sinfo.load.epoch" state="org.dive4elements.river.artifacts.sinfo.collision.LoadMultipleEpochSelectState" helpText="help.state.sinfo.load.epoch">
       <data name="epochs" type="String" />
     </state>
 
--- a/artifacts/doc/conf/artifacts/uinfo.xml	Wed May 16 17:43:47 2018 +0200
+++ b/artifacts/doc/conf/artifacts/uinfo.xml	Thu May 17 13:06:12 2018 +0200
@@ -142,7 +142,7 @@
     </state>
 
 
-    <state id="state.uinfo.load.year" description="state.uinfo.load.year" state="org.dive4elements.river.artifacts.uinfo.inundationduration.LoadYearSelect" helpText="help.state.uinfo.load.year">
+    <state id="state.uinfo.load.year" description="state.uinfo.load.year" state="org.dive4elements.river.artifacts.states.LoadSingleYearSelectState" helpText="help.state.uinfo.load.year">
       <data name="singleyear" type="String" />
     </state>
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/FixationChoice.java	Thu May 17 13:06:12 2018 +0200
@@ -0,0 +1,34 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.bundu.bezugswst;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.dive4elements.river.artifacts.states.RadioSelect;
+
+/**
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class FixationChoice extends RadioSelect {
+    private static final long serialVersionUID = 1L;
+
+    public FixationChoice() {
+        super();
+    }
+
+    @Override
+    protected List<String> makeEntries() {
+        final List<String> entries = new ArrayList<>();
+        entries.add("state.bundu.fix.auto");
+        entries.add("state.bundu.fix.manual");
+        return entries;
+
+    }
+}
\ No newline at end of file
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadEpochSelect.java	Wed May 16 17:43:47 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.collision;
-
-import org.apache.log4j.Logger;
-import org.dive4elements.river.artifacts.states.DefaultState;
-
-public class LoadEpochSelect extends DefaultState {
-    /** The log used in this class. */
-    private static Logger log = Logger.getLogger(LoadEpochSelect.class);
-
-    /**
-     * The default constructor that initializes an empty State object.
-     */
-    public LoadEpochSelect() {
-    }
-
-    @Override
-    protected String getUIProvider() {
-        return "sinfo.collision.load_epoch_select";
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadMultipleEpochSelectState.java	Thu May 17 13:06:12 2018 +0200
@@ -0,0 +1,28 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.collision;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.river.artifacts.states.DefaultState;
+
+public class LoadMultipleEpochSelectState extends DefaultState {
+    /** The log used in this class. */
+    private static Logger log = Logger.getLogger(LoadMultipleEpochSelectState.class);
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public LoadMultipleEpochSelectState() {
+    }
+
+    @Override
+    protected String getUIProvider() {
+        return "sinfo.collision.load_epoch_select";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadMultipleYearSelectState.java	Thu May 17 13:06:12 2018 +0200
@@ -0,0 +1,49 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.sinfo.collision;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.artifacts.Artifact;
+import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
+import org.dive4elements.river.artifacts.states.DefaultState;
+
+/** State in which to fetch years for sedminent load calculation. */
+public class LoadMultipleYearSelectState extends DefaultState {
+    private static final long serialVersionUID = 1L;
+    /** The log used in this class. */
+    private static Logger log = Logger.getLogger(LoadMultipleYearSelectState.class);
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public LoadMultipleYearSelectState() {
+    }
+
+    /** Year Select Widget. */
+    @Override
+    protected String getUIProvider() {
+        return "minfo.sedimentload_year_select"; // TODO: eigenes Panel oder allgemeineren Code
+    }
+
+    @Override
+    public boolean validate(final Artifact artifact) throws IllegalArgumentException {
+        // TODO: check verstehen
+
+        final CollisionAccess access = new CollisionAccess((SINFOArtifact) artifact);
+
+        // Second year should be later than first.
+
+        if (access.getYears() == null || access.getYears().length == 0)
+            return true;
+        // throw new IllegalArgumentException("error_years_wrong");
+
+        return true;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/LoadYearSelect.java	Wed May 16 17:43:47 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.sinfo.collision;
-
-import org.apache.log4j.Logger;
-import org.dive4elements.artifacts.Artifact;
-import org.dive4elements.river.artifacts.sinfo.SINFOArtifact;
-import org.dive4elements.river.artifacts.states.DefaultState;
-
-/** State in which to fetch years for sedminent load calculation. */
-public class LoadYearSelect extends DefaultState {
-    private static final long serialVersionUID = 1L;
-    /** The log used in this class. */
-    private static Logger log = Logger.getLogger(LoadYearSelect.class);
-
-    /**
-     * The default constructor that initializes an empty State object.
-     */
-    public LoadYearSelect() {
-    }
-
-    /** Year Select Widget. */
-    @Override
-    protected String getUIProvider() {
-        return "minfo.sedimentload_year_select"; // TODO: eigenes Panel oder allgemeineren Code
-    }
-
-    @Override
-    public boolean validate(final Artifact artifact) throws IllegalArgumentException {
-        // TODO: check verstehen
-
-        final CollisionAccess access = new CollisionAccess((SINFOArtifact) artifact);
-
-        // Second year should be later than first.
-
-        if (access.getYears() == null || access.getYears().length == 0)
-            return true;
-        // throw new IllegalArgumentException("error_years_wrong");
-
-        return true;
-    }
-}
-// 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/artifacts/src/main/java/org/dive4elements/river/artifacts/states/LoadSingleYearSelectState.java	Thu May 17 13:06:12 2018 +0200
@@ -0,0 +1,45 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.states;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.artifacts.Artifact;
+
+/** State in which to fetch years for sedminent load calculation. */
+public class LoadSingleYearSelectState extends DefaultState {
+    private static final long serialVersionUID = 1L;
+    /** The log used in this class. */
+    private static Logger log = Logger.getLogger(LoadSingleYearSelectState.class);
+
+    /**
+     * The default constructor that initializes an empty State object.
+     */
+    public LoadSingleYearSelectState() {
+    }
+
+    /** Year Select Widget. */
+    @Override
+    protected String getUIProvider() {
+        return "common.state.load_single_year_select";
+    }
+
+    @Override
+    public boolean validate(final Artifact artifact) throws IllegalArgumentException {
+        return true;
+        // final CollisionLoadYearEpochAccess access = new CollisionLoadYearEpochAccess((D4EArtifact) artifact);
+        //
+        // // Second year should be later than first.
+        // if (access.getYears() == null || access.getYears().length == 0)
+        // return true; // TODO: richtig in CollisionLoadYear... implementieren
+        // // throw new IllegalArgumentException("error_years_wrong");
+        //
+        // return true;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/LoadYearSelect.java	Wed May 16 17:43:47 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
- * Software engineering by Intevation GmbH
- *
- * This file is Free Software under the GNU AGPL (>=v3)
- * and comes with ABSOLUTELY NO WARRANTY! Check out the
- * documentation coming with Dive4Elements River for details.
- */
-
-package org.dive4elements.river.artifacts.uinfo.inundationduration;
-
-import org.apache.log4j.Logger;
-import org.dive4elements.artifacts.Artifact;
-import org.dive4elements.river.artifacts.states.DefaultState;
-
-/** State in which to fetch years for sedminent load calculation. */
-public class LoadYearSelect extends DefaultState {
-    private static final long serialVersionUID = 1L;
-    /** The log used in this class. */
-    private static Logger log = Logger.getLogger(LoadYearSelect.class);
-
-    /**
-     * The default constructor that initializes an empty State object.
-     */
-    public LoadYearSelect() {
-    }
-
-    /** Year Select Widget. */
-    @Override
-    protected String getUIProvider() {
-        return "uinfo.inundationduration.load_year_select";
-    }
-
-    @Override
-    public boolean validate(final Artifact artifact) throws IllegalArgumentException {
-        return true;
-        // final CollisionLoadYearEpochAccess access = new CollisionLoadYearEpochAccess((D4EArtifact) artifact);
-        //
-        // // Second year should be later than first.
-        // if (access.getYears() == null || access.getYears().length == 0)
-        // return true; // TODO: richtig in CollisionLoadYear... implementieren
-        // // throw new IllegalArgumentException("error_years_wrong");
-        //
-        // return true;
-    }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/artifacts/src/main/resources/messages.properties	Wed May 16 17:43:47 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Thu May 17 13:06:12 2018 +0200
@@ -1100,6 +1100,9 @@
 state.bundu.vollmer.preprocessing = Outliers
 state.bundu.vollmer.qs = Input for W/Q data
 state.bundu.yearselect = Bezugsjahr
+state.bundu.fix.auto = Automatische Auswahl 
+state.bundu.fix.manual = Manuelle Auswahl
+state.bundu.fixationchoice = Fixierungen
 
 help.state.bundu.river=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.river
 help.state.bundu.calculation.mode=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.calculation.mode
--- a/artifacts/src/main/resources/messages_de.properties	Wed May 16 17:43:47 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Thu May 17 13:06:12 2018 +0200
@@ -1100,6 +1100,9 @@
 state.bundu.vollmer.preprocessing = Ausrei\u00dfer
 state.bundu.vollmer.qs = Eingabe f\u00fcr W/Q Daten
 state.bundu.yearselect = Bezugsjahr
+state.bundu.fix.auto = Automatische Auswahl 
+state.bundu.fix.manual = Manuelle Auswahl
+state.bundu.fixationchoice = Fixierungen
 
 help.state.bundu.river=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.river
 help.state.bundu.calculation.mode=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.calculation.mode
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Wed May 16 17:43:47 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Thu May 17 13:06:12 2018 +0200
@@ -135,7 +135,7 @@
         } else if (uiProvider.equals("parameter-matrix")) {
             return new ParameterMatrixPanel();
         } else if (uiProvider.equals("minfo.bed.year_epoch")) {
-            return new RadioPanel();
+            return new RadioPanel(); // legacy
         } else if (uiProvider.equals("radio_panel")) {
             return new RadioPanel();
         } else if (uiProvider.equals("bedquality_periods_select")) {
@@ -158,7 +158,7 @@
             return new CollisionLoadEpochPanel();
         } else if (uiProvider.equals("uinfo.inundation_duration.load_epoch_select")) {
             return new InundationDurLoadEpochPanel();
-        } else if (uiProvider.equals("uinfo.inundationduration.load_year_select")) {
+        } else if (uiProvider.equals("common.state.load_single_year_select")) {
             return new LoadSingleYearPanel();
         } else if (uiProvider.equals("uinfo.inundationduration.load_totalepoch_select")) {
             return new LoadSingleEpochPanel();
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/BUNDUArtifact.java	Wed May 16 17:43:47 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/BUNDUArtifact.java	Thu May 17 13:06:12 2018 +0200
@@ -42,5 +42,4 @@
 
         return "state.bundu.eventselect"; // mit bundu.xml im server synchron halten :-(
     }
-}
-// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
+}
\ No newline at end of file

http://dive4elements.wald.intevation.org