changeset 1275:ca2d5bcf67a3

Bugfix: #111 Reset the values of WQ range mode if single mode is selected and the other way arround. flys-client/trunk@2851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 28 Sep 2011 09:26:36 +0000
parents f76c90b3086f
children 393e5d37d85d
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java
diffstat 2 files changed, 60 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Sep 28 05:37:10 2011 +0000
+++ b/flys-client/ChangeLog	Wed Sep 28 09:26:36 2011 +0000
@@ -1,3 +1,11 @@
+2011-09-28  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue111 (W-INFO: Wasserspiegellagenberechnung / Strecke)
+
+	* src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java:
+	  Reset the values of range mode if single mode is selected and the other
+	  way arround.
+
 2011-09-28	Felix Wolfsteller	<felix.wolfsteller@intevation.de> 
 
 	Make rows of in list with differences (WDiff) removable.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Wed Sep 28 05:37:10 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Wed Sep 28 09:26:36 2011 +0000
@@ -748,11 +748,7 @@
                 }
             }
 
-            return new Data[] {
-                getDataMode(),
-                getQMode(),
-                getDataSelectionMode(),
-                getDataSingle() };
+            return getSingleData();
         }
         else {
             Canvas member = container.getMember(0);
@@ -767,14 +763,62 @@
                 }
             }
 
-            return new Data[] {
+            return getRangeData();
+        }
+    }
+
+
+    /**
+     * Collects the required data for single mode and resets the data for range
+     * mode.
+     */
+    protected Data[] getSingleData() {
+        DataItem from = new DefaultDataItem("wq_from", "wq_from", "");
+        DataItem to   = new DefaultDataItem("wq_to", "wq_to", "");
+        DataItem step = new DefaultDataItem("wq_step", "wq_step", "");
+
+        return new Data[] {
+                getDataMode(),
+                getQMode(),
+                getDataSelectionMode(),
+                getDataSingle(),
+                new DefaultData(
+                    "wq_from",
+                    null,
+                    null,
+                    new DataItem[] {from}),
+                new DefaultData(
+                    "wq_to",
+                    null,
+                    null,
+                    new DataItem[] {to}),
+                new DefaultData(
+                    "wq_step",
+                    null,
+                    null,
+                    new DataItem[] {step}) };
+    }
+
+
+    /**
+     * Collects the required data for range mode and resets the data for single
+     * mode.
+     */
+    protected Data[] getRangeData() {
+        DataItem item = new DefaultDataItem("wq_single", "wq_single", "");
+
+        return new Data[] {
                 getDataMode(),
                 getQMode(),
                 getDataSelectionMode(),
                 getDataFrom(),
                 getDataTo(),
-                getDataStep() };
-        }
+                getDataStep(),
+                new DefaultData(
+                    "wq_single",
+                    null,
+                    null,
+                    new DataItem[] {item}) };
     }
 
 

http://dive4elements.wald.intevation.org