changeset 1535:03e82be2aabc

Added UI for "Bezugslinienverfahren" ("W auf freier Strecke"). flys-client/trunk@3751 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 23 Jan 2012 15:45:20 +0000 (2012-01-23)
parents 98123d34529b
children 4f4d29404dba
files flys-client/ChangeLog 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/WQInputPanel.java
diffstat 6 files changed, 37 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Jan 23 11:07:38 2012 +0000
+++ b/flys-client/ChangeLog	Mon Jan 23 15:45:20 2012 +0000
@@ -1,3 +1,14 @@
+2012-01-23	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java:
+	  Added UI for the simple case of the "Bezugslinienverfahren" ("W auf freier Strecke").
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties:
+	  Adjusted i18n.
+
 2012-01-23  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Added UI parts and event for filtering distances and locations.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Mon Jan 23 11:07:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Mon Jan 23 15:45:20 2012 +0000
@@ -228,6 +228,8 @@
 
     String unitWNN();
 
+    String wqWFree();
+
     String wqW();
 
     String wqQ();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Mon Jan 23 11:07:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Mon Jan 23 15:45:20 2012 +0000
@@ -134,6 +134,7 @@
 helperPanelTitle = Input Support
 wqW = W at Gauge [cm]
 wqQ = Q [m\u00b3/s]
+wqWFree = W free position [m+NHN]
 wqQGauge = Discharge at Gauge
 wqSingle = Single values
 wqRange = Range
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Mon Jan 23 11:07:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Mon Jan 23 15:45:20 2012 +0000
@@ -134,6 +134,7 @@
 helperPanelTitle = Eingabeunterst\u00fctzung
 wqW = W am Pegel [cm]
 wqQ = Q [m\u00b3/s]
+wqWFree = W auf freier Strecke [m+NHN]
 wqQGauge = Kennzeichnender Abfluss am Pegel
 wqSingle = Einzelwerte
 wqRange = Wertebereich
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Mon Jan 23 11:07:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Mon Jan 23 15:45:20 2012 +0000
@@ -134,6 +134,7 @@
 helperPanelTitle = Input Support
 wqW = W at Gauge [cm]
 wqQ = Q [m\u00b3/s]
+wqWFree = W at free position [m+NHN]
 wqQGauge = Discharge at Gauge
 wqSingle = Single values
 wqRange = Range
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Mon Jan 23 11:07:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Mon Jan 23 15:45:20 2012 +0000
@@ -60,6 +60,9 @@
         GWT.create(WQInfoService.class);
 
     /** The constant field name for choosing w or q mode.*/
+    public static final String FIELD_WQ_W_FREE = "WFREE";
+
+    /** The constant field name for choosing w or q mode.*/
     public static final String FIELD_WQ = "wq";
 
     /** The constant field value for W input mode.*/
@@ -421,13 +424,14 @@
             return;
         }
 
-        boolean isW    = theMode.equals(FIELD_WQ_W);
-        boolean isFree = Boolean.valueOf(theFree);
+        boolean isW     = theMode.equals(FIELD_WQ_W);
+        boolean isFree  = Boolean.valueOf(theFree);
+        boolean isWFree = theMode.equals(FIELD_WQ_W_FREE);
 
         initUserSingleValues(list, theMode);
         initUserRangeValues(list, theMode);
 
-        if (isW) {
+        if (isW || isWFree) {
             modes.setValue(FIELD_WQ, theMode);
         }
         else {
@@ -643,7 +647,7 @@
     protected Canvas createModePanel() {
         RadioGroupItem wq = new RadioGroupItem(FIELD_WQ);
         wq.setShowTitle(false);
-        wq.setVertical(false);
+        wq.setVertical(true);
         wq.setWidth(WIDTH_LEFT_UPPER);
         wq.setWrap(false);
 
@@ -654,6 +658,7 @@
 
         LinkedHashMap wqValues = new LinkedHashMap();
         wqValues.put(FIELD_WQ_W, MESSAGE.wqW());
+        wqValues.put(FIELD_WQ_W_FREE, MESSAGE.wqWFree());
         wqValues.put(FIELD_WQ_Q, MESSAGE.wqQ());
         wqValues.put(FIELD_WQ_Q_GAUGE, MESSAGE.wqQGauge());
 
@@ -699,12 +704,14 @@
         else if (isQFree()) {
             return validateRange(qFreeRangePanel, minQFree, maxQFree);
         }
+        else if (isWFree()) {
+            return validateRange(wRangePanel, minW, maxW);
+        }
         else {
             return validateRange(qRangePanel, minQ, maxQ);
         }
     }
 
-
     protected List<String> validateSingleValues() {
         if (isWMode()) {
             return validateSingle(wArrayPanel, minW, maxW);
@@ -712,6 +719,9 @@
         else if (isQFree()) {
             return validateSingle(qFreeArrayPanel, minQFree, maxQFree);
         }
+        else if (isWFree()) {
+            return validateSingle(wArrayPanel, minW, maxW);
+        }
         else {
             return validateSingle(qArrayPanel, minQ, maxQ);
         }
@@ -1185,6 +1195,11 @@
         return wqMode.equals(FIELD_WQ_Q);
     }
 
+    protected boolean isWFree() {
+        String wqMode = modes.getValueAsString(FIELD_WQ);
+        return wqMode.equals(FIELD_WQ_W_FREE);
+    }
+
 
     /**
      * This method changes the lower panel with the input fields depending on
@@ -1222,7 +1237,7 @@
     protected void updatePanels(String wqMode, String inputMode) {
         container.removeMembers(container.getMembers());
 
-        if (wqMode.equals(FIELD_WQ_W)) {
+        if (wqMode.equals(FIELD_WQ_W) || wqMode.equals(FIELD_WQ_W_FREE)) {
             if (inputMode.equals(FIELD_MODE_SINGLE)) {
                 // Single W mode
                 double[] values = getSingleW();

http://dive4elements.wald.intevation.org