# HG changeset patch
# User gernotbelger
# Date 1525432677 -7200
# Node ID ad2ae847e10e5d3fa3ec178a88888c9cd9afa943
# Parent a6c19528ac168a8844e7a764c691d01a875b0a7e
- RadioButton-Auswahl generisch
- Überflutungsdauern (inudation of infrastructures) Ablauf states
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/doc/conf/artifacts/sinfo.xml
--- a/artifacts/doc/conf/artifacts/sinfo.xml Thu May 03 14:57:31 2018 +0200
+++ b/artifacts/doc/conf/artifacts/sinfo.xml Fri May 04 13:17:57 2018 +0200
@@ -278,24 +278,23 @@
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
@@ -305,26 +304,29 @@
-
-
-
-
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
-
-
+
@@ -377,13 +379,16 @@
+
+
+
-
+
@@ -392,13 +397,13 @@
-
+
-
+
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/RiversideChoice.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/RiversideChoice.java Thu May 03 14:57:31 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +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.inundation;
-
-import org.dive4elements.river.artifacts.states.BooleanChoiceState;
-
-/**
- * @author Ingo Weinzierl
- */
-public class RiversideChoice extends BooleanChoiceState {
-
- private static final long serialVersionUID = 1L;
-
- public RiversideChoice() {
- super("state.sinfo.riverside.option1", "active", "inactive");
- }
-}
\ No newline at end of file
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/RiversideRadioChoice.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/RiversideRadioChoice.java Fri May 04 13:17:57 2018 +0200
@@ -0,0 +1,36 @@
+/* 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.inundation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.dive4elements.river.artifacts.states.RadioSelect;
+
+/**
+ * @author Ingo Weinzierl
+ */
+public class RiversideRadioChoice extends RadioSelect {
+ private static final long serialVersionUID = 1L;
+
+ public RiversideRadioChoice() {
+ super();
+ }
+
+ @Override
+ protected List makeEntries() {
+ final List entries = new ArrayList<>();
+ entries.add("state.sinfo.riverside.left");
+ entries.add("state.sinfo.riverside.right");
+ entries.add("state.sinfo.riverside.both");
+ return entries;
+
+ }
+
+}
\ No newline at end of file
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java Thu May 03 14:57:31 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/inundation/WsplChoice.java Fri May 04 13:17:57 2018 +0200
@@ -18,6 +18,6 @@
private static final long serialVersionUID = 1L;
public WsplChoice() {
- super("state.sinfo.wspl.option", "wspl.active", "wspl.inactive");
+ super("state.sinfo.wspl.option", "state.sinfo.wspl.active", "state.sinfo.wspl.inactive");
}
}
\ No newline at end of file
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/src/main/java/org/dive4elements/river/artifacts/states/RadioSelect.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RadioSelect.java Fri May 04 13:17:57 2018 +0200
@@ -0,0 +1,54 @@
+/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
+ * Software engineering by
+ * Björnsen Beratende Ingenieure GmbH
+ * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
+ *
+ * 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 java.util.List;
+
+import org.dive4elements.artifacts.Artifact;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.CallMeta;
+import org.dive4elements.artifacts.common.utils.XMLUtils;
+import org.dive4elements.river.artifacts.resources.Resources;
+import org.w3c.dom.Element;
+
+/**
+ * @author Domenico Nardi Tironi
+ *
+ */
+public abstract class RadioSelect extends DefaultState {
+
+ private static final long serialVersionUID = 1L;
+ private final List entries;
+
+ public RadioSelect() {
+ super();
+ this.entries = makeEntries();
+ }
+
+ protected abstract List makeEntries();
+
+ @Override
+ protected final String getUIProvider() {
+ return "radio_panel";
+ }
+
+ @Override
+ protected Element[] createItems(final XMLUtils.ElementCreator ec, final Artifact artifact, final String name, final CallContext context) {
+ final CallMeta meta = context.getMeta();
+ final Element[] elements = new Element[this.entries.size()];
+ int i = 0;
+ for (final String item : this.entries) {
+ elements[i] = createItem(ec, new String[] { Resources.getMsg(meta, item, item), item });
+ i++;
+ }
+ return elements;
+ }
+
+}
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/YearEpochSelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/YearEpochSelect.java Thu May 03 14:57:31 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/YearEpochSelect.java Fri May 04 13:17:57 2018 +0200
@@ -8,19 +8,18 @@
package org.dive4elements.river.artifacts.states.minfo;
-import org.w3c.dom.Element;
-
import org.dive4elements.artifacts.Artifact;
import org.dive4elements.artifacts.CallContext;
import org.dive4elements.artifacts.CallMeta;
import org.dive4elements.artifacts.common.utils.XMLUtils;
import org.dive4elements.river.artifacts.resources.Resources;
import org.dive4elements.river.artifacts.states.DefaultState;
+import org.w3c.dom.Element;
/**
* @author Raimund Renkert
*/
-public class YearEpochSelect extends DefaultState {
+public class YearEpochSelect extends DefaultState {// TODO: RadioSelect-class; more flexible Implementation
/**
* The default constructor that initializes an empty State object.
@@ -34,49 +33,34 @@
}
@Override
- protected Element[] createItems(
- XMLUtils.ElementCreator ec,
- Artifact artifact,
- String name,
- CallContext context)
- {
- CallMeta meta = context.getMeta();
+ protected Element[] createItems(final XMLUtils.ElementCreator ec, final Artifact artifact, final String name, final CallContext context) {
+ final CallMeta meta = context.getMeta();
Element[] elements;
- /* Disable calculation of official epochs
- if (((D4EArtifact)artifact).getCurrentStateId()
- .equals("state.minfo.sediment.load.year_epoch")
- ) {
- elements = new Element[3];
- elements[2] = createItem(
- ec,
- new String[] {
- Resources.getMsg(meta,
- "state.minfo.off_epoch",
- "state.minfo.off_epoch"),
- "off_epoch"});
- }
- else {
- elements = new Element[2];
- } */
+ /*
+ * Disable calculation of official epochs
+ * if (((D4EArtifact)artifact).getCurrentStateId()
+ * .equals("state.minfo.sediment.load.year_epoch")
+ * ) {
+ * elements = new Element[3];
+ * elements[2] = createItem(
+ * ec,
+ * new String[] {
+ * Resources.getMsg(meta,
+ * "state.minfo.off_epoch",
+ * "state.minfo.off_epoch"),
+ * "off_epoch"});
+ * }
+ * else {
+ * elements = new Element[2];
+ * }
+ */
elements = new Element[2];
- elements[0] = createItem(
- ec,
- new String[] {
- Resources.getMsg(meta,
- "state.minfo.year",
- "state.minfo.year"),
- "year"});
+ elements[0] = createItem(ec, new String[] { Resources.getMsg(meta, "state.minfo.year", "state.minfo.year"), "year" });
- elements[1] = createItem(
- ec,
- new String[] {
- Resources.getMsg(meta,
- "state.minfo.epoch",
- "state.minfo.epoch"),
- "epoch"});
+ elements[1] = createItem(ec, new String[] { Resources.getMsg(meta, "state.minfo.epoch", "state.minfo.epoch"), "epoch" });
- return elements;
+ return elements;
}
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
diff -r a6c19528ac16 -r ad2ae847e10e artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties Thu May 03 14:57:31 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties Fri May 04 13:17:57 2018 +0200
@@ -845,12 +845,15 @@
state.sinfo.riverside.option1 = Beide Uferseiten
help.state.sinfo.wspl= ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.riverside
-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
+state.sinfo.wq_adapted = Eingabe f\u00fcr W/Q Daten
+help.state.sinfo.wq_adapted = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wq_adapted
+state.sinfo.wq = Eingabe f\u00fcr W/Q Daten
+help.state.sinfo.wq = ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wq
state.sinfo.wspl = Wasserspiegellagen
state.sinfo.wspl.option = Wasserspiegellagen zus\u00e4tzlich darstellen?
+state.sinfo.wspl.active = Ja
+state.sinfo.wspl.inactive = Nein
help.state.sinfo.wspl= ${help.url}/OnlineHilfe/SINFO#help.state.sinfo.wspl
state.sinfo.grounding.year = Jahr/Zeitraum
diff -r a6c19528ac16 -r ad2ae847e10e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java Thu May 03 14:57:31 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProviderFactory.java Fri May 04 13:17:57 2018 +0200
@@ -38,174 +38,127 @@
private UIProviderFactory() {
}
- /** @param uiProvider uiprovider demanded for by state. */
- public static UIProvider getProvider(String uiProvider, User user) {
+ /**
+ * @param uiProvider
+ * uiprovider demanded for by state.
+ */
+ public static UIProvider getProvider(final String uiProvider, final User user) {
if (uiProvider == null || uiProvider.equals("")) {
return new SelectProvider();
- }
- else if (uiProvider.equals("select_with_map")) {
+ } else if (uiProvider.equals("select_with_map")) {
return new MapSelection();
- }
- else if (uiProvider.equals("location_distance_panel")) {
+ } else if (uiProvider.equals("location_distance_panel")) {
return new LocationDistancePanel();
- }
- else if (uiProvider.equals("location_panel")) {
+ } else if (uiProvider.equals("location_panel")) {
return new SingleLocationPanel();
- }
- else if (uiProvider.equals("multi_location_panel")) {
+ } else if (uiProvider.equals("multi_location_panel")) {
return new MultipleLocationPanel();
- }
- else if (uiProvider.equals("distance_panel")) {
+ } else if (uiProvider.equals("distance_panel")) {
return new DistancePanel();
- }
- else if (uiProvider.equals("distance_only_panel")) {
+ } else if (uiProvider.equals("distance_only_panel")) {
return new DistanceOnlyPanel();
- }
- else if (uiProvider.equals("waterlevel_ground_panel")) {
+ } else if (uiProvider.equals("waterlevel_ground_panel")) {
return new WaterlevelGroundPanel();
- }
- else if (uiProvider.equals("wq_panel")) {
+ } else if (uiProvider.equals("wq_panel")) {
return new WQInputPanel();
- }
- else if (uiProvider.equals("wq_panel_adapted")) {
+ } else if (uiProvider.equals("wq_panel_adapted")) {
return new WQAdaptedInputPanel();
- }
- else if (uiProvider.equals("wq_panel_adapted_fixing")) {
+ } else if (uiProvider.equals("wq_panel_adapted_fixing")) {
return new WQAdaptedFixingInputPanel();
- }
- else if (uiProvider.equals("q_segmented_panel")) {
+ } else if (uiProvider.equals("q_segmented_panel")) {
return new QSegmentedInputPanel();
- }
- else if (uiProvider.equals("river_panel")) {
+ } else if (uiProvider.equals("river_panel")) {
return new LinkSelection();
- }
- else if (uiProvider.equals("continue")) {
+ } else if (uiProvider.equals("continue")) {
return new ContinuePanel();
- }
- else if (uiProvider.equals("wsp_datacage_panel")) {
+ } else if (uiProvider.equals("wsp_datacage_panel")) {
return new WspDatacagePanel(user);
- }
- else if (uiProvider.equals("dgm_datacage_panel")) {
+ } else if (uiProvider.equals("dgm_datacage_panel")) {
return new DemDatacagePanel(user);
- }
- else if (uiProvider.equals("waterlevel_twin_panel")) {
+ } else if (uiProvider.equals("waterlevel_twin_panel")) {
return new WaterlevelTwinPanel(user);
- }
- else if (uiProvider.equals("auto_integer")) {
+ } else if (uiProvider.equals("auto_integer")) {
return new AutoIntegerPanel();
- }
- else if (uiProvider.equals("boolean_panel")) {
+ } else if (uiProvider.equals("boolean_panel")) {
return new BooleanPanel();
- }
- else if (uiProvider.equals("noinput")) {
+ } else if (uiProvider.equals("noinput")) {
return new NoInputPanel();
- }
- else if (uiProvider.equals("map_digitize")) {
+ } else if (uiProvider.equals("map_digitize")) {
return new DigitizePanel();
- }
- else if (uiProvider.equals("timerange")) {
+ } else if (uiProvider.equals("timerange")) {
return new IntegerRangePanel();
- }
- else if (uiProvider.equals("wq_simple_array")) {
+ } else if (uiProvider.equals("wq_simple_array")) {
return new WQSimpleArrayPanel();
- }
- else if (uiProvider.equals("gaugetimerange")) {
+ } else if (uiProvider.equals("gaugetimerange")) {
return new GaugeTimeRangePanel();
- }
- else if (uiProvider.equals("fix.location_panel")) {
+ } else if (uiProvider.equals("fix.location_panel")) {
return new FixLocationPanel();
- }
- else if (uiProvider.equals("fix.period_panel")) {
+ } else if (uiProvider.equals("fix.period_panel")) {
return new FixPeriodPanel();
- }
- else if (uiProvider.equals("fix.period_ref_panel")) {
+ } else if (uiProvider.equals("fix.period_ref_panel")) {
return new FixPeriodPanel("ref_start", "ref_end");
- }
- else if (uiProvider.equals("fix.period_ana_panel")) {
+ } else if (uiProvider.equals("fix.period_ana_panel")) {
return new FixMultiPeriodPanel();
- }
- else if (uiProvider.equals("fix.qselect_panel")) {
+ } else if (uiProvider.equals("fix.qselect_panel")) {
return new FixQSelectPanel();
- }
- else if (uiProvider.equals("fix.gaugeselect_panel")) {
+ } else if (uiProvider.equals("fix.gaugeselect_panel")) {
return new FixGaugeSelectPanel();
- }
- else if (uiProvider.equals("fix.event_panel")) {
+ } else if (uiProvider.equals("fix.event_panel")) {
return new FixEventSelect();
- }
- else if (uiProvider.equals("fix.preprocessing_panel")) {
+ } else if (uiProvider.equals("fix.preprocessing_panel")) {
return new BooleanPanel();
- }
- else if (uiProvider.equals("fix.functionselect")) {
+ } else if (uiProvider.equals("fix.functionselect")) {
return new FixFunctionSelect();
- }
- else if (uiProvider.equals("period_select")) {
+ } else if (uiProvider.equals("period_select")) {
return new PeriodPanel();
- }
- else if (uiProvider.equals("periods_select")) {
+ } else if (uiProvider.equals("periods_select")) {
return new MultiPeriodPanel();
- }
- else if (uiProvider.equals("sq.period.select")) {
+ } else if (uiProvider.equals("sq.period.select")) {
return new SQPeriodPanel();
- }
- else if (uiProvider.equals("outliers_input")) {
+ } else if (uiProvider.equals("outliers_input")) {
return new DoubleInputPanel();
- }
- else if (uiProvider.equals("percent_input")) {
+ } else if (uiProvider.equals("percent_input")) {
return new DoubleInputPanel("percent");
- }
- else if (uiProvider.equals("parameter-matrix")) {
+ } else if (uiProvider.equals("parameter-matrix")) {
return new ParameterMatrixPanel();
- }
- else if (uiProvider.equals("minfo.bed.year_epoch")) {
+ } else if (uiProvider.equals("minfo.bed.year_epoch")) {
return new RadioPanel();
- }
- else if (uiProvider.equals("bedquality_periods_select")) {
+ } else if (uiProvider.equals("radio_panel")) {
+ return new RadioPanel();
+ } else if (uiProvider.equals("bedquality_periods_select")) {
return new BedMultiPeriodPanel();
- }
- else if (uiProvider.equals("bedheights_twin_panel")) {
+ } else if (uiProvider.equals("bedheights_twin_panel")) {
return new BedHeightsDatacagePanel(user);
- }
- else if (uiProvider.equals("minfo.bed.char_diameter")) {
+ } else if (uiProvider.equals("minfo.bed.char_diameter")) {
return new CheckboxPanel();
- }
- else if (uiProvider.equals("minfo.sedimentload_unit_select")) {
+ } else if (uiProvider.equals("minfo.sedimentload_unit_select")) {
return new RadioPanel();
- }
- else if (uiProvider.equals("static_data")) {
+ } else if (uiProvider.equals("static_data")) {
+ return new StaticDataPanel();
+ } else if (uiProvider.equals("minfo.sedimentload_distance_select")) {
+ return new SedLoadDistancePanel();
+ } else if (uiProvider.equals("minfo.sedimentload_year_select")) {
+ return new SedLoadPeriodPanel();
+ } else if (uiProvider.equals("minfo.sedimentload_epoch_select")) {
+ return new SedLoadEpochPanel();
+ } else if (uiProvider.equals("minfo.sedimentload_sqti_select")) {
+ return new SedLoadSQTiPanel();
+ } else if (uiProvider.equals("hws_datacage_panel")) {
+ return new HWSDatacagePanel(user);
+ } else if (uiProvider.equals("user_rgd_panel")) {
+ return new UserRGDProvider();
+ } else if (uiProvider.equals("static_sqrelation")) {
return new StaticDataPanel();
}
- else if (uiProvider.equals("minfo.sedimentload_distance_select")) {
- return new SedLoadDistancePanel();
- }
- else if (uiProvider.equals("minfo.sedimentload_year_select")) {
- return new SedLoadPeriodPanel();
- }
- else if (uiProvider.equals("minfo.sedimentload_epoch_select")) {
- return new SedLoadEpochPanel();
- }
- else if (uiProvider.equals("minfo.sedimentload_sqti_select")) {
- return new SedLoadSQTiPanel();
- }
- else if (uiProvider.equals("hws_datacage_panel")) {
- return new HWSDatacagePanel(user);
- }
- else if (uiProvider.equals("user_rgd_panel")) {
- return new UserRGDProvider();
- }
- else if (uiProvider.equals("static_sqrelation")) {
- return new StaticDataPanel();
- }
-
+
if ("sinfo_flowdepth_twin_panel".equals(uiProvider))
- return new FlowDepthTwinPanel(user);
+ return new FlowDepthTwinPanel(user);
if ("sinfo_flowdepthminmax_twin_panel".equals(uiProvider))
return new FlowDepthMinMaxTwinPanel(user);
-
- //GWT.log("Picked default provider.");
+
+ // GWT.log("Picked default provider.");
return new SelectProvider();
}
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
-