Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java @ 282:e92f7ef455d6
Show rivers as links instead of a combobox.
flys-client/trunk@1911 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 12 May 2011 14:59:18 +0000 |
parents | 4784ca718476 |
children | 2e02db03e576 |
comparison
equal
deleted
inserted
replaced
281:c271012a97a3 | 282:e92f7ef455d6 |
---|---|
8 import com.smartgwt.client.widgets.Img; | 8 import com.smartgwt.client.widgets.Img; |
9 import com.smartgwt.client.widgets.layout.HLayout; | 9 import com.smartgwt.client.widgets.layout.HLayout; |
10 | 10 |
11 import de.intevation.flys.client.shared.model.DataList; | 11 import de.intevation.flys.client.shared.model.DataList; |
12 import de.intevation.flys.client.client.FLYSImages; | 12 import de.intevation.flys.client.client.FLYSImages; |
13 import de.intevation.flys.client.client.event.HasStepForwardHandlers; | |
14 import de.intevation.flys.client.shared.model.Data; | |
13 | 15 |
14 | 16 |
15 /** | 17 /** |
16 * This UIProvider displays the DataItems contained in the Data object in a | 18 * This UIProvider displays the DataItems contained in the Data object in a |
17 * combo box as SelectProvider does. Furthermore, there is a map displayed that | 19 * combo box as SelectProvider does. Furthermore, there is a map displayed that |
22 public class MapSelection extends SelectProvider { | 24 public class MapSelection extends SelectProvider { |
23 | 25 |
24 /** The interface that provides the image resources. */ | 26 /** The interface that provides the image resources. */ |
25 private FLYSImages IMAGES = GWT.create(FLYSImages.class); | 27 private FLYSImages IMAGES = GWT.create(FLYSImages.class); |
26 | 28 |
29 protected ModuleSelection moduleSelection; | |
27 | 30 |
28 public MapSelection() { | 31 public MapSelection() { |
29 } | 32 } |
30 | 33 |
31 | 34 |
44 protected Canvas createWidget(DataList data) { | 47 protected Canvas createWidget(DataList data) { |
45 GWT.log("MapSelection - create()"); | 48 GWT.log("MapSelection - create()"); |
46 | 49 |
47 HLayout h = new HLayout(); | 50 HLayout h = new HLayout(); |
48 h.setAlign(VerticalAlignment.TOP); | 51 h.setAlign(VerticalAlignment.TOP); |
52 h.setHeight(100); | |
53 moduleSelection = new ModuleSelection(); | |
49 | 54 |
50 Canvas form = super.createWidget(data); | 55 Canvas form = moduleSelection.create(data); |
51 form.setWidth(250); | 56 form.setWidth(250); |
52 form.setLayoutAlign(VerticalAlignment.TOP); | 57 form.setLayoutAlign(VerticalAlignment.TOP); |
53 | 58 |
54 ImageResource mapRes = IMAGES.riverMap(); | 59 ImageResource mapRes = IMAGES.riverMap(); |
55 Img map = new Img(mapRes.getURL(), 400, 452); | 60 Img map = new Img(mapRes.getURL(), 400, 452); |
59 h.addMember(form); | 64 h.addMember(form); |
60 helperContainer.addChild(map); | 65 helperContainer.addChild(map); |
61 | 66 |
62 return h; | 67 return h; |
63 } | 68 } |
69 | |
70 protected Data[] getData() { | |
71 if (moduleSelection != null) { | |
72 return moduleSelection.getData(); | |
73 } | |
74 else { | |
75 return null; | |
76 } | |
77 } | |
64 } | 78 } |
65 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 79 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |