changeset 9273:1b2623dff742

salix another review
author gernotbelger
date Thu, 19 Jul 2018 17:32:27 +0200
parents 1d59da89b00d
children 1c8eeaf6031f
files artifacts/doc/conf/artifacts/uinfo.xml artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/LoadScenarioSelect.java artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/LoadScenarioSelectLimit5.java artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java
diffstat 10 files changed, 58 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/artifacts/uinfo.xml	Thu Jul 19 16:37:04 2018 +0200
+++ b/artifacts/doc/conf/artifacts/uinfo.xml	Thu Jul 19 17:32:27 2018 +0200
@@ -144,7 +144,7 @@
       <condition data="calculation_mode" value="uinfo_salix_line" operator="equal" />
     </transition>
 
-    <state id="state.uinfo.inundation.scenario.regional" description="state.uinfo.inundation.scenario.regional" state="org.dive4elements.river.artifacts.uinfo.salix.LoadScenarioSelectLimit5" helpText="help.state.uinfo.use_scenario">
+    <state id="state.uinfo.inundation.load.scenario.regional" description="state.uinfo.inundation.load.scenario.regional" state="org.dive4elements.river.artifacts.uinfo.salix.LoadScenarioSelectLimit5" helpText="help.state.uinfo.use_scenario">
       <data name="sedimentheight" type="String" /> <!-- mittelwasserlage in cm! -->
     </state>
 
@@ -155,13 +155,13 @@
 
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
       <from state="state.uinfo.distance_only_part.from_regional" />
-      <to state="state.uinfo.inundation.scenario.regional" />
+      <to state="state.uinfo.inundation.load.scenario.regional" />
       <condition data="calculation_mode" value="uinfo_salix_line" operator="equal" />
     </transition>
 
 
     <transition transition="org.dive4elements.river.artifacts.transitions.ValueCompareTransition">
-      <from state="state.uinfo.inundation.scenario.regional" />
+      <from state="state.uinfo.inundation.load.scenario.regional" />
       <to state="state.uinfo.salix_line" />
       <condition data="calculation_mode" value="uinfo_salix_line" operator="equal" />
     </transition>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/LoadScenarioSelect.java	Thu Jul 19 16:37:04 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/inundationduration/LoadScenarioSelect.java	Thu Jul 19 17:32:27 2018 +0200
@@ -45,8 +45,7 @@
 
                 final AddTableDataHelper helper = new AddTableDataHelper(creator, select, "cm", context.getMeta());
 
-                helper.addColumn(0, "pinfrom", "40", "common.client.ui.from", "ICON", "CENTER", "from");
-                // helper.addColumn(1, "pinto", "40", "common.client.ui.to", "ICON", "CENTER", "to");
+                helper.addColumn(0, "pinfrom", "60", "common.client.ui.selection", "ICON", "CENTER", "from");
                 helper.addColumn(1, "cm", "60", "Delta [cm]", "INTEGER", "RIGHT", null);
 
                 for (int i = -200; i < 210; i = i + 10) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/LoadScenarioSelectLimit5.java	Thu Jul 19 16:37:04 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/LoadScenarioSelectLimit5.java	Thu Jul 19 17:32:27 2018 +0200
@@ -12,8 +12,10 @@
 import java.util.Map;
 
 import org.apache.log4j.Logger;
+import org.dive4elements.artifactdatabase.data.StateData;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.common.utils.XMLUtils;
 import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator;
 import org.dive4elements.river.artifacts.states.AddTableDataHelper;
 import org.dive4elements.river.artifacts.states.DefaultState;
