diff flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java @ 246:ccba1a0b743e

The WQAdaptedInputPanel displays input fields for each gauge and returns the correct w/q values now. flys-client/trunk@1831 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 05 May 2011 08:09:03 +0000
parents 234c78a91c15
children 469528551b78
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java	Wed May 04 14:54:38 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DoubleArrayPanel.java	Thu May 05 08:09:03 2011 +0000
@@ -26,6 +26,15 @@
     public static final String FIELD_NAME = "doublearray";
 
 
+    public DoubleArrayPanel(
+        String title,
+        double[] values,
+        BlurHandler handler)
+    {
+        this(title, values, handler, TitleOrientation.RIGHT);
+    }
+
+
     /**
      * Creates a new form with a single input field that displays an array of
      * double values.
@@ -38,7 +47,8 @@
     public DoubleArrayPanel(
         String title,
         double[] values,
-        BlurHandler handler)
+        BlurHandler handler,
+        TitleOrientation titleOrientation)
     {
         ti                 = new TextItem(FIELD_NAME);
         StaticTextItem sti = new StaticTextItem("staticarray");
@@ -49,8 +59,14 @@
 
         ti.addBlurHandler(handler);
 
-        setFields(ti, sti);
-        setTitleOrientation(TitleOrientation.RIGHT);
+        if (titleOrientation == TitleOrientation.RIGHT) {
+            setFields(ti, sti);
+        }
+        else {
+            setFields(sti, ti);
+        }
+
+        setTitleOrientation(titleOrientation);
         setNumCols(2);
 
         if (values == null) {
@@ -187,5 +203,15 @@
 
         return values;
     }
+
+
+    /**
+     * Returns the double values of this panel.
+     *
+     * @return the double values of this panel.
+     */
+    public double[] getInputValues() {
+        return getInputValues(ti);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org