comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java @ 4064:61020a61ed38

Show river map only once.
author Christian Lins <christian.lins@intevation.de>
date Tue, 09 Oct 2012 11:02:50 +0200
parents 047a44270348
children 360e22afb98b
comparison
equal deleted inserted replaced
4063:7c03d3bd9262 4064:61020a61ed38
2 2
3 import com.google.gwt.core.client.GWT; 3 import com.google.gwt.core.client.GWT;
4 4
5 import com.smartgwt.client.types.VerticalAlignment; 5 import com.smartgwt.client.types.VerticalAlignment;
6 import com.smartgwt.client.widgets.Canvas; 6 import com.smartgwt.client.widgets.Canvas;
7 import com.smartgwt.client.widgets.Img;
8 import com.smartgwt.client.widgets.layout.HLayout; 7 import com.smartgwt.client.widgets.layout.HLayout;
9 8
10 import de.intevation.flys.client.shared.model.DataList;
11 import de.intevation.flys.client.client.FLYSConstants; 9 import de.intevation.flys.client.client.FLYSConstants;
12 import de.intevation.flys.client.shared.model.Data; 10 import de.intevation.flys.client.shared.model.Data;
11 import de.intevation.flys.client.shared.model.DataList;
13 12
14 13
15 /** 14 /**
16 * This UIProvider displays the DataItems contained in the Data object in a 15 * 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 16 * combo box as SelectProvider does. Furthermore, there is a map displayed that
18 * lets the user choose a river by selecting it on the map. 17 * lets the user choose a river by selecting it on the map.
19 * 18 *
20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
21 */ 20 */
22 public class MapSelection extends SelectProvider { 21 public class MapSelection extends SelectProvider {
22
23 private static final long serialVersionUID = 1261822454641198692L;
23 24
24 /** The interface that provides the image resources. */ 25 /** The interface that provides the image resources. */
25 private FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); 26 private FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
26 27
27 protected ModuleSelection moduleSelection; 28 protected ModuleSelection moduleSelection;
40 * 41 *
41 * @param data The {@link DataList} object. 42 * @param data The {@link DataList} object.
42 * 43 *
43 * @return a combobox. 44 * @return a combobox.
44 */ 45 */
46 @Override
45 protected Canvas createWidget(DataList data) { 47 protected Canvas createWidget(DataList data) {
46 GWT.log("MapSelection - create()"); 48 GWT.log("MapSelection - create()");
47
48 String baseUrl = GWT.getHostPageBaseURL();
49 49
50 HLayout h = new HLayout(); 50 HLayout h = new HLayout();
51 h.setAlign(VerticalAlignment.TOP); 51 h.setAlign(VerticalAlignment.TOP);
52 h.setHeight(100); 52 h.setHeight(100);
53 moduleSelection = new ModuleSelection(); 53 moduleSelection = new ModuleSelection();
54 54
55 Canvas form = moduleSelection.create(data); 55 Canvas form = moduleSelection.create(data);
56 form.setWidth(250); 56 form.setWidth(250);
57 form.setLayoutAlign(VerticalAlignment.TOP); 57 form.setLayoutAlign(VerticalAlignment.TOP);
58 58
59 Img map = new Img(baseUrl + MESSAGES.riverMap(), 400, 452); 59 // TODO implement event handling in the river map (here? or in LinkSelection)
60
61 // TODO implement event handling in the river map
62 60
63 h.addMember(form); 61 h.addMember(form);
64 helperContainer.addMember(map);
65 62
66 return h; 63 return h;
67 } 64 }
68 65
66 @Override
69 protected Data[] getData() { 67 protected Data[] getData() {
70 if (moduleSelection != null) { 68 if (moduleSelection != null) {
71 return moduleSelection.getData(); 69 return moduleSelection.getData();
72 } 70 }
73 else { 71 else {

http://dive4elements.wald.intevation.org