comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java @ 51:a2923d63f530

Introduced a data structure DataList to manage to list of Data objects of a single state. flys-client/trunk@1505 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Mar 2011 16:44:51 +0000
parents 6e191588a295
children 3d5d7788d471
comparison
equal deleted inserted replaced
50:827eb4e06ebf 51:a2923d63f530
16 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; 16 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent;
17 import com.smartgwt.client.widgets.layout.VLayout; 17 import com.smartgwt.client.widgets.layout.VLayout;
18 18
19 import de.intevation.flys.client.shared.model.Data; 19 import de.intevation.flys.client.shared.model.Data;
20 import de.intevation.flys.client.shared.model.DataItem; 20 import de.intevation.flys.client.shared.model.DataItem;
21 import de.intevation.flys.client.shared.model.DataList;
21 import de.intevation.flys.client.shared.model.DefaultData; 22 import de.intevation.flys.client.shared.model.DefaultData;
22 import de.intevation.flys.client.shared.model.DefaultDataItem; 23 import de.intevation.flys.client.shared.model.DefaultDataItem;
23 import de.intevation.flys.client.client.FLYSMessages; 24 import de.intevation.flys.client.client.FLYSMessages;
24 25
25 26
101 * 102 *
102 * @param data The data that is displayed. 103 * @param data The data that is displayed.
103 * 104 *
104 * @return the widget. 105 * @return the widget.
105 */ 106 */
106 public Canvas create(Data data) { 107 public Canvas create(DataList data) {
107 Canvas widget = createWidget(data); 108 Canvas widget = createWidget(data);
108 IButton submit = new IButton(MSG.next(), this); 109 IButton submit = new IButton(MSG.next(), this);
109 Label label = new Label(MSG.wqTitle()); 110 Label label = new Label(MSG.wqTitle());
110 111
111 label.setHeight(25); 112 label.setHeight(25);
126 * 127 *
127 * @param data The data that is displayed in the table on the right. 128 * @param data The data that is displayed in the table on the right.
128 * 129 *
129 * @return the widget. 130 * @return the widget.
130 */ 131 */
131 protected Canvas createWidget(Data data) { 132 protected Canvas createWidget(DataList data) {
132 VLayout layout = new VLayout(); 133 VLayout layout = new VLayout();
133 container = new VLayout(); 134 container = new VLayout();
134 Canvas modeForm = createModePanel(); 135 Canvas modeForm = createModePanel();
135 136
136 // the initial panel is the Single-W panel. 137 // the initial panel is the Single-W panel.
214 */ 215 */
215 protected Data getDataMode() { 216 protected Data getDataMode() {
216 String wqMode = modes.getValueAsString(FIELD_WQ); 217 String wqMode = modes.getValueAsString(FIELD_WQ);
217 DataItem item = new DefaultDataItem("wq_mode", "wq_mode", wqMode); 218 DataItem item = new DefaultDataItem("wq_mode", "wq_mode", wqMode);
218 return new DefaultData( 219 return new DefaultData(
219 "wq_mode", null, null, new DataItem[] { item }, null); 220 "wq_mode", null, null, new DataItem[] { item });
220 } 221 }
221 222
222 223
223 /** 224 /**
224 * Returns the Data object for the 'from' attribute. 225 * Returns the Data object for the 'from' attribute.
227 */ 228 */
228 protected Data getDataFrom() { 229 protected Data getDataFrom() {
229 String value = Double.valueOf(getFinalFrom()).toString(); 230 String value = Double.valueOf(getFinalFrom()).toString();
230 DataItem item = new DefaultDataItem("wq_from", "wq_from", value); 231 DataItem item = new DefaultDataItem("wq_from", "wq_from", value);
231 return new DefaultData( 232 return new DefaultData(
232 "wq_from", null, null, new DataItem[] { item }, null); 233 "wq_from", null, null, new DataItem[] { item });
233 } 234 }
234 235
235 236
236 /** 237 /**
237 * Returns the Data object for the 'to' attribute. 238 * Returns the Data object for the 'to' attribute.
240 */ 241 */
241 protected Data getDataTo() { 242 protected Data getDataTo() {
242 String value = Double.valueOf(getFinalTo()).toString(); 243 String value = Double.valueOf(getFinalTo()).toString();
243 DataItem item = new DefaultDataItem("wq_to", "wq_to", value); 244 DataItem item = new DefaultDataItem("wq_to", "wq_to", value);
244 return new DefaultData( 245 return new DefaultData(
245 "wq_to", null, null, new DataItem[] { item }, null); 246 "wq_to", null, null, new DataItem[] { item });
246 } 247 }
247 248
248 249
249 /** 250 /**
250 * Returns the Data object for the 'step' attribute. 251 * Returns the Data object for the 'step' attribute.
253 */ 254 */
254 protected Data getDataStep() { 255 protected Data getDataStep() {
255 String value = Double.valueOf(getFinalStep()).toString(); 256 String value = Double.valueOf(getFinalStep()).toString();
256 DataItem item = new DefaultDataItem("wq_step","wq_step", value); 257 DataItem item = new DefaultDataItem("wq_step","wq_step", value);
257 return new DefaultData( 258 return new DefaultData(
258 "wq_step", null, null, new DataItem[] { item }, null); 259 "wq_step", null, null, new DataItem[] { item });
259 } 260 }
260 261
261 262
262 /** 263 /**
263 * Returns the value of 'from' depending on the selected input mode. 264 * Returns the value of 'from' depending on the selected input mode.

http://dive4elements.wald.intevation.org