@@ -39,13 +41,15 @@
 
     @Override
     protected void appendItems(final Artifact artifact, final ElementCreator creator, final String name, final CallContext context, final Element select) {
+
+        // the client is expecting helper input. bad abstraction. the table does not appear, only because no columns are added.
+        // TODO Implement abstraction without helper on client side and then delete this method
         final String datakey = "sedimentheight";
-
         try {
             if (datakey.equals(name)) {
 
                 final AddTableDataHelper helper = new AddTableDataHelper(creator, select, "cm", context.getMeta());
-                for (int i = -200; i < 210; i = i + 10) {
+                for (int i = -200; i < -100; i = i + 10) {
                     final Map<String, String> row = new HashMap<>();
                     row.put("cm", Integer.toString(i));
                     helper.addRow(row);
@@ -59,9 +63,9 @@
     }
 
     @Override
-    public boolean validate(final Artifact artifact) throws IllegalArgumentException {
-        return true;
+    protected Element createData(final XMLUtils.ElementCreator cr, final Artifact artifact, final StateData data, final CallContext context) {
+        return ScenarioTypeState.changeHeaderForCurrentState("state.uinfo.inundation.scenario.regional", data.getName(), cr, context);
+    }
 
-    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java	Thu Jul 19 16:37:04 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/salix/ScenarioTypeState.java	Thu Jul 19 17:32:27 2018 +0200
@@ -9,6 +9,7 @@
 import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.artifacts.CallMeta;
 import org.dive4elements.artifacts.common.utils.XMLUtils;
+import org.dive4elements.artifacts.common.utils.XMLUtils.ElementCreator;
 import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.artifacts.states.RadioSelect;
 import org.w3c.dom.Element;
@@ -35,13 +36,19 @@
 
     @Override
     protected Element createData(final XMLUtils.ElementCreator cr, final Artifact artifact, final StateData data, final CallContext context) {
+        return changeHeaderForCurrentState("state.uinfo.load.scenario_type", data.getName(), cr, context);
+    }
+
+    /// dieser nervige Teil dient lediglich dazu, in create() im client die Überschrift zu ändern... :-(
+    // Die Überschrift soll anders sein als in createOld() (links)
+    public static final Element changeHeaderForCurrentState(final String msgKey, final String dataName, final ElementCreator cr, final CallContext context) {
         final Element select = ProtocolUtils.createArtNode(cr, "select", null, null);
 
-        cr.addAttr(select, "name", data.getName(), true);
+        cr.addAttr(select, "name", dataName, true);
 
         final Element label = ProtocolUtils.createArtNode(cr, "label", null, null);
 
-        label.setTextContent(Resources.getMsg(context.getMeta(), "state.uinfo.load.scenario_type"));
+        label.setTextContent(Resources.getMsg(context.getMeta(), msgKey));
 
         final Element description = ProtocolUtils.createArtNode(cr, "description", null, null);
         description.setTextContent("TEST");
--- a/artifacts/src/main/resources/messages.properties	Thu Jul 19 16:37:04 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties	Thu Jul 19 17:32:27 2018 +0200
@@ -62,6 +62,7 @@
 state.minfo.bed.error.no_data = No data found for selected range.
 state.minfo.bed.error.no_data_for_period = No data found for period: {0} - {1}.
 state.minfo.soundings = Choose Soundings
+state.bundu.wst.soundings = Choose Soundings
 state.minfo.sediment.load.location = Range
 state.minfo.sediment.load.year_epoch = Year/Epoch
 state.minfo.sediment.load.epochs = Epochs
@@ -869,6 +870,7 @@
 state.sinfo.riverside.option3 = Beide Uferseiten
 help.state.sinfo.wspl= ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.riverside
 
+state.bundu.wst.qs = Eingabe f\u00fcr W/Q Daten
 state.sinfo.wqinput = Eingabe f\u00fcr W/Q Daten
 state.sinfo.wqinput.option = wqinput-option
 help.state.sinfo.wqinput = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wqinput
@@ -1055,6 +1057,7 @@
 
 state.uinfo.inundation.vegetation=Einteilung der Vegetationszonen und \u00dcberflutunsgdauern
 state.uinfo.inundation.use_scenario=Szenariobetrachtung
+state.uinfo.inundation.load.scenario.regional = \u00c4nderungen der MW-Spiegellage 
 state.uinfo.inundation.scenario.regional = Eingabe der \u00c4nderung der Mittelwasserspiegellage (bis zu 5 Werte m\u00f6glich)
 state.uinfo.inundation.scenario = Werte f\u00fcr \u00c4nderung der Sohl- bzw. Mittelwasserlage eingeben
 state.uinfo.use_scenario=Szenariobetrachtung
@@ -1070,6 +1073,7 @@
 scenarioType.option3 = Historische Betrachtung 
 help.state.uinfo.scenario_type=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.scenario_type
 
+state.bundu.load.distance_only_part= Teilabschnitt
 state.uinfo.distance_only_part.historical= Teilabschnitt
 state.uinfo.distance_only_part.from_regional= Teilabschnitt
 state.uinfo.distance_only_part = Teilabschnitt
@@ -1189,7 +1193,7 @@
 state.bundu.calc.auto = Automatische Auswahl
 state.bundu.calc.manual = Manuelle Auswahl
 state.bundu.wst.function = Auswahl der Ausgleichsfunktion
-state.bundu.wst.missing_volume = Ermittlung von Fehlvolumina
+state.bundu.wst.missing_volume.select = Ermittlung von Fehlvolumina durchf\u00fchren
 
 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
@@ -1207,9 +1211,16 @@
 help.state.bundu.vollmer.qs=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.vollmer.qs
 help.state.bundu.vollmer.compute=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.vollmer.compute
 
+state.bundu.wst.fix.load.year_length = L\u00e4nge der Abflusszeitreihe 
 state.bundu.wst.fix.year_length = L\u00e4nge der Abflusszeitreihe (Ausgehend vom Bezugsjahr in die Vergangenheit)
-state.bundu.wst.fix.year_length_short = L\u00e4nge der Abflusszeitreihe
 state.bundu.wst.calc_choice = Auswahl der Berechnungsgrundlagen
+state.bundu.wst.load.calc_choice = Berechnungsgrundlagen
+state.bundu.wst.preprocessing = Ausrei\u00dfertest Auswahl
+state.bundu.wst.load.preprocessing = Ausrei\u00dfertest
+state.bundu.wst.load.missing_volume = Ermittlung von Fehlvolumina
+state.bundu.wst.missing_volume = Ermittlung von Fehlvolumina?
+state.bundu.wst.load.function = Ausgleichsfunktion
+state.bundu.wst.function = Auswahl der Ausgleichsfunktion
 
 common.client.ui.selection = Selection
 common.client.ui.from = from
--- a/artifacts/src/main/resources/messages_de.properties	Thu Jul 19 16:37:04 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Thu Jul 19 17:32:27 2018 +0200
@@ -62,6 +62,7 @@
 state.minfo.bed.error.no_data = F\u00fcr die gew\u00e4hlte Strecke liegen keine Daten vor.
 state.minfo.bed.error.no_data_for_period = F\u00fcr den Zeitraum {0} - {1} liegen keine Daten vor.
 state.minfo.soundings = Wahl der Peilungen
+state.bundu.wst.soundings = Wahl der Peilungen
 state.minfo.sediment.load.location = Berechnungsstrecke
 state.minfo.sediment.load.year_epoch = Jahr/Zeitraum
 state.minfo.sediment.load.epochs = Epochen
@@ -869,6 +870,7 @@
 state.sinfo.riverside.option3 = Beide Uferseiten
 help.state.sinfo.wspl= ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.riverside
 
+state.bundu.wst.qs = Eingabe f\u00fcr W/Q Daten
 state.sinfo.wqinput = Eingabe f\u00fcr W/Q Daten
 state.sinfo.wqinput.option = wqinput-option
 help.state.sinfo.wqinput = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wqinput
@@ -1055,6 +1057,7 @@
 
 state.uinfo.inundation.vegetation=Einteilung der Vegetationszonen und \u00dcberflutunsgdauern
 state.uinfo.inundation.use_scenario=Szenariobetrachtung
+state.uinfo.inundation.load.scenario.regional = \u00c4nderungen der MW-Spiegellage 
 state.uinfo.inundation.scenario.regional = Eingabe der \u00c4nderung der Mittelwasserspiegellage (bis zu 5 Werte m\u00f6glich)
 state.uinfo.inundation.scenario = Werte f\u00fcr \u00c4nderung der Sohl- bzw. Mittelwasserlage eingeben
 state.uinfo.use_scenario=Szenariobetrachtung
@@ -1070,6 +1073,7 @@
 scenarioType.option3 = Historische Betrachtung 
 help.state.uinfo.scenario_type=${help.url}/OnlineHilfe/UINFO#help.state.uinfo.scenario_type
 
+state.bundu.load.distance_only_part= Teilabschnitt
 state.uinfo.distance_only_part.historical= Teilabschnitt
 state.uinfo.distance_only_part.from_regional= Teilabschnitt 
 state.uinfo.distance_only_part = Teilabschnitt
@@ -1189,7 +1193,7 @@
 state.bundu.calc.auto = Automatische Auswahl
 state.bundu.calc.manual = Manuelle Auswahl
 state.bundu.wst.function = Auswahl der Ausgleichsfunktion
-state.bundu.wst.missing_volume = Ermittlung von Fehlvolumina
+state.bundu.wst.missing_volume.select = Ermittlung von Fehlvolumina durchf\u00fchren
 
 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
@@ -1207,10 +1211,17 @@
 help.state.bundu.vollmer.qs=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.vollmer.qs
 help.state.bundu.vollmer.compute=${help.url}/OnlineHilfe/bunduierungsanalyse#help.state.bundu.vollmer.compute
 
+state.bundu.wst.fix.load.year_length = L\u00e4nge der Abflusszeitreihe 
 state.bundu.wst.fix.year_length = L\u00e4nge der Abflusszeitreihe (Ausgehend vom Bezugsjahr in die Vergangenheit)
-state.bundu.wst.fix.year_length_short = L\u00e4nge der Abflusszeitreihe
 state.bundu.wst.calc_choice = Auswahl der Berechnungsgrundlagen
-
+state.bundu.wst.load.calc_choice = Berechnungsgrundlagen
+state.bundu.wst.preprocessing = Ausrei\u00dfertest Auswahl
+state.bundu.wst.load.preprocessing = Ausrei\u00dfertest
+state.bundu.wst.load.missing_volume = Ermittlung von Fehlvolumina
+state.bundu.wst.missing_volume = Ermittlung von Fehlvolumina?
+state.bundu.wst.load.function = Ausgleichsfunktion
+state.bundu.wst.function = Auswahl der Ausgleichsfunktion
+ 
 common.client.ui.selection = Auswahl
 common.client.ui.from = von
 common.client.ui.to = bis
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Thu Jul 19 16:37:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Thu Jul 19 17:32:27 2018 +0200
@@ -1584,4 +1584,6 @@
     String bundu_bezugswst_fix_choice_title();
 
     String bundu_bezugswst_auto_event_choice();
+
+    String years_general();
 }
\ No newline at end of file
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Thu Jul 19 16:37:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Thu Jul 19 17:32:27 2018 +0200
@@ -535,6 +535,7 @@
 epochs = epochs
 off_epochs = official epochs
 densities = Sediment Densities
+years_general = years
 
 sediment_load = Sediment Load
 sediment_load_ls = Longitudinal sections
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Thu Jul 19 16:37:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Thu Jul 19 17:32:27 2018 +0200
@@ -535,6 +535,7 @@
 epochs = Epochen
 off_epochs = Amtliche Epochen
 densities = Sedimentdichte
+years_general = Jahre
 
 sediment_load = Sedimentfracht
 sediment_load_ls = L\u00e4ngsschnitte
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Thu Jul 19 16:37:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java	Thu Jul 19 17:32:27 2018 +0200
@@ -142,7 +142,11 @@
             return new FixEventSelect();
         } else if (uiProvider.equals("fix.preprocessing_panel")) {
             return new BooleanPanel();
-        } else if (uiProvider.equals("fix.functionselect")) {
+        } else if (uiProvider.equals("fix.missing_volume_panel")) {
+            return new BooleanPanel();
+        }
+
+        else if (uiProvider.equals("fix.functionselect")) {
             return new FixFunctionSelect();
         } else if (uiProvider.equals("period_select")) {
             return new PeriodPanel();

http://dive4elements.wald.intevation.org