changeset 5154:56091d58a99f

Partly fix flys/issue1127 (show unit in wqadapted) and added documentation.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 01 Mar 2013 12:40:03 +0100
parents 658dc517fd7b
children 6b19902baf31
files flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java
diffstat 1 files changed, 13 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Fri Mar 01 11:35:06 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Fri Mar 01 12:40:03 2013 +0100
@@ -160,7 +160,7 @@
         List<Data> all = dataList.getAll();
         Data    wqData = getData(all, "wq_values");
         Data    wqMode = getData(all, "wq_isq");
-
+        boolean isQ = wqMode.getItems()[0].getStringValue().equals("true");
         Canvas back = getBackButton(dataList.getState());
 
         HLayout valLayout  = new HLayout();
@@ -178,7 +178,8 @@
         modeLabel.setWidth(200);
 
         valLayout.addMember(wqLabel);
-        valLayout.addMember(createOldWQValues(wqData));
+        valLayout.addMember(createOldWQValues(wqData, isQ));
+
         valLayout.addMember(back);
         modeLayout.addMember(modeLabel);
 
@@ -190,7 +191,7 @@
 
 
     /** Create area showing previously entered w or q data. */
-    protected Canvas createOldWQValues(Data wqData) {
+    protected Canvas createOldWQValues(Data wqData, boolean isQ) {
         VLayout layout = new VLayout();
 
         DataItem item  = wqData.getItems()[0];
@@ -198,6 +199,8 @@
 
         String[] gauges = value.split(GAUGE_SEPARATOR);
 
+        String unit = isQ ? "m³/s" : "cm";
+
         for (String gauge: gauges) {
             HLayout h = new HLayout();
 
@@ -215,6 +218,8 @@
                 }
 
                 sb.append(v);
+                sb.append(" ");
+                sb.append(unit);
 
                 first = false;
             }
@@ -439,6 +444,7 @@
     }
 
 
+    /** Get items which are not WQ_MODE. */
     protected DataItem[] getWQItems(DataList dataList) {
         List<Data> data = dataList.getAll();
 
@@ -456,6 +462,10 @@
     }
 
 
+    /**
+     * Create radio button for switching w and q input.
+     * Radiobutton-change also triggers helper panel tab selection.
+     */
     protected Canvas createMode(DataList dataList) {
         RadioGroupItem wq = new RadioGroupItem(FIELD_WQ_MODE);
         wq.setShowTitle(false);

http://dive4elements.wald.intevation.org