annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java @ 284:be842e36ce1c

ISSUE 46: Removed the table header context menu. flys-client/trunk@1913 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 12 May 2011 15:42:37 +0000
parents d3c053420c3b
children 77234b1d009c
rev   line source
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.LinkedHashMap;
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
4 import java.util.List;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import com.google.gwt.core.client.GWT;
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
7 import com.google.gwt.user.client.rpc.AsyncCallback;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
8
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
9 import com.smartgwt.client.data.Record;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import com.smartgwt.client.widgets.Canvas;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import com.smartgwt.client.widgets.Label;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import com.smartgwt.client.widgets.form.DynamicForm;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import com.smartgwt.client.widgets.form.fields.FormItem;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import com.smartgwt.client.widgets.form.fields.events.BlurEvent;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent;
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
20 import com.smartgwt.client.widgets.layout.HLayout;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 import com.smartgwt.client.widgets.layout.VLayout;
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
22 import com.smartgwt.client.widgets.grid.ListGrid;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
23 import com.smartgwt.client.widgets.grid.ListGridField;
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
24 import com.smartgwt.client.widgets.grid.ListGridRecord;
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
25 import com.smartgwt.client.widgets.grid.events.CellClickHandler;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
26 import com.smartgwt.client.widgets.grid.events.CellClickEvent;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 import de.intevation.flys.client.shared.model.Data;
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
29 import de.intevation.flys.client.shared.model.DataItem;
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
30 import de.intevation.flys.client.shared.model.DataList;
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
31 import de.intevation.flys.client.shared.model.DefaultData;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
32 import de.intevation.flys.client.shared.model.DefaultDataItem;
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
33 import de.intevation.flys.client.shared.model.WQInfoObject;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
34 import de.intevation.flys.client.shared.model.WQInfoRecord;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
35 import de.intevation.flys.client.shared.model.ArtifactDescription;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
36 import com.smartgwt.client.types.ListGridFieldType;
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
37 import com.smartgwt.client.types.SelectionStyle;
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
38
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
39 import de.intevation.flys.client.client.services.WQInfoService;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
40 import de.intevation.flys.client.client.services.WQInfoServiceAsync;
211
b92281182c6b Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
41 import de.intevation.flys.client.client.FLYSConstants;
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
42 import de.intevation.flys.client.client.FLYSImages;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
43 import de.intevation.flys.client.client.Config;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 * This UIProvider creates a widget to enter W or Q data.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 */
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 public class WQInputPanel
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 extends AbstractUIProvider
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53 implements ChangeHandler, BlurHandler
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 /** The message class that provides i18n strings.*/
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
56 protected FLYSConstants MESSAGE = GWT.create(FLYSConstants.class);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
58 /** The interface that provides the image resources. */
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
59 private FLYSImages IMAGES = GWT.create(FLYSImages.class);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
60
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
61 /** The DistanceInfoService used to retrieve locations about rivers.*/
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
62 protected WQInfoServiceAsync wqInfoService =
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
63 GWT.create(WQInfoService.class);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 /** The constant field name for choosing w or q mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 public static final String FIELD_WQ = "wq";
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68 /** The constant field value for W input mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 public static final String FIELD_WQ_W = "W";
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 /** The constant field value for Q input mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 public static final String FIELD_WQ_Q = "Q";
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 /** The constant field name for choosing single values or range.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75 public static final String FIELD_MODE = "mode";
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 /** The constant field value for single input mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 public static final String FIELD_MODE_SINGLE = "single";
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 /** The constant field value for range input mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81 public static final String FIELD_MODE_RANGE = "range";
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 /** The constant value that determines the width of the left panel.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 public static final int WIDTH_LEFT = 200;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 /** The container that manages the w and q panels.*/
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
88 protected HLayout container;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 /** The RadioGroupItem that determines the w/q input mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 protected DynamicForm modes;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92
56
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
93 /** The min values for the 'from' property in the W-Range input mode.*/
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
94 protected double minW;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
95
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
96 /** The min values for the 'from' property in the Q-Range input mode.*/
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
97 protected double minQ;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
98
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
99 /** The max values for the 'from' property in the W-Range input mode.*/
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
100 protected double maxW;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
101
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
102 /** The max values for the 'from' property in the Q-Range input mode.*/
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
103 protected double maxQ;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
104
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105 /** The 'from' value entered in the range W mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 protected double fromW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 /** The 'to' value entered in the range W mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 protected double toW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 /** The 'step' value entered in the range W mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112 protected double stepW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 /** The values entered in the single W mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115 protected double[] valuesW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 /** The 'from' value entered in the range Q mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 protected double fromQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120 /** The 'to' value entered in the range Q mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121 protected double toQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 /** The 'step' value entered in the range Q mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 protected double stepQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126 /** The values entered in the single Q mode.*/
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 protected double[] valuesQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
129 /** The input panel for W values*/
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
130 protected DoubleArrayPanel wArrayPanel;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
131
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
132 /** The input panel for q values*/
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
133 protected DoubleArrayPanel qArrayPanel;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
134
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
135 /** The input panel for w range*/
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
136 protected DoubleRangePanel wRangePanel;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
137
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
138 /** The input panel for q range*/
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
139 protected DoubleRangePanel qRangePanel;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
140
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
141 /** The WQ Data*/
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
142 protected WQInfoObject[] tableData;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
143
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
144 /** The WQ Input Table*/
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
145 protected ListGrid wqTable;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
146
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
147 /** The WQ input table for ranges.*/
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
148 protected ListGrid wqRangeTable;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
149
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
150 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
151 * Creates a new WQInputPanel instance.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
152 */
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
153 public WQInputPanel() {
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
154 wqTable = new ListGrid();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
155 wqRangeTable = new ListGrid();
284
be842e36ce1c ISSUE 46: Removed the table header context menu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 272
diff changeset
156 wqTable.setShowHeaderContextMenu(false);
be842e36ce1c ISSUE 46: Removed the table header context menu.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 272
diff changeset
157 wqRangeTable.setShowHeaderContextMenu(false);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
158 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
159
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
160
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
161 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
162 * This method calls createWidget and puts a 'next' button to the bottom.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
163 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 * @param data The data that is displayed.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
165 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
166 * @return the widget.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
167 */
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
168 public Canvas create(DataList data) {
56
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
169 initDefaults(data);
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
170
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
171
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
172 Canvas widget = createWidget(data);
57
246af33f621c Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 56
diff changeset
173 Canvas submit = getNextButton();
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
174 Label label = new Label(MESSAGE.wqTitle());
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
175
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
176 label.setHeight(25);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
178 VLayout layout = new VLayout();
83
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 59
diff changeset
179 layout.setMembersMargin(10);
4784ca718476 Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 59
diff changeset
180
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
181 layout.addMember(label);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
182 layout.addMember(widget);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
183 layout.addMember(submit);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
184
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
185 return layout;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
186 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
187
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
188
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
189 public Canvas createOld(DataList dataList) {
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
190 List<Data> items = dataList.getAll();
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
191
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
192 Data dMode = getData(items, "wq_mode");
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
193 Data dSelection = getData(items, "wq_selection");
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
194 Data dSingle = getData(items, "wq_single");
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
195 Data dFrom = getData(items, "wq_from");
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
196 Data dTo = getData(items, "wq_to");
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
197 Data dStep = getData(items, "wq_step");
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
198
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
199 DataItem[] mode = dMode.getItems();
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
200 String strMode = mode[0].getStringValue();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
201 boolean wMode = strMode.equals(FIELD_WQ_W);
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
202
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
203 HLayout layout = new HLayout();
91
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 83
diff changeset
204 layout.setWidth("400px");
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 83
diff changeset
205
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
206 Label label = new Label(dataList.getLabel());
91
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 83
diff changeset
207 label.setWidth("200px");
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
208
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
209 String text = null;
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
210
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
211 DataItem[] selItem = dSelection.getItems();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
212 String sel = selItem != null
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
213 ? selItem[0].getStringValue()
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
214 : "";
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
215
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
216 if (sel.equals("single")) {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
217 DataItem[] single = dSingle.getItems();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
218
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
219 text = wMode
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
220 ? createWString(single[0])
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
221 : createQString(single[0]);
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
222 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
223 else {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
224 DataItem[] from = dFrom.getItems();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
225 DataItem[] to = dTo.getItems();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
226 DataItem[] step = dStep.getItems();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
227
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
228 text = wMode
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
229 ? createWString(from[0], to[0], step[0])
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
230 : createQString(from[0], to[0], step[0]);
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
231 }
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
232
91
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 83
diff changeset
233 Label selected = new Label(text);
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 83
diff changeset
234 selected.setWidth("130px");
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 83
diff changeset
235
58
d018995fbee7 The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
236 Canvas back = getBackButton(dataList.getState());
d018995fbee7 The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
237
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
238 layout.addMember(label);
94
eb54fb9f5f2c Fixed some issues.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 91
diff changeset
239 layout.addMember(selected);
58
d018995fbee7 The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 57
diff changeset
240 layout.addMember(back);
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
241
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
242 return layout;
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
243 }
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
244
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
245
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
246 protected void createWQInputPanel() {
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
247 wqTable.setWidth100();
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
248 wqTable.setShowRecordComponents(true);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
249 wqTable.setShowRecordComponentsByCell(true);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
250 wqTable.setHeight100();
264
337f5a7c7160 Changed the empty table message for the WQ input table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 250
diff changeset
251 wqTable.setEmptyMessage(MESSAGE.empty_table());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
252
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
253 wqRangeTable.setWidth100();
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
254 wqRangeTable.setShowRecordComponents(true);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
255 wqRangeTable.setShowRecordComponentsByCell(true);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
256 wqRangeTable.setHeight100();
264
337f5a7c7160 Changed the empty table message for the WQ input table.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 250
diff changeset
257 wqRangeTable.setEmptyMessage(MESSAGE.empty_table());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
258
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
259 ListGridField addWQ = new ListGridField("", "");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
260 addWQ.setType(ListGridFieldType.ICON);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
261 addWQ.setWidth(30);
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
262
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
263 CellClickHandler cch = new CellClickHandler() {
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
264 public void onCellClick(CellClickEvent e) {
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
265 if (e.getColNum() == 0 && e.getRecord().getEnabled ()) {
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
266 Record r = e.getRecord ();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
267 double val = r.getAttributeAsDouble("value");
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
268 if(isWMode() && !isRangeMode()) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
269 double[] in = wArrayPanel.getInputValues();
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
270 int size = 0;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
271 if (in == null) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
272 double[] vals = new double[1];
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
273 vals[0] = val;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
274 wArrayPanel.setValues(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
275 setSingleW(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
276 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
277 else {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
278 double[] vals = new double[in.length+1];
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
279 for(int i = 0; i < in.length; i++) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
280 vals[i] = in[i];
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
281 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
282 vals[in.length] = val;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
283 wArrayPanel.setValues(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
284 setSingleW(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
285 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
286 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
287 else if (!isWMode() && !isRangeMode()) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
288 double[] in = qArrayPanel.getInputValues();
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
289 int size = 0;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
290 if (in == null) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
291 double[] vals = new double[1];
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
292 vals[0] = val;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
293 qArrayPanel.setValues(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
294 setSingleQ(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
295 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
296 else {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
297 double[] vals = new double[in.length+1];
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
298 for(int i = 0; i < in.length; i++) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
299 vals[i] = in[i];
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
300 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
301 vals[in.length] = val;
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
302 qArrayPanel.setValues(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
303 setSingleQ(vals);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
304 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
305 }
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
306 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
307 }
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
308 };
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
309
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
310 CellClickHandler cchRange = new CellClickHandler() {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
311 public void onCellClick(CellClickEvent e) {
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
312 if (e.getColNum() == 0 && e.getRecord().getEnabled ()) {
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
313 Record r = e.getRecord ();
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
314 double val = r.getAttributeAsDouble("value");
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
315 if(isWMode() && isRangeMode()) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
316 wRangePanel.setValues(
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
317 val,
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
318 wRangePanel.getTo(),
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
319 wRangePanel. getStep());
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
320 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
321 else if (!isWMode() && isRangeMode()) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
322 qRangePanel.setValues(
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
323 val,
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
324 qRangePanel.getTo(),
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
325 qRangePanel.getStep());
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
326 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
327 }
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
328 if (e.getColNum() == 1 && e.getRecord().getEnabled()) {
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
329 Record r = e.getRecord ();
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
330 double val = r.getAttributeAsDouble("value");
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
331 if (isWMode() && isRangeMode()) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
332 wRangePanel.setValues(
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
333 wRangePanel.getFrom(),
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
334 val,
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
335 wRangePanel.getStep());
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
336 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
337 else if(!isWMode() && isRangeMode()) {
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
338 qRangePanel.setValues(
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
339 qRangePanel.getFrom(),
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
340 val,
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
341 qRangePanel.getStep());
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
342 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
343 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
344 }
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
345 };
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
346 wqTable.addCellClickHandler(cch);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
347 wqRangeTable.addCellClickHandler(cchRange);
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
348 addWQ.setCellIcon (IMAGES.markerGreen().getURL());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
349
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
350 ListGridField addWQMin = new ListGridField("", "");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
351 addWQMin.setType(ListGridFieldType.ICON);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
352 addWQMin.setWidth(30);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
353 ListGridField addWQMax = new ListGridField("", "");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
354 addWQMax.setType(ListGridFieldType.ICON);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
355 addWQMax.setWidth(30);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
356
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
357 wqRangeTable.addCellClickHandler(cch);
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
358 addWQMin.setCellIcon(IMAGES.markerGreen().getURL());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
359 addWQMax.setCellIcon(IMAGES.markerRed().getURL());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
360
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
361 ListGridField name = new ListGridField("name", MESSAGE.name());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
362 name.setType(ListGridFieldType.TEXT);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
363 name.setWidth("*");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
364 ListGridField type = new ListGridField("type", MESSAGE.type());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
365 type.setType(ListGridFieldType.TEXT);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
366 type.setWidth("50");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
367 ListGridField value = new ListGridField("value", MESSAGE.wq_value());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
368 value.setType(ListGridFieldType.TEXT);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
369 type.setWidth("50");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
370
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
371 ListGridField name_r = new ListGridField("name", MESSAGE.name());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
372 name_r.setType(ListGridFieldType.TEXT);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
373 name_r.setWidth("*");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
374 ListGridField type_r = new ListGridField("type", MESSAGE.type());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
375 type_r.setType(ListGridFieldType.TEXT);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
376 type_r.setWidth("50");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
377 ListGridField value_r = new ListGridField("value", MESSAGE.wq_value());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
378 value_r.setType(ListGridFieldType.TEXT);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
379 type_r.setWidth("50");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
380
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
381 wqTable.setSelectionType(SelectionStyle.SINGLE);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
382 wqRangeTable.setSelectionType(SelectionStyle.SINGLE);
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
383 wqTable.setFields(addWQ, name, type, value);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
384 wqRangeTable.setFields(addWQMin, addWQMax, name_r, type_r, value_r);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
385 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
386
56
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
387 /**
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
388 * This method reads the default values defined in the DataItems of the Data
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
389 * objects in <i>list</i>.
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
390 *
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
391 * @param list The DataList container that stores the Data objects.
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
392 */
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
393 protected void initDefaults(DataList list) {
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
394 Data f = getData(list.getAll(), "wq_from");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
395 Data t = getData(list.getAll(), "wq_to");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
396 Data s = getData(list.getAll(), "wq_step");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
397
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
398 DataItem fQItem = getDataItem(f.getItems(), "minQ");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
399 DataItem fWItem = getDataItem(f.getItems(), "minW");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
400 DataItem tQItem = getDataItem(t.getItems(), "maxQ");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
401 DataItem tWItem = getDataItem(t.getItems(), "maxW");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
402 DataItem sQItem = getDataItem(s.getItems(), "stepQ");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
403 DataItem sWItem = getDataItem(s.getItems(), "stepW");
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
404
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
405 minW = Double.valueOf(fWItem.getStringValue());
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
406 maxW = Double.valueOf(tWItem.getStringValue());
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
407 stepW = Double.valueOf(sWItem.getStringValue());
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
408
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
409 minQ = Double.valueOf(fQItem.getStringValue());
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
410 maxQ = Double.valueOf(tQItem.getStringValue());
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
411 stepQ = Double.valueOf(sQItem.getStringValue());
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
412
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
413 this.fromW = minW;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
414 this.toW = maxW;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
415 this.stepW = stepW;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
416
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
417 this.fromQ = minQ;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
418 this.toQ = maxQ;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
419 this.stepQ = stepQ;
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
420 }
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
421
c9c19761a449 Read min/max values for the distance modes in WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 53
diff changeset
422
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
423 protected String createWString(DataItem from, DataItem to, DataItem step) {
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
424 StringBuilder sb = new StringBuilder();
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
425 sb.append(from.getLabel());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
426 sb.append(" " + MESSAGE.unitWFrom() + " ");
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
427 sb.append(to.getLabel());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
428 sb.append(" " + MESSAGE.unitWTo() + " ");
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
429 sb.append(step.getLabel());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
430 sb.append(" " + MESSAGE.unitWStep());
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
431
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
432 return sb.toString();
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
433 }
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
434
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
435
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
436 protected String createWString(DataItem single) {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
437 return single.getLabel();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
438 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
439
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
440
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
441 protected String createQString(DataItem from, DataItem to, DataItem step) {
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
442 StringBuilder sb = new StringBuilder();
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
443 sb.append(from.getLabel());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
444 sb.append(" " + MESSAGE.unitQFrom() + " ");
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
445 sb.append(to.getLabel());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
446 sb.append(" " + MESSAGE.unitQTo() + " ");
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
447 sb.append(step.getLabel());
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
448 sb.append(" " + MESSAGE.unitQStep());
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
449
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
450 return sb.toString();
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
451 }
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
452
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
453
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
454 protected String createQString(DataItem single) {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
455 return single.getLabel();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
456 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
457
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
458
53
3d5d7788d471 The widgets in the static part of the parameter panel are created using UIProviders now. The ParameterList does not build widgets any longer.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 51
diff changeset
459 /**
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
460 * This method creates the whole widget. There is a panel on the left, that
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
461 * allows the user to enter values manually by keyboard. On the right, there
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
462 * is a table that allows the user to enter values by mouse click.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
463 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
464 * @param data The data that is displayed in the table on the right.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
465 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
466 * @return the widget.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
467 */
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
468 protected Canvas createWidget(DataList data) {
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
469 VLayout layout = new VLayout();
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
470 container = new HLayout();
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
471 Canvas modeForm = createModePanel();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
472
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
473 container.setMembersMargin(30);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
474 createWQInputTable();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
475 createWQInputPanel();
48
6e191588a295 Render the Single-W panel initially when the WQInputPanel is rendered.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 47
diff changeset
476 // the initial panel is the Single-W panel.
6e191588a295 Render the Single-W panel initially when the WQInputPanel is rendered.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 47
diff changeset
477 double[] values = getSingleW();
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
478 wArrayPanel = new DoubleArrayPanel(
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
479 MESSAGE.unitWSingle(), values, this);
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
480 container.addMember(wArrayPanel);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
481 helperContainer.addChild(wqTable);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
482 layout.addMember(modeForm);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
483 layout.addMember(container);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
484
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
485 return layout;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
486 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
487
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
488
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
489 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
490 * This method creates the mode panel. It contains two radio button panels
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
491 * that allows the user to switch the input mode between w/q and
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
492 * single/range input.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
493 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
494 * @return a panel.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
495 */
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
496 protected Canvas createModePanel() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
497 RadioGroupItem wq = new RadioGroupItem(FIELD_WQ);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
498 wq.setShowTitle(false);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
499 wq.setVertical(false);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
500 wq.setWidth(WIDTH_LEFT);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
501
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
502 RadioGroupItem mode = new RadioGroupItem(FIELD_MODE);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
503 mode.setShowTitle(false);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
504 mode.setVertical(false);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
505 mode.setWidth(WIDTH_LEFT);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
506
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
507 LinkedHashMap wqValues = new LinkedHashMap();
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
508 wqValues.put(FIELD_WQ_W, MESSAGE.wqW());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
509 wqValues.put(FIELD_WQ_Q, MESSAGE.wqQ());
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
510
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
511 LinkedHashMap modeValues = new LinkedHashMap();
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
512 modeValues.put(FIELD_MODE_SINGLE, MESSAGE.wqSingle());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
513 modeValues.put(FIELD_MODE_RANGE, MESSAGE.wqRange());
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
514
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
515 wq.setValueMap(wqValues);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
516 mode.setValueMap(modeValues);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
517
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
518 wq.addChangeHandler(this);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
519 mode.addChangeHandler(this);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
520
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
521 modes = new DynamicForm();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
522 modes.setFields(wq, mode);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
523 modes.setWidth(WIDTH_LEFT);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
524 modes.setNumCols(1);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
525
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
526 LinkedHashMap initial = new LinkedHashMap();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
527 initial.put(FIELD_WQ, FIELD_WQ_W);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
528 initial.put(FIELD_MODE, FIELD_MODE_SINGLE);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
529 modes.setValues(initial);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
530
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
531 return modes;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
532 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
533
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
534
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
535 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
536 * This method returns the selected data.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
537 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
538 * @return the selected/inserted data.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
539 */
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
540 public Data[] getData() {
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
541 // XXX If we have entered a value and click right afterwards on the
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
542 // 'next' button, the BlurEvent is not fired, and the values are not
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
543 // saved. So, we gonna save those values explicitly.
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
544 if (!isRangeMode()) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
545 Canvas member = container.getMember(0);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
546 if (member instanceof DoubleArrayPanel) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
547 DoubleArrayPanel form = (DoubleArrayPanel) member;
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
548 if (isWMode()) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
549 saveSingleWValues(form);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
550 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
551 else {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
552 saveSingleQValues(form);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
553 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
554 }
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
555
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
556 return new Data[] {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
557 getDataMode(),
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
558 getDataSelectionMode(),
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
559 getDataSingle() };
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
560 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
561 else {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
562 Canvas member = container.getMember(0);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
563 if (member instanceof DoubleRangePanel) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
564 DoubleRangePanel form = (DoubleRangePanel) member;
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
565
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
566 if (isWMode()) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
567 saveRangeWValues(form);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
568 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
569 else {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
570 saveRangeQValues(form);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
571 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
572 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
573
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
574 return new Data[] {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
575 getDataMode(),
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
576 getDataSelectionMode(),
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
577 getDataFrom(),
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
578 getDataTo(),
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
579 getDataStep() };
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
580 }
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
581 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
582
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
583
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
584 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
585 * Returns the Data object for the 'mode' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
586 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
587 * @return the Data object for the 'mode' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
588 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
589 protected Data getDataMode() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
590 String wqMode = modes.getValueAsString(FIELD_WQ);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
591 DataItem item = new DefaultDataItem("wq_mode", "wq_mode", wqMode);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
592 return new DefaultData(
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
593 "wq_mode", null, null, new DataItem[] { item });
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
594 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
595
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
596
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
597 /**
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
598 * Returns the Data object for the 'mode' attribute.
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
599 *
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
600 * @return the Data object for the 'mode' attribute.
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
601 */
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
602 protected Data getDataSelectionMode() {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
603 String wqSelection = modes.getValueAsString(FIELD_MODE);
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
604 DataItem item = new DefaultDataItem(
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
605 "wq_selection", "wq_selection", wqSelection);
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
606
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
607 return new DefaultData(
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
608 "wq_selection", null, null, new DataItem[] { item });
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
609 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
610
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
611
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
612 /**
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
613 * Returns the data object for the 'single' attribute.
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
614 *
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
615 * @return the Data object for the 'single' attribute.
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
616 */
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
617 protected Data getDataSingle() {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
618 double[] values = getFinalSingle();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
619 StringBuilder sb = new StringBuilder();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
620 for (double value: values) {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
621 sb.append(Double.toString(value));
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
622 sb.append(" ");
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
623 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
624
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
625 DataItem item = new DefaultDataItem(
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
626 "wq_single", "wq_single", sb.toString());
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
627
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
628 return new DefaultData(
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
629 "wq_single", null, null, new DataItem[] { item });
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
630 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
631
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
632
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
633 /**
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
634 * Returns the Data object for the 'from' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
635 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
636 * @return the Data object for the 'from' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
637 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
638 protected Data getDataFrom() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
639 String value = Double.valueOf(getFinalFrom()).toString();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
640 DataItem item = new DefaultDataItem("wq_from", "wq_from", value);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
641 return new DefaultData(
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
642 "wq_from", null, null, new DataItem[] { item });
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
643 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
644
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
645
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
646 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
647 * Returns the Data object for the 'to' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
648 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
649 * @return the Data object for the 'to' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
650 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
651 protected Data getDataTo() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
652 String value = Double.valueOf(getFinalTo()).toString();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
653 DataItem item = new DefaultDataItem("wq_to", "wq_to", value);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
654 return new DefaultData(
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
655 "wq_to", null, null, new DataItem[] { item });
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
656 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
657
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
658
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
659 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
660 * Returns the Data object for the 'step' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
661 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
662 * @return the Data object for the 'step' attribute.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
663 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
664 protected Data getDataStep() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
665 String value = Double.valueOf(getFinalStep()).toString();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
666 DataItem item = new DefaultDataItem("wq_step","wq_step", value);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
667 return new DefaultData(
51
a2923d63f530 Introduced a data structure DataList to manage to list of Data objects of a single state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 48
diff changeset
668 "wq_step", null, null, new DataItem[] { item });
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
669 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
670
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
671
236
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
672 protected double[] getFinalSingle() {
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
673 boolean wMode = isWMode();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
674
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
675 return wMode ? getSingleW() : getSingleQ();
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
676 }
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
677
d12078053b59 Introduced two further parameters in the WQ panel to determine the selection mode (range/single, w/q).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 234
diff changeset
678
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
679 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
680 * Returns the value of 'from' depending on the selected input mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
681 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
682 * @return the value of 'from' depending on the selected input mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
683 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
684 protected double getFinalFrom() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
685 boolean wMode = isWMode();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
686 boolean rangeMode = isRangeMode();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
687
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
688 if (rangeMode) {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
689 return wMode ? getFromW() : getFromQ();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
690
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
691 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
692 else {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
693 double[] values = wMode ? getSingleW() : getSingleQ();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
694 double value = Double.MAX_VALUE;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
695
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
696 for (double v: values) {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
697 value = value < v ? value : v;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
698 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
699
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
700 return value;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
701 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
702 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
703
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
704
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
705 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
706 * Returns the value of 'to' depending on the selected input mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
707 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
708 * @return the value of 'to' depending on the selected input mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
709 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
710 protected double getFinalTo() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
711 boolean wMode = isWMode();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
712 boolean rangeMode = isRangeMode();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
713
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
714 if (rangeMode) {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
715 return wMode ? getToW() : getToQ();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
716
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
717 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
718 else {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
719 double[] values = wMode ? getSingleW() : getSingleQ();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
720 double value = Double.MIN_VALUE;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
721
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
722 for (double v: values) {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
723 value = value > v ? value : v;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
724 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
725
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
726 return value;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
727 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
728 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
729
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
730
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
731 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
732 * Returns the value of 'step' depending on the selected input mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
733 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
734 * @return the value of 'step' depending on the selected input mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
735 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
736 protected double getFinalStep() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
737 boolean wMode = isWMode();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
738 boolean rangeMode = isRangeMode();
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
739
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
740 if (rangeMode) {
234
27f5afc4dbde Bugfix: the WQ panel now returns the correct step width value if the range mode is selected.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
741 return wMode ? getStepW() : getStepQ();
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
742 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
743 else {
234
27f5afc4dbde Bugfix: the WQ panel now returns the correct step width value if the range mode is selected.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
744 // we have no field to enter the 'step' attribute in the
27f5afc4dbde Bugfix: the WQ panel now returns the correct step width value if the range mode is selected.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
745 // single mode
27f5afc4dbde Bugfix: the WQ panel now returns the correct step width value if the range mode is selected.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
746 return 0d;
47
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
747 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
748 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
749
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
750
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
751 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
752 * Determines the range/single mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
753 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
754 * @return true if the range mode is activated.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
755 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
756 public boolean isRangeMode() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
757 String rMode = modes.getValueAsString(FIELD_MODE);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
758
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
759 return rMode.equals(FIELD_MODE_RANGE) ? true : false;
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
760 }
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
761
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
762
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
763 /**
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
764 * Determines the w/q mode.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
765 *
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
766 * @return true, if the W mode is activated.
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
767 */
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
768 public boolean isWMode() {
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
769 String wq = modes.getValueAsString(FIELD_WQ);
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
770
45ae03d9ca2b Implemented the getData() method of the WQInputPanel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 45
diff changeset
771 return wq.equals(FIELD_WQ_W) ? true : false;
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
772 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
773
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
774
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
775 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
776 * This method changes the lower panel with the input fields depending on
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
777 * the combination of the two radio button panels.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
778 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
779 * @param event The ChangeEvent.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
780 */
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
781 public void onChange(ChangeEvent event) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
782 DynamicForm form = event.getForm();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
783 FormItem item = event.getItem();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
784
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
785 String wqMode = null;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
786 String inputMode = null;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
787
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
788 if (item.getFieldName().equals(FIELD_MODE)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
789 wqMode = form.getValueAsString(FIELD_WQ);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
790 inputMode = (String) event.getValue();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
791 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
792 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
793 wqMode = (String) event.getValue();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
794 inputMode = form.getValueAsString(FIELD_MODE);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
795 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
796
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
797 updatePanels(wqMode, inputMode);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
798 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
799
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
800
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
801 protected void updatePanels(String wqMode, String inputMode) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
802 container.removeMembers(container.getMembers());
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
803 GWT.log("updating Panel and Table");
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
804 if (wqMode.equals(FIELD_WQ_W)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
805 if (inputMode.equals(FIELD_MODE_SINGLE)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
806 // Single W mode
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
807 double[] values = getSingleW();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
808
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
809 wArrayPanel = new DoubleArrayPanel(
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
810 MESSAGE.unitWSingle(), values, this);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
811
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
812 container.addMember(wArrayPanel);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
813 helperContainer.addChild(wqTable);
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
814 int size = wqTable.getRecords().length;
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
815 for(int i = 0; i < size; i++) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
816 ListGridRecord r = wqTable.getRecord(i);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
817 String type = r.getAttributeAsString("type");
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
818 if (type.equals("W")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
819 wqTable.getRecord(i).setEnabled(true);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
820 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
821 else if(type.equals("D") || type.equals("Q")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
822 wqTable.getRecord(i).setEnabled(false);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
823 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
824 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
825 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
826 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
827 // Range W mode
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
828 double from = getFromW();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
829 double to = getToW();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
830 double step = getStepW();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
831
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
832 wRangePanel = new DoubleRangePanel(
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
833 MESSAGE.unitWFrom(), MESSAGE.unitWTo(), MESSAGE.unitWStep(),
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
834 from, to, step,
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
835 250,
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
836 this);
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
837 container.addMember(wRangePanel);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
838 helperContainer.addChild(wqRangeTable);
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
839 int size = wqRangeTable.getRecords().length;
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
840 for(int i = 0; i < size; i++) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
841 ListGridRecord r = wqRangeTable.getRecord(i);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
842 String type = r.getAttributeAsString("type");
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
843 if (type.equals("W")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
844 wqRangeTable.getRecord(i).setEnabled(true);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
845 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
846 else if(type.equals("D") || type.equals("Q")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
847 wqRangeTable.getRecord(i).setEnabled(false);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
848 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
849 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
850 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
851 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
852 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
853 if (inputMode.equals(FIELD_MODE_SINGLE)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
854 // Single Q mode
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
855 double[] values = getSingleQ();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
856
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
857 qArrayPanel = new DoubleArrayPanel(
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
858 MESSAGE.unitQSingle(), values, this);
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
859 container.addMember(qArrayPanel);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
860 helperContainer.addChild(wqTable);
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
861 int size = wqTable.getRecords().length;
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
862 for(int i = 0; i < size; i++) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
863 ListGridRecord r = wqTable.getRecord(i);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
864 String type = r.getAttributeAsString("type");
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
865 if (type.equals("W")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
866 wqTable.getRecord(i).setEnabled(false);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
867 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
868 else if(type.equals("D") || type.equals("Q")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
869 wqTable.getRecord(i).setEnabled(true);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
870 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
871 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
872
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
873 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
874 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
875 // Range Q mode
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
876 double from = getFromQ();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
877 double to = getToQ();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
878 double step = getStepQ();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
879
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
880 qRangePanel = new DoubleRangePanel(
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
881 MESSAGE.unitQFrom(), MESSAGE.unitQTo(), MESSAGE.unitQStep(),
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
882 from, to, step,
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
883 250,
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
884 this);
249
6c7133eb8c4c Implemented handler for WQ value selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 248
diff changeset
885 container.addMember(qRangePanel);
272
d3c053420c3b ISSUE 44: Moved the location/range and WQ input tables to the helper panel and
Raimund Renkert <raimund.renkert@intevation.de>
parents: 264
diff changeset
886 helperContainer.addChild(wqRangeTable);
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
887 int size = wqRangeTable.getRecords().length;
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
888 for(int i = 0; i < size; i++) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
889 ListGridRecord r = wqRangeTable.getRecord(i);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
890 String type = r.getAttributeAsString("type");
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
891 if (type.equals("W")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
892 wqRangeTable.getRecord(i).setEnabled(false);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
893 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
894 else if(type.equals("D") || type.equals("Q")) {
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
895 wqRangeTable.getRecord(i).setEnabled(true);
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
896 }
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
897 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
898 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
899 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
900 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
901
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
902 /**
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
903 * This method is called if the value of one of the input fields might have
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
904 * changed. The entered values are validated and stored.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
905 *
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
906 * @param event The BlurEvent.
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
907 */
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
908 public void onBlur(BlurEvent event) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
909 DynamicForm form = event.getForm();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
910 FormItem item = event.getItem();
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
911
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
912 String wqMode = (String) modes.getValue(FIELD_WQ);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
913 String inputMode = (String) modes.getValue(FIELD_MODE);
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
914
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
915 if (wqMode.equals(FIELD_WQ_W)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
916 if (inputMode.equals(FIELD_MODE_SINGLE)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
917 DoubleArrayPanel p = (DoubleArrayPanel) form;
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
918 saveSingleWValue(p, item);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
919 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
920 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
921 DoubleRangePanel p = (DoubleRangePanel) form;
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
922 saveRangeWValue(p, item);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
923 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
924 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
925 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
926 if (inputMode.equals(FIELD_MODE_SINGLE)) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
927 DoubleArrayPanel p = (DoubleArrayPanel) form;
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
928 saveSingleQValue(p, item);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
929 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
930 else {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
931 DoubleRangePanel p = (DoubleRangePanel) form;
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
932 saveRangeQValue(p, item);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
933 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
934 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
935 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
936
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
937
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
938 protected void saveSingleWValues(DoubleArrayPanel p) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
939 FormItem[] formItems = p.getFields();
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
940
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
941 for (FormItem item: formItems) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
942 if (item.getFieldName().equals(DoubleArrayPanel.FIELD_NAME)) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
943 saveSingleWValue(p, item);
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
944 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
945 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
946 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
947
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
948
59
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
949 protected void saveSingleQValues(DoubleArrayPanel p) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
950 FormItem[] formItems = p.getFields();
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
951
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
952 for (FormItem item: formItems) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
953 if (item.getFieldName().equals(DoubleArrayPanel.FIELD_NAME)) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
954 saveSingleQValue(p, item);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
955 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
956 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
957 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
958
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
959
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
960 protected void saveSingleWValue(DoubleArrayPanel p, FormItem item) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
961 if (p.validateForm(item)) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
962 setSingleW(p.getInputValues(item));
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
963 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
964 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
965
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
966
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
967 protected void saveSingleQValue(DoubleArrayPanel p, FormItem item) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
968 if (p.validateForm(item)) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
969 setSingleQ(p.getInputValues(item));
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
970 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
971 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
972
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
973
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
974 protected void saveRangeWValues(DoubleRangePanel p) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
975 FormItem[] formItems = p.getFields();
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
976
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
977 for (FormItem item: formItems) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
978 saveRangeWValue(p, item);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
979 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
980 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
981
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
982
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
983 protected void saveRangeQValues(DoubleRangePanel p) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
984 FormItem[] formItems = p.getFields();
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
985
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
986 for (FormItem item: formItems) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
987 saveRangeQValue(p, item);
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
988 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
989 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
990
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
991
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
992 protected void saveRangeWValue(DoubleRangePanel p, FormItem item) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
993 if (p.validateForm(item)) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
994 setFromW(p.getFrom());
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
995 setToW(p.getTo());
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
996 setStepW(p.getStep());
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
997 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
998 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
999
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1000
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1001 protected void saveRangeQValue(DoubleRangePanel p, FormItem item) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1002 if (p.validateForm(item)) {
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1003 setFromQ(p.getFrom());
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1004 setToQ(p.getTo());
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1005 setStepQ(p.getStep());
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1006 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1007 }
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1008
a3d235c63195 Save the data explicitly in the LocationDistancePanel and WQInputPanel before returning the user input to avoid a nullpointer exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 58
diff changeset
1009
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1010 protected double[] getSingleQ() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1011 return valuesQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1012 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1013
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1014
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1015 protected void setSingleQ(double[] values) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1016 valuesQ = values;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1017 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1018
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1019
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1020 protected double getFromQ() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1021 return fromQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1022 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1023
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1024
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1025 protected void setFromQ(double fromQ) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1026 this.fromQ = fromQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1027 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1028
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1029
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1030 protected double getToQ() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1031 return toQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1032 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1033
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1034
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1035 protected void setToQ(double toQ) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1036 this.toQ = toQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1037 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1038
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1039
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1040 protected double getStepQ() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1041 return stepQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1042 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1043
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1044
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1045 protected void setStepQ(double stepQ) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1046 this.stepQ = stepQ;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1047 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1048
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1049
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1050 protected double[] getSingleW() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1051 return valuesW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1052 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1053
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1054
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1055 protected void setSingleW(double[] values) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1056 valuesW = values;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1057 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1058
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1059
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1060 protected double getFromW() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1061 return fromW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1062 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1063
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1064
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1065 protected void setFromW(double fromW) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1066 this.fromW = fromW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1067 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1068
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1069
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1070 protected double getToW() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1071 return toW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1072 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1073
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1074
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1075 protected void setToW(double toW) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1076 this.toW = toW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1077 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1078
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1079
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1080 protected double getStepW() {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1081 return stepW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1082 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1083
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1084
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1085 protected void setStepW(double stepW) {
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1086 this.stepW = stepW;
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1087 }
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1088
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1089
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1090 protected void createWQInputTable() {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1091 Config config = Config.getInstance();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1092 String url = config.getServerUrl();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1093 String locale = config.getLocale ();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1094 String river = "";
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1095 String value_min = "";
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1096 String value_max = "";
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1097
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1098 ArtifactDescription adescr = artifact.getArtifactDescription();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1099 DataList[] data = adescr.getOldData();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1100
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1101 //TODO: get the information about old data.
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1102 if (data != null && data.length > 0) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1103 for (int i = 0; i < data.length; i++) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1104 DataList dl = data[i];
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1105 if (dl.getState().equals("state.winfo.river")) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1106 for (int j = 0; j < dl.size(); j++) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1107 Data d = dl.get(j);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1108 DataItem[] di = d.getItems();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1109 if (di != null && di.length == 1) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1110 river = d.getItems()[0].getStringValue();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1111 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1112 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1113 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1114 else if (dl.getState().equals("state.winfo.location_distance")){
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1115 for (int j = 0; j < dl.size(); j++) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1116 Data d = dl.get(j);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1117 DataItem[] di = d.getItems();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1118 if (di != null && di.length >= 1 && j == 0) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1119 value_max = d.getItems()[0].getStringValue();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1120 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1121 else if (di != null &&
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1122 di.length >= 1 &&
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1123 j == dl.size() - 1) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1124 value_min = d.getItems()[0].getStringValue();
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1125 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1126 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1127 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1128 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1129 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1130
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1131 double from = Double.valueOf(value_min);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1132 double to = Double.valueOf(value_max);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1133 wqInfoService.getWQInfo(url, locale, river, from, to,
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1134 new AsyncCallback<WQInfoObject[]>() {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1135 public void onFailure(Throwable caught) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1136 GWT.log("Could not recieve wq informations.");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1137 GWT.log(caught.getMessage());
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1138 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1139
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1140 public void onSuccess(WQInfoObject[] wqi) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1141 int num = wqi != null ? wqi.length :0;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1142 GWT.log("Recieved " + num + " wq informations.");
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1143
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1144 if (num == 0) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1145 return;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1146 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1147 tableData = wqi;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1148 addWQInfo(wqi);
250
27f12703937e Enable or disable table rows depending on the WQ selection.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 249
diff changeset
1149 updatePanels(FIELD_WQ_W, FIELD_MODE_SINGLE);
248
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1150 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1151 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1152 );
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1153 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1154
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1155
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1156 protected void addWQInfo (WQInfoObject[] wqi) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1157 int i = 0;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1158 for(WQInfoObject wi: wqi) {
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1159 WQInfoRecord rec = new WQInfoRecord (wi);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1160 wqTable.addData(rec);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1161 wqRangeTable.addData(rec);
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1162 }
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1163 return;
ed90309ec608 Added table for WQ inputs.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 247
diff changeset
1164 }
42
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1165 }
ba7df4a24ae0 Added a new widget to enter w/Q values in single and range mode.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1166 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org