changeset 912:2c8f1112be37

Rollback for input assistance of "Q/D" table. The selectable icon columns are visible in all modes except of "Q" input mode. (Issue203) flys-client/trunk@2771 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 16 Sep 2011 09:35:42 +0000
parents 4668357b255e
children 9976d99aea34
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java
diffstat 3 files changed, 79 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Sep 15 17:01:12 2011 +0000
+++ b/flys-client/ChangeLog	Fri Sep 16 09:35:42 2011 +0000
@@ -1,3 +1,13 @@
+2011-09-16  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Issue203
+
+	* src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java,
+	  src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java:
+	  Rollback for input assistance of "Q/D" table.
+	  The selectable icon columns are visible in  all modes except of
+	  "Q" input mode.
+
 2011-09-15  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue259 (Daten aus Datenkorb in Diagramm einladen)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Thu Sep 15 17:01:12 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Fri Sep 16 09:35:42 2011 +0000
@@ -156,6 +156,45 @@
     public WQInputPanel() {
         qdTable      = new QDTable();
         wTable       = new WTable();
+
+        initTableListeners();
+    }
+
+
+    /**
+     * Initializes the listeners of the WQD tables.
+     */
+    protected void initTableListeners() {
+        CellClickHandler handler = new CellClickHandler() {
+            public void onCellClick(CellClickEvent e) {
+                if (isWMode()) {
+                    return;
+                }
+
+                int    idx = e.getColNum();
+                Record r   = e.getRecord ();
+                double val = r.getAttributeAsDouble("value");
+
+                if (idx == 0) {
+                    if (isRangeMode()) {
+                        qRangePanel.setFrom(val);
+                    }
+                    else {
+                        qArrayPanel.addValue(val);
+                    }
+                }
+                else if (idx == 1) {
+                    if (isRangeMode()) {
+                        qRangePanel.setTo(val);
+                    }
+                    else {
+                        qArrayPanel.addValue(val);
+                    }
+                }
+            }
+        };
+
+        qdTable.addCellClickHandler(handler);
     }
 
 
@@ -982,6 +1021,13 @@
             inputMode = form.getValueAsString(FIELD_MODE);
         }
 
+        if (wqMode.equals("Q")) {
+            qdTable.hideIconFields();
+        }
+        else {
+            qdTable.showIconFields();
+        }
+
         updatePanels(wqMode, inputMode);
     }
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java	Thu Sep 15 17:01:12 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/wq/QDTable.java	Fri Sep 16 09:35:42 2011 +0000
@@ -22,7 +22,6 @@
     /** The interface that provides the image resources. */
     private FLYSImages IMAGES = GWT.create(FLYSImages.class);
 
-
     public QDTable() {
         setWidth100();
         setHeight100();
@@ -33,6 +32,16 @@
         setShowRecordComponentsByCell(true);
         setEmptyMessage(MESSAGE.empty_table());
 
+        ListGridField addMax = new ListGridField("max", "");
+        addMax.setType(ListGridFieldType.ICON);
+        addMax.setWidth(30);
+        addMax.setCellIcon(IMAGES.markerRed().getURL());
+
+        ListGridField addMin = new ListGridField("min", "");
+        addMin.setType(ListGridFieldType.ICON);
+        addMin.setWidth(30);
+        addMin.setCellIcon(IMAGES.markerGreen().getURL());
+
         ListGridField name = new ListGridField("name", MESSAGE.discharge());
         name.setType(ListGridFieldType.TEXT);
         name.setWidth("*");
@@ -45,7 +54,19 @@
         value.setType(ListGridFieldType.FLOAT);
         value.setWidth("20%");
 
-        setFields(name, type, value);
+        setFields(addMax, addMin, name, type, value);
     }
+
+    public void hideIconFields () {
+        hideField("max");
+        hideField("min");
+    }
+
+
+    public void showIconFields() {
+        showField("max");
+        showField("min");
+    }
+
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org