Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java @ 249:6c7133eb8c4c
Implemented handler for WQ value selection.
flys-client/trunk@1837 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 05 May 2011 13:32:36 +0000 |
parents | b92281182c6b |
children | e92f7ef455d6 |
rev | line source |
---|---|
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
3 import java.util.LinkedHashMap; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
4 |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import com.google.gwt.core.client.GWT; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
7 import com.smartgwt.client.types.VerticalAlignment; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import com.smartgwt.client.widgets.Canvas; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 import com.smartgwt.client.widgets.Label; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import com.smartgwt.client.widgets.form.DynamicForm; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import com.smartgwt.client.widgets.form.fields.RadioGroupItem; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import com.smartgwt.client.widgets.layout.HLayout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import com.smartgwt.client.widgets.layout.VLayout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.flys.client.shared.model.Data; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 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:
45
diff
changeset
|
17 import de.intevation.flys.client.shared.model.DataList; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.client.shared.model.DefaultData; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.client.shared.model.DefaultDataItem; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
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:
86
diff
changeset
|
21 import de.intevation.flys.client.client.FLYSConstants; |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 * The ModuleSelection combines the river selection and the module selection in |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 * one widget. It will display a vertical splitted widget - the upper part will |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 * render checkboxes for each module, the lower one will display a combobox at |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 * the left and a map panel on the right to choose the river. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 public class ModuleSelection extends MapSelection { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 /** The message class that provides i18n strings.*/ |
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:
86
diff
changeset
|
34 protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
36 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
37 /** Constant field name for the plugin selection.*/ |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
38 public static final String FIELD_PLUGIN = "plugin"; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
39 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
40 /** Constant value for the WINFO plugin.*/ |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
41 public static final String FIELD_PLUGIN_WINFO = "winfo"; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
42 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
43 /** Constant value for the MINFO plugin.*/ |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
44 public static final String FIELD_PLUGIN_MINFO = "minfo"; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
45 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
46 /** Constant value for the MAP plugin.*/ |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
47 public static final String FIELD_PLUGIN_MAP = "map"; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
48 |
86
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
49 /** Constant value for the CHART plugin.*/ |
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
50 public static final String FIELD_PLUGIN_CHART = "chart"; |
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
51 |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
52 /** Constant value for the FIX plugin.*/ |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
53 public static final String FIELD_PLUGIN_FIX = "fix"; |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
54 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
55 |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 /** The module checkboxes.*/ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 protected RadioGroupItem radio; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 * The default constructor. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 public ModuleSelection() { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 * This method returns a widget that renders the checkboxes for each module |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 * and the MapSelection that lets the user choose the river. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 * @param data The provided rivers. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 * @return the module selection combined with the river selection. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 */ |
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:
45
diff
changeset
|
75 public Canvas create(DataList data) { |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 VLayout newLayout = new VLayout(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 newLayout.setMembersMargin(10); |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
78 //newLayout.setAlign(VerticalAlignment.TOP); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 Canvas moduleSelection = createWidget(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 Canvas riverSelection = super.createWidget(data); |
57
246af33f621c
Adjusted the look of the 'next' button in the parameter panel.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
51
diff
changeset
|
82 Canvas go = getNextButton(); |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
83 //go.setLayoutAlign(VerticalAlignment.TOP); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
83
4784ca718476
Improved the positioning of helper widgets and some layout specific stuff.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
57
diff
changeset
|
85 riverSelection.setHeight(25); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 moduleSelection.setHeight(25); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 newLayout.addMember(moduleSelection); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 newLayout.addMember(riverSelection); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 newLayout.addMember(go); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 return newLayout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 * Creates a widget that displays a checkbox for each module. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 * @return a widget with checkboxes. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 protected Canvas createWidget() { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 HLayout layout = new HLayout(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 Label label = new Label(MESSAGES.module_selection()); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 DynamicForm form = new DynamicForm(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 radio = new RadioGroupItem("plugin"); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 label.setWidth(50); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
111 LinkedHashMap values = new LinkedHashMap(); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
112 values.put(FIELD_PLUGIN_WINFO, messages.winfo()); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
113 values.put(FIELD_PLUGIN_MINFO, messages.minfo()); |
86
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
114 values.put(FIELD_PLUGIN_FIX, messages.fix()); |
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
115 values.put(FIELD_PLUGIN_CHART, messages.chart()); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
116 values.put(FIELD_PLUGIN_MAP, messages.map()); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
117 |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 radio.setShowTitle(false); |
86
eae92a05282e
Added a further plugin in the module selection and changed its alignment to vertical.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
83
diff
changeset
|
119 radio.setVertical(true); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
120 radio.setValueMap(values); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
121 |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
122 LinkedHashMap initial = new LinkedHashMap(); |
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
123 initial.put(FIELD_PLUGIN, FIELD_PLUGIN_WINFO); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 form.setFields(radio); |
45
f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
38
diff
changeset
|
126 form.setValues(initial); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 layout.addMember(label); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 layout.addMember(form); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 return layout; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 /** |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 * This method prepares the data of two widgets - the module selection and |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 * the river selection. The returning field will contain the Data that |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 * represents the module selection at first position, the second position |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 * stores the Data object that represents the river selection. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 * |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 * @return the Data that was chosen in this widget. |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
142 */ |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 protected Data[] getData() { |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 Data[] river = super.getData(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 String module = radio.getValueAsString(); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 DataItem[] items = new DefaultDataItem[1]; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 items[0] = new DefaultDataItem(module, module, module); |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 |
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:
45
diff
changeset
|
151 Data data = new DefaultData("module", null, null, items); |
30
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 return new Data[] {data, river[0]}; |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 } |
5709bd8f4d7c
Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |