[Dive4elements-commits] [PATCH 1 of 3] WQAdaptedInputPanel: Switch focus when input had been done via inputhelper (part flys/issue1133)

Wald Commits scm-commit at wald.intevation.org
Tue Apr 2 08:50:43 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1364466979 -3600
# Node ID 35cd6286da2d712a18730c3909f11b831deb0c7b
# Parent  6ec7c8ebb2c98708ed18c22f5adbb5b276a4ee27
WQAdaptedInputPanel: Switch focus when input had been done via inputhelper (part flys/issue1133).

diff -r 6ec7c8ebb2c9 -r 35cd6286da2d flys-client/src/main/java/de/intevation/flys/client/client/ui/WQAdaptedInputPanel.java
--- 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;


More information about the Dive4elements-commits mailing list