Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
245:1e73d5a4859c | 246:ccba1a0b743e |
---|---|
24 | 24 |
25 /** The constant input field name.*/ | 25 /** The constant input field name.*/ |
26 public static final String FIELD_NAME = "doublearray"; | 26 public static final String FIELD_NAME = "doublearray"; |
27 | 27 |
28 | 28 |
29 /** | |
30 * Creates a new form with a single input field that displays an array of | |
31 * double values. | |
32 * | |
33 * @param name The name of the TextItem. | |
34 * @param title The title of the TextItem. | |
35 * @param values The double values that should be displayed initially. | |
36 * @param handler The BlurHandler that is used to valide the input. | |
37 */ | |
38 public DoubleArrayPanel( | 29 public DoubleArrayPanel( |
39 String title, | 30 String title, |
40 double[] values, | 31 double[] values, |
41 BlurHandler handler) | 32 BlurHandler handler) |
42 { | 33 { |
34 this(title, values, handler, TitleOrientation.RIGHT); | |
35 } | |
36 | |
37 | |
38 /** | |
39 * Creates a new form with a single input field that displays an array of | |
40 * double values. | |
41 * | |
42 * @param name The name of the TextItem. | |
43 * @param title The title of the TextItem. | |
44 * @param values The double values that should be displayed initially. | |
45 * @param handler The BlurHandler that is used to valide the input. | |
46 */ | |
47 public DoubleArrayPanel( | |
48 String title, | |
49 double[] values, | |
50 BlurHandler handler, | |
51 TitleOrientation titleOrientation) | |
52 { | |
43 ti = new TextItem(FIELD_NAME); | 53 ti = new TextItem(FIELD_NAME); |
44 StaticTextItem sti = new StaticTextItem("staticarray"); | 54 StaticTextItem sti = new StaticTextItem("staticarray"); |
45 | 55 |
46 ti.setShowTitle(false); | 56 ti.setShowTitle(false); |
47 sti.setShowTitle(false); | 57 sti.setShowTitle(false); |
48 sti.setValue(title); | 58 sti.setValue(title); |
49 | 59 |
50 ti.addBlurHandler(handler); | 60 ti.addBlurHandler(handler); |
51 | 61 |
52 setFields(ti, sti); | 62 if (titleOrientation == TitleOrientation.RIGHT) { |
53 setTitleOrientation(TitleOrientation.RIGHT); | 63 setFields(ti, sti); |
64 } | |
65 else { | |
66 setFields(sti, ti); | |
67 } | |
68 | |
69 setTitleOrientation(titleOrientation); | |
54 setNumCols(2); | 70 setNumCols(2); |
55 | 71 |
56 if (values == null) { | 72 if (values == null) { |
57 return; | 73 return; |
58 } | 74 } |
185 } | 201 } |
186 } | 202 } |
187 | 203 |
188 return values; | 204 return values; |
189 } | 205 } |
206 | |
207 | |
208 /** | |
209 * Returns the double values of this panel. | |
210 * | |
211 * @return the double values of this panel. | |
212 */ | |
213 public double[] getInputValues() { | |
214 return getInputValues(ti); | |
215 } | |
190 } | 216 } |
191 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 217 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |