changeset 5528:33d735f5433e

Merged.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 02 Apr 2013 08:58:24 +0200
parents 6dbc111e9aec (diff) fcf28185ca30 (current diff)
children 52876daf97b0
files flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Mon Apr 01 13:50:56 2013 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Tue Apr 02 08:58:24 2013 +0200
@@ -94,6 +94,9 @@
     /** Stores the input panels related to their keys.*/
     protected Map<String, DoubleArrayPanel> wqranges;
 
+    /** List of doubleArrayPanels shown. */
+    protected ArrayList<DoubleArrayPanel> doubleArrayPanels;
+
     /** Stores the min/max values for each q range.*/
     protected Map<String, double[]> qranges;
 
@@ -118,6 +121,7 @@
 
     public WQAdaptedInputPanel() {
         wqranges = new HashMap<String, DoubleArrayPanel>();
+        doubleArrayPanels = new ArrayList<DoubleArrayPanel>();
         qranges  = new HashMap<String, double[]>();
         wranges  = new HashMap<String, double[]>();
         qdTable  = new QDTable();
@@ -189,6 +193,14 @@
 
                 if (itemWithFocus != null) {
                     itemWithFocus.setValues(new double[]{val});
+                    // TODO 1133, show different data for each doublearraypanel
+                    int i = doubleArrayPanels.indexOf(itemWithFocus);
+                    if (i == doubleArrayPanels.size()-1) {
+                        doubleArrayPanels.get(0).focusInItem(1);
+                    }
+                    else {
+                        doubleArrayPanels.get(i+1).focusInItem(1);
+                    }
                 }
             }
         };
@@ -196,6 +208,7 @@
         qdTable.addCellClickHandler(handler);
     }
 
+
     @Override
     public Canvas createOld(DataList dataList) {
         List<Data> all = dataList.getAll();
@@ -314,6 +327,7 @@
         }
     }
 
+
     protected List<String> validateRange(Map<String, double[]> ranges) {
         List<String> errors = new ArrayList<String>();
         NumberFormat nf     = NumberFormat.getDecimalFormat();
@@ -466,6 +480,7 @@
                 label, null, this, this, TitleOrientation.LEFT);
 
             wqranges.put(title, dap);
+            doubleArrayPanels.add(dap);
 
             if (item instanceof WQDataItem) {
                 WQDataItem wq = (WQDataItem) item;
@@ -648,6 +663,7 @@
     }
 
 
+    /** Get the WQD data from servide and stuck them up that tables. */
     protected void fetchWQData() {
         Config config    = Config.getInstance();
         String locale    = config.getLocale ();
@@ -676,7 +692,6 @@
                     }
 
                     addWQInfo(wqi);
-
                 }
             }
         );

http://dive4elements.wald.intevation.org