Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 45:f99c5f8e4672
Some GUI improvements in the Location/Distance, W/Q and Module panels.
flys-client/trunk@1490 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 17 Mar 2011 09:54:05 +0000 |
parents | 6bcd8e3f21a7 |
children | 0d4795b4f284 |
comparison
equal
deleted
inserted
replaced
44:3853210f2d18 | 45:f99c5f8e4672 |
---|---|
6 import com.google.gwt.core.client.GWT; | 6 import com.google.gwt.core.client.GWT; |
7 import com.google.gwt.i18n.client.NumberFormat; | 7 import com.google.gwt.i18n.client.NumberFormat; |
8 | 8 |
9 import com.smartgwt.client.types.TitleOrientation; | 9 import com.smartgwt.client.types.TitleOrientation; |
10 import com.smartgwt.client.widgets.Canvas; | 10 import com.smartgwt.client.widgets.Canvas; |
11 import com.smartgwt.client.widgets.IButton; | |
11 import com.smartgwt.client.widgets.Label; | 12 import com.smartgwt.client.widgets.Label; |
12 import com.smartgwt.client.widgets.form.DynamicForm; | 13 import com.smartgwt.client.widgets.form.DynamicForm; |
13 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; | 14 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
14 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; | 15 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; |
15 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; | 16 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; |
91 * @return a panel. | 92 * @return a panel. |
92 */ | 93 */ |
93 public Canvas create(Data data) { | 94 public Canvas create(Data data) { |
94 VLayout layout = new VLayout(); | 95 VLayout layout = new VLayout(); |
95 | 96 |
96 Label label = new Label(MESSAGES.location_distance_state()); | 97 Label label = new Label(MESSAGES.location_distance_state()); |
98 Canvas widget = createWidget(data); | |
99 IButton submit = new IButton(MESSAGES.next(), this); | |
100 | |
101 label.setHeight(25); | |
102 | |
103 layout.addMember(label); | |
104 layout.addMember(widget); | |
105 layout.addMember(submit); | |
106 | |
107 return layout; | |
108 } | |
109 | |
110 | |
111 protected Canvas createWidget(Data data) { | |
112 VLayout layout = new VLayout(); | |
97 container = new HLayout(); | 113 container = new HLayout(); |
98 Canvas checkboxPanel = createRadioButtonPanel(); | 114 Canvas checkboxPanel = createRadioButtonPanel(); |
99 | 115 |
100 label.setHeight(25); | 116 // the initial view will display the location input mode |
101 | 117 Canvas locationPanel = new DoubleArrayPanel( |
102 layout.addMember(label); | 118 MESSAGES.unitLocation(), |
119 getLocationValues(), | |
120 this); | |
121 container.addMember(locationPanel); | |
122 | |
103 layout.addMember(checkboxPanel); | 123 layout.addMember(checkboxPanel); |
104 layout.addMember(container); | 124 layout.addMember(container); |
105 | 125 |
106 // TODO Add a table on the right to select locations by mouse click | 126 // TODO Add a table on the right to select locations by mouse click |
107 | 127 |
203 | 223 |
204 LinkedHashMap values = new LinkedHashMap(); | 224 LinkedHashMap values = new LinkedHashMap(); |
205 values.put(FIELD_LOCATION, MESSAGES.location()); | 225 values.put(FIELD_LOCATION, MESSAGES.location()); |
206 values.put(FIELD_DISTANCE, MESSAGES.distance()); | 226 values.put(FIELD_DISTANCE, MESSAGES.distance()); |
207 | 227 |
228 LinkedHashMap initial = new LinkedHashMap(); | |
229 initial.put("mode", FIELD_LOCATION); | |
230 | |
208 radio.setValueMap(values); | 231 radio.setValueMap(values); |
209 radio.addChangeHandler(this); | 232 radio.addChangeHandler(this); |
210 | 233 |
211 mode.setFields(radio); | 234 mode.setFields(radio); |
235 mode.setValues(initial); | |
212 | 236 |
213 return mode; | 237 return mode; |
214 } | 238 } |
215 | 239 |
216 | 240 |