diff flys-client/src/main/java/de/intevation/flys/client/client/ui/WQSimpleArrayPanel.java @ 4198:1cdbd8a0c994

Added two new tables ClickableQDTable and ClickableWTable and made Ws and Qs clickable in historical discharge calculation. The new tables define listener interfaces (clicked lower or upper icon) to listen to user clicks. In addition to this, there is an enum ClickMode with NONE, SINGLE and RANGE options, which allows to specifiy, which icons are displayed in the tables. NONE means no icon for user clicks, SINGLE has 1 icon, RANGE 2 icons for lower and upper.
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 22 Oct 2012 13:31:25 +0200
parents 070321cf17e1
children 1f212836998e
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQSimpleArrayPanel.java	Mon Oct 22 10:35:49 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQSimpleArrayPanel.java	Mon Oct 22 13:31:25 2012 +0200
@@ -7,7 +7,6 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.i18n.client.NumberFormat;
 import com.google.gwt.user.client.rpc.AsyncCallback;
-
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.form.DynamicForm;
@@ -18,9 +17,19 @@
 import com.smartgwt.client.widgets.form.fields.events.ChangedHandler;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.tab.Tab;
 import com.smartgwt.client.widgets.tab.TabSet;
-import com.smartgwt.client.widgets.tab.Tab;
 
+import de.intevation.flys.client.client.Config;
+import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.services.GaugeInfoService;
+import de.intevation.flys.client.client.services.GaugeInfoServiceAsync;
+import de.intevation.flys.client.client.services.WQInfoService;
+import de.intevation.flys.client.client.services.WQInfoServiceAsync;
+import de.intevation.flys.client.client.ui.wq.ClickableQDTable;
+import de.intevation.flys.client.client.ui.wq.ClickableWTable;
+import de.intevation.flys.client.client.ui.wq.ClickableWTable.ClickMode;
+import de.intevation.flys.client.client.ui.wq.QDTable;
 import de.intevation.flys.client.shared.model.ArtifactDescription;
 import de.intevation.flys.client.shared.model.Data;
 import de.intevation.flys.client.shared.model.DataItem;
@@ -30,17 +39,8 @@
 import de.intevation.flys.client.shared.model.DoubleArrayData;
 import de.intevation.flys.client.shared.model.Gauge;
 import de.intevation.flys.client.shared.model.IntegerOptionsData;
-import de.intevation.flys.client.shared.model.WQInfoRecord;
 import de.intevation.flys.client.shared.model.WQInfoObject;
-
-import de.intevation.flys.client.client.Config;
-import de.intevation.flys.client.client.FLYSConstants;
-import de.intevation.flys.client.client.services.GaugeInfoService;
-import de.intevation.flys.client.client.services.GaugeInfoServiceAsync;
-import de.intevation.flys.client.client.services.WQInfoService;
-import de.intevation.flys.client.client.services.WQInfoServiceAsync;
-import de.intevation.flys.client.client.ui.wq.WTable;
-import de.intevation.flys.client.client.ui.wq.QDTable;
+import de.intevation.flys.client.shared.model.WQInfoRecord;
 
 
 /**
@@ -75,8 +75,8 @@
     protected DoubleArrayPanel panelW;
     protected DoubleArrayPanel panelQ;
 
-    protected WTable wTable;
-    protected QDTable qTable;
+    protected ClickableWTable wTable;
+    protected ClickableQDTable qTable;
 
 
     @Override
@@ -170,8 +170,30 @@
 
 
     protected void initializeTables() {
-        wTable = new WTable();
-        qTable = new QDTable();
+        wTable = new ClickableWTable(new ClickableWTable.WClickedListener() {
+            @Override
+            public void clickedUpper(double value) {
+                // nothing to do here
+            }
+
+            @Override
+            public void clickedLower(double value) {
+                panelW.addValue(value);
+            }
+        }, ClickMode.SINGLE);
+
+        qTable = new ClickableQDTable(new ClickableQDTable.QClickedListener() {
+
+            @Override
+            public void clickedUpper(double value) {
+                // nothing to do here
+            }
+
+            @Override
+            public void clickedLower(double value) {
+               panelQ.addValue(value);
+            }
+        }, ClickableQDTable.ClickMode.SINGLE);
 
         fetchWQData();
     }

http://dive4elements.wald.intevation.org