changeset 5104:5f70c73b11ed

Display gauge names in WQAdapted input panel instead of gauge range.
author Raimund Renkert <rrenkert@intevation.de>
date Tue, 26 Feb 2013 13:59:20 +0100 (2013-02-26)
parents 15e856a64cdd
children 34baad34987f
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java
diffstat 9 files changed, 27 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java	Tue Feb 26 13:59:20 2013 +0100
@@ -165,7 +165,7 @@
                 double[] mmW = gauge.determineMinMaxW();
 
                 elements.add(createItem(
-                    cr, new String[] { from + ";" + to, ""}, mmQ, mmW));
+                    cr, new String[] { from + ";" + to, gauge.getName()}, mmQ, mmW));
             }
         }
         else {
@@ -186,7 +186,7 @@
                 double[] mmW = gauge.determineMinMaxW();
 
                 elements.add(createItem(
-                    cr, new String[] { to + ";" + from, ""}, mmQ, mmW));
+                    cr, new String[] { to + ";" + from, gauge.getName()}, mmQ, mmW));
             }
         }
 
@@ -449,7 +449,7 @@
             double lower = Double.parseDouble(parts[0]);
             double upper = Double.parseDouble(parts[1]);
 
-            String[] values = parts[2].split(",");
+            String[] values = parts[3].split(",");
 
             int      num = values.length;
             double[] res = new double[num];
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/DoubleUtil.java	Tue Feb 26 13:59:20 2013 +0100
@@ -177,7 +177,7 @@
 
                 vs.resetQuick();
 
-                for (String valueStr: parts[2].split(",")) {
+                for (String valueStr: parts[3].split(",")) {
                     vs.add(round(Double.parseDouble(valueStr.trim())));
                 }
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Tue Feb 26 13:59:20 2013 +0100
@@ -252,6 +252,8 @@
 
     String wqQ();
 
+    String wqQatGauge();
+
     String wqQGauge();
 
     String wqSingle();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Tue Feb 26 13:59:20 2013 +0100
@@ -166,6 +166,7 @@
 measurementStationPanelTitle = Measurement Station Information
 wqW = W at Gauge [cm]
 wqQ = Q [m\u00b3/s]
+wqQatGauge = Q at Gauge [m\u00b3/s]
 wqWFree = W free position [m+NHN]
 wqQGauge = Discharge at Gauge
 wqSingle = Single values
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Tue Feb 26 13:59:20 2013 +0100
@@ -154,6 +154,7 @@
 measurementStationPanelTitle = Gew\u00e4sser/Messstellen-Info
 wqW = W am Pegel [cm]
 wqQ = Q [m\u00b3/s]
+wqQatGauge = Q am Pegel [m\u00b3/s]
 wqWFree = W auf freier Strecke [m+NHN]
 wqQGauge = Kennzeichnender Abfluss am Pegel
 wqSingle = Einzelwerte
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Tue Feb 26 13:59:20 2013 +0100
@@ -167,6 +167,7 @@
 measurementStationPanelTitle = Measurement Station Information
 wqW = W at Gauge [cm]
 wqQ = Q [m\u00b3/s]
+wqQatGauge = Q at Gauge [m\u00b3/s]
 wqWFree = W at free position [m+NHN]
 wqQGauge = Discharge at Gauge
 wqSingle = Single values
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java	Tue Feb 26 13:59:20 2013 +0100
@@ -22,6 +22,8 @@
 
     protected TextItem ti;
 
+    private String title;
+
     /** The constant input field name. */
     public static final String FIELD_NAME = "doublearray";
 
@@ -50,6 +52,7 @@
         BlurHandler handler,
         TitleOrientation titleOrientation)
     {
+        this.title = title;
         ti                 = new TextItem(FIELD_NAME);
         StaticTextItem sti = new StaticTextItem("staticarray");
 
@@ -263,5 +266,9 @@
     public double[] getInputValues() {
         return getInputValues(ti);
     }
+
+    public String getItemTitle() {
+        return this.title;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/QSegmentedInputPanel.java	Tue Feb 26 13:59:20 2013 +0100
@@ -180,7 +180,7 @@
             HLayout h = new HLayout();
 
             String[] parts  = gauge.split(GAUGE_PART_SEPARATOR);
-            String[] values = parts[2].split(VALUE_SEPARATOR);
+            String[] values = parts[3].split(VALUE_SEPARATOR);
 
             Label l = new Label(parts[0] + " - " + parts[1] + ": ");
 
@@ -361,10 +361,10 @@
 
             double[] values = dap.getInputValues();
             if (wqvalue == null) {
-                wqvalue = createValueString(key, values);
+                wqvalue = createValueString(key + "; ", values);
             }
             else {
-                wqvalue += GAUGE_SEPARATOR + createValueString(key, values);
+                wqvalue += GAUGE_SEPARATOR + createValueString(key + "; ", values);
             }
         }
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Tue Feb 26 11:49:46 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Tue Feb 26 13:59:20 2013 +0100
@@ -202,9 +202,9 @@
             HLayout h = new HLayout();
 
             String[] parts  = gauge.split(GAUGE_PART_SEPARATOR);
-            String[] values = parts[2].split(VALUE_SEPARATOR);
+            String[] values = parts[3].split(VALUE_SEPARATOR);
 
-            Label l = new Label(parts[0] + " - " + parts[1] + ": ");
+            Label l = new Label(parts[2] + ": ");
 
             StringBuilder sb = new StringBuilder();
             boolean    first = true;
@@ -464,9 +464,9 @@
 
         for (DataItem item: items) {
             String title = item.getLabel();
-
+            String label = item.getStringValue();
             DoubleArrayPanel dap = new DoubleArrayPanel(
-                createLineTitle(title), null, this, TitleOrientation.LEFT);
+                label, null, this, TitleOrientation.LEFT);
 
             wqranges.put(title, dap);
 
@@ -513,7 +513,7 @@
 
         LinkedHashMap wqValues = new LinkedHashMap();
         wqValues.put(FIELD_WQ_W, MSG.wqW());
-        wqValues.put(FIELD_WQ_Q, MSG.wqQ());
+        wqValues.put(FIELD_WQ_Q, MSG.wqQatGauge());
 
         wq.setValueMap(wqValues);
 
@@ -587,13 +587,14 @@
         while (iter.hasNext()) {
             String           key = iter.next();
             DoubleArrayPanel dap = wqranges.get(key);
+            String label = dap.getItemTitle();
 
             double[] values = dap.getInputValues();
             if (wqvalue == null) {
-                wqvalue = createValueString(key, values);
+                wqvalue = createValueString(key + ";" + label, values);
             }
             else {
-                wqvalue += GAUGE_SEPARATOR + createValueString(key, values);
+                wqvalue += GAUGE_SEPARATOR + createValueString(key + ";" + label, values);
             }
         }
 

http://dive4elements.wald.intevation.org