Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java @ 781:6653cf54b45d
The distance panel got two tables for locations and ranges. Both do not load any data until now.
flys-client/trunk@2271 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 30 Jun 2011 11:59:02 +0000 |
parents | a39c2f531755 |
children | 4a7ece57f44c |
comparison
equal
deleted
inserted
replaced
780:a39c2f531755 | 781:6653cf54b45d |
---|---|
10 import com.smartgwt.client.widgets.Label; | 10 import com.smartgwt.client.widgets.Label; |
11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; | 11 import com.smartgwt.client.widgets.form.fields.events.BlurHandler; |
12 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; | 12 import com.smartgwt.client.widgets.form.fields.events.BlurEvent; |
13 import com.smartgwt.client.widgets.layout.HLayout; | 13 import com.smartgwt.client.widgets.layout.HLayout; |
14 import com.smartgwt.client.widgets.layout.VLayout; | 14 import com.smartgwt.client.widgets.layout.VLayout; |
15 import com.smartgwt.client.widgets.tab.TabSet; | |
16 import com.smartgwt.client.widgets.tab.Tab; | |
15 | 17 |
16 import de.intevation.flys.client.shared.model.Data; | 18 import de.intevation.flys.client.shared.model.Data; |
17 import de.intevation.flys.client.shared.model.DataItem; | 19 import de.intevation.flys.client.shared.model.DataItem; |
18 import de.intevation.flys.client.shared.model.DataList; | 20 import de.intevation.flys.client.shared.model.DataList; |
19 import de.intevation.flys.client.shared.model.DefaultData; | 21 import de.intevation.flys.client.shared.model.DefaultData; |
20 import de.intevation.flys.client.shared.model.DefaultDataItem; | 22 import de.intevation.flys.client.shared.model.DefaultDataItem; |
21 | 23 |
22 import de.intevation.flys.client.client.FLYSConstants; | 24 import de.intevation.flys.client.client.FLYSConstants; |
25 import de.intevation.flys.client.client.ui.range.RangeTable; | |
26 import de.intevation.flys.client.client.ui.range.LocationsTable; | |
23 | 27 |
24 | 28 |
25 public class DistancePanel extends AbstractUIProvider implements BlurHandler { | 29 public class DistancePanel extends AbstractUIProvider implements BlurHandler { |
26 | 30 |
27 public static final int DEFAULT_STEP_WIDTH = 100; | 31 public static final int DEFAULT_STEP_WIDTH = 100; |
28 | 32 |
29 | 33 |
30 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); | 34 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
31 | 35 |
36 protected RangeTable distancesTable; | |
37 protected LocationsTable locationsTable; | |
38 | |
32 protected DoubleRangePanel distancePanel; | 39 protected DoubleRangePanel distancePanel; |
40 | |
41 protected TabSet tabs; | |
33 | 42 |
34 protected double min; | 43 protected double min; |
35 protected double max; | 44 protected double max; |
36 | 45 |
37 | 46 |
38 public DistancePanel() { | 47 public DistancePanel() { |
39 distancePanel = new DoubleRangePanel( | 48 distancesTable = new RangeTable(); |
49 locationsTable = new LocationsTable(); | |
50 distancePanel = new DoubleRangePanel( | |
40 MSG.unitFrom(), MSG.unitTo(), MSG.unitWidth(), | 51 MSG.unitFrom(), MSG.unitTo(), MSG.unitWidth(), |
41 0d, 0d, 0d, 250, this); | 52 0d, 0d, 0d, 250, this); |
42 } | 53 } |
43 | 54 |
44 | 55 |
58 layout.addMember(distancePanel); | 69 layout.addMember(distancePanel); |
59 layout.addMember(submit); | 70 layout.addMember(submit); |
60 | 71 |
61 initMinMaxValues(data); | 72 initMinMaxValues(data); |
62 initDefaultValues(data); | 73 initDefaultValues(data); |
74 initHelperPanel(); | |
63 | 75 |
64 return layout; | 76 return layout; |
65 } | 77 } |
66 | 78 |
67 | 79 |
279 DataItem def = data.getDefault(); | 291 DataItem def = data.getDefault(); |
280 String defValue = def != null ? def.getStringValue() : null; | 292 String defValue = def != null ? def.getStringValue() : null; |
281 | 293 |
282 return Double.valueOf(defValue); | 294 return Double.valueOf(defValue); |
283 } | 295 } |
296 | |
297 | |
298 protected void initHelperPanel() { | |
299 tabs = new TabSet(); | |
300 tabs.setWidth100(); | |
301 tabs.setHeight100(); | |
302 | |
303 Tab locations = new Tab(MSG.locations()); | |
304 Tab distances = new Tab(MSG.distance()); | |
305 | |
306 locations.setPane(locationsTable); | |
307 distances.setPane(distancesTable); | |
308 | |
309 tabs.addTab(locations, 0); | |
310 tabs.addTab(distances, 1); | |
311 | |
312 helperContainer.addChild(tabs); | |
313 } | |
284 } | 314 } |
285 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 315 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |