changeset 2432:61c8e517671e

Renamed state data fields for W/Q input. flys-client/trunk@4075 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 17 Feb 2012 11:04:18 +0000
parents 90c339e26a0a
children 47a7bdfb4d37
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java
diffstat 3 files changed, 26 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Feb 17 09:41:38 2012 +0000
+++ b/flys-client/ChangeLog	Fri Feb 17 11:04:18 2012 +0000
@@ -1,3 +1,12 @@
+2012-02-17  Raimund Renkert <raimund.renkert@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java:
+	  Renamed state data fields: wq_mode      -> wq_isq
+	                             wq_free      -> wq_isfree
+	                             wq_selection -> wq_isrange
+	  Removed some logs.
+
 2012-02-17  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue459 (Diagramm-Export hat nicht die gleiche Axenskalierung wie
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Fri Feb 17 09:41:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Fri Feb 17 11:04:18 2012 +0000
@@ -44,7 +44,7 @@
 extends      AbstractUIProvider
 implements   ChangeHandler, BlurHandler
 {
-    public static final String FIELD_WQ_MODE = "wq_mode";
+    public static final String FIELD_WQ_MODE = "wq_isq";
     public static final String FIELD_WQ_W    = "W";
     public static final String FIELD_WQ_Q    = "Q";
 
@@ -103,7 +103,7 @@
     public Canvas createOld(DataList dataList) {
         List<Data> all = dataList.getAll();
         Data    wqData = getData(all, "wq_values");
-        Data    wqMode = getData(all, "wq_mode");
+        Data    wqMode = getData(all, "wq_isq");
 
         Canvas back = getBackButton(dataList.getState());
 
@@ -503,9 +503,9 @@
         if (wqMode.equals("Q")) {
             value = "true";
         }
-        DataItem item = new DefaultDataItem("wq_mode", "wq_mode", value);
+        DataItem item = new DefaultDataItem("wq_isq", "wq_isq", value);
         Data mode = new DefaultData(
-            "wq_mode", null, null, new DataItem[] { item });
+            "wq_isq", null, null, new DataItem[] { item });
 
         return mode;
     }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Fri Feb 17 09:41:38 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Fri Feb 17 11:04:18 2012 +0000
@@ -275,9 +275,9 @@
     public Canvas createOld(DataList dataList) {
         List<Data> items = dataList.getAll();
 
-        Data dMode      = getData(items, "wq_mode");
-        Data dFree      = getData(items, "wq_free");
-        Data dSelection = getData(items, "wq_selection");
+        Data dMode      = getData(items, "wq_isq");
+        Data dFree      = getData(items, "wq_isfree");
+        Data dSelection = getData(items, "wq_isrange");
         Data dSingle    = getData(items, "wq_single");
         Data dFrom      = getData(items, "wq_from");
         Data dTo        = getData(items, "wq_to");
@@ -404,19 +404,19 @@
     protected void initUserDefaults(DataList list) {
         List<Data> allData = list.getAll();
 
-        Data     m        = getData(allData, "wq_mode");
+        Data     m        = getData(allData, "wq_isq");
         DataItem modeItem = m != null ? m.getDefault() : null;
         boolean isQ  = modeItem != null
             ? Boolean.valueOf(modeItem.getStringValue())
             : false;
 
-        Data     f        = getData(allData, "wq_free");
+        Data     f        = getData(allData, "wq_isfree");
         DataItem freeItem = f != null ? f.getDefault() : null;
         boolean  isFree   = freeItem != null
             ? Boolean.valueOf(freeItem.getStringValue())
             : false;
 
-        Data     s            = getData(allData, "wq_selection");
+        Data     s            = getData(allData, "wq_isrange");
         DataItem sI           = s != null ? s.getDefault() : null;
         boolean   isRange      = sI != null
             ? Boolean.valueOf(sI.getStringValue())
@@ -939,18 +939,14 @@
             GWT.log("getData: FIELD_WQ_Q || FIELD_WQ_Q_FREE");
             value = "true";
         }
-/*        else if (wqMode.equals(FIELD_WQ_W_FREE)) {
-            GWT.log("getData: FIELD_WQ_W_FREE");
-            value = FIELD_WQ_W_FREE;
-        }*/
         else {
             GWT.log("getData: FIELD_WQ_W");
             value = "false";
         }
 
-        DataItem item = new DefaultDataItem("wq_mode", "wq_mode", value);
+        DataItem item = new DefaultDataItem("wq_isq", "wq_isq", value);
         return new DefaultData(
-            "wq_mode", null, null, new DataItem[] { item });
+            "wq_isq", null, null, new DataItem[] { item });
     }
 
 
@@ -963,17 +959,15 @@
      */
     protected Data getFree() {
         String value = "";
-        GWT.log("--------mode: " + isWMode());
         if(!isWMode()) {
             value = isQFree() ? "true" : "false";
         }
         else {
             value = isWFree() ? "true" : "false";
         }
-        GWT.log("--------free? " + value);
-        DataItem item = new DefaultDataItem("wq_free", "wq_free", value);
+        DataItem item = new DefaultDataItem("wq_isfree", "wq_isfree", value);
         return new DefaultData(
-            "wq_free", null, null, new DataItem[] { item });
+            "wq_isfree", null, null, new DataItem[] { item });
     }
 
 
@@ -989,13 +983,11 @@
         if (wqSelection.equals(FIELD_MODE_SINGLE)) {
             isRange = "false";
         }
-
-        GWT.log("selection mode: " + isRange);
         DataItem item = new DefaultDataItem(
-            "wq_selection", "wq_selection", isRange);
+            "wq_isrange", "wq_isrange", isRange);
 
         return new DefaultData(
-            "wq_selection", null, null, new DataItem[] { item });
+            "wq_isrange", null, null, new DataItem[] { item });
     }
 
 
@@ -1218,7 +1210,6 @@
 
     protected boolean isWFree() {
         String wqMode = modes.getValueAsString(FIELD_WQ);
-        GWT.log("#########wqmode: " + wqMode + " " + FIELD_WQ_W_FREE);
         return wqMode.equals(FIELD_WQ_W_FREE);
     }
 
@@ -1239,21 +1230,19 @@
 
         if (item.getFieldName().equals(FIELD_MODE)) {
             String wq = form.getValueAsString(FIELD_WQ);
-            GWT.log("mode change: " + wq);
             isQ     = wq.contains("Q");
             isFree  = wq.contains("FREE");
             isRange = ((String) event.getValue()).equals(FIELD_MODE_RANGE);
         }
         else {
             String wq = ((String) event.getValue());
-            GWT.log("else: " + wq);
             isQ       = wq.contains("Q");
             isFree    = wq.contains("FREE");
             isRange   =
                 form.getValueAsString(FIELD_MODE).equals(FIELD_MODE_RANGE);
         }
 
-        if (!isQ) {
+        if (isQ && isFree) {
             qdTable.hideIconFields();
         }
         else {

http://dive4elements.wald.intevation.org