changeset 5526:35cd6286da2d

WQAdaptedInputPanel: Switch focus when input had been done via inputhelper (part flys/issue1133).
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 28 Mar 2013 11:36:19 +0100
parents 6ec7c8ebb2c9
children 6dbc111e9aec
files flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Thu Mar 28 09:29:42 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java	Thu Mar 28 11:36:19 2013 +0100
@@ -94,6 +94,9 @@
     /** Stores the input panels related to their keys.*/
     protected Map<String, DoubleArrayPanel> wqranges;
 
+    /** Index the input panels related to their keys.*/
+    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);
+                    }
                 }
             }
         };
@@ -466,6 +478,7 @@
                 label, null, this, this, TitleOrientation.LEFT);
 
             wqranges.put(title, dap);
+            doubleArrayPanels.add(dap);
 
             if (item instanceof WQDataItem) {
                 WQDataItem wq = (WQDataItem) item;

http://dive4elements.wald.intevation.org