Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java @ 4607:c0a275c581fb
Add a welcome screen to the workspace background
If the workspace background is visible a welcome message is shown and the user
is able to create a new project via a button.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 30 Nov 2012 10:18:32 +0100 |
parents | 32a4651eef93 |
children | 02cf2b1dff84 |
rev | line source |
---|---|
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.GWT; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import com.google.gwt.user.client.rpc.AsyncCallback; |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
5 import com.smartgwt.client.types.Encoding; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
6 import com.smartgwt.client.types.VerticalAlignment; |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import com.smartgwt.client.util.SC; |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
8 import com.smartgwt.client.widgets.Button; |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
9 import com.smartgwt.client.widgets.Canvas; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
10 import com.smartgwt.client.widgets.HTMLPane; |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
11 import com.smartgwt.client.widgets.Label; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
12 import com.smartgwt.client.widgets.events.ClickEvent; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
13 import com.smartgwt.client.widgets.events.ClickHandler; |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
14 import com.smartgwt.client.widgets.events.VisibilityChangedEvent; |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
15 import com.smartgwt.client.widgets.events.VisibilityChangedHandler; |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
16 import com.smartgwt.client.widgets.form.DynamicForm; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
17 import com.smartgwt.client.widgets.form.fields.SelectItem; |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
18 import com.smartgwt.client.widgets.form.fields.UploadItem; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
19 import com.smartgwt.client.widgets.layout.VLayout; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
20 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
21 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
23 import de.intevation.flys.client.client.Config; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
24 import de.intevation.flys.client.client.services.MapInfoService; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
25 import de.intevation.flys.client.client.services.MapInfoServiceAsync; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
26 import de.intevation.flys.client.client.ui.map.FloodMap; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
27 import de.intevation.flys.client.client.ui.map.MapPanel; |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 import de.intevation.flys.client.shared.model.Data; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 import de.intevation.flys.client.shared.model.DataItem; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 import de.intevation.flys.client.shared.model.DataList; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 import de.intevation.flys.client.shared.model.DefaultData; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 import de.intevation.flys.client.shared.model.DefaultDataItem; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 import de.intevation.flys.client.shared.model.MapInfo; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
35 import java.util.LinkedHashMap; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
36 import java.util.List; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
37 |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
38 import org.gwtopenmaps.openlayers.client.Map; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
39 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
40 import org.gwtopenmaps.openlayers.client.format.GeoJSON; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
41 import org.gwtopenmaps.openlayers.client.layer.WMS; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
42 import org.gwtopenmaps.openlayers.client.layer.WMSOptions; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
43 import org.gwtopenmaps.openlayers.client.layer.WMSParams; |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
46 public class DigitizePanel |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
47 extends SelectProvider |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
48 implements TabSelectedHandler, VisibilityChangedHandler { |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
4062
diff
changeset
|
50 private static final long serialVersionUID = 3529775660871273314L; |
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
4062
diff
changeset
|
51 |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 protected MapInfoServiceAsync mapInfo = GWT.create(MapInfoService.class); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 protected FloodMap floodMap; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
56 protected MapPanel mapPanel; |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 public static final String UESK_BARRIERS = "uesk.barriers"; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 public DigitizePanel() { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 @Override |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 public Canvas create(DataList list) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 List<Data> data = list.getAll(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
69 helperContainer.addVisibilityChangedHandler(this); |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
70 |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 Data barriers = null; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 for (int i = data.size()-1; i >= 0; i--) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 Data d = data.get(i); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 if (d.getLabel().equals(UESK_BARRIERS)) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 barriers = d; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 data.remove(d); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 |
872
a7179e3a774e
Suppress the GeoJSON string to be drawn into the static UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
80 DataList clone = (DataList) list.clone(); |
a7179e3a774e
Suppress the GeoJSON string to be drawn into the static UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
81 List<Data> all = clone.getAll(); |
a7179e3a774e
Suppress the GeoJSON string to be drawn into the static UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
82 all.remove(UESK_BARRIERS); |
a7179e3a774e
Suppress the GeoJSON string to be drawn into the static UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
83 |
a7179e3a774e
Suppress the GeoJSON string to be drawn into the static UI.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
833
diff
changeset
|
84 Canvas selectBox = super.create(clone); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 final Config cfg = Config.getInstance(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 final String locale = cfg.getLocale(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 DataItem[] obj = barriers.getItems(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 final String[] geojson = new String[1]; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 for (DataItem item: obj) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 if (item.getLabel().equals(UESK_BARRIERS)) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 geojson[0] = item.getStringValue(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 break; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 |
873
77a549772aa9
Query MapInfo object for correct river (was hard coded).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
872
diff
changeset
|
99 String river = getDataValue("state.winfo.river", "river"); |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1389
diff
changeset
|
100 mapInfo.getMapInfo(locale, river, new AsyncCallback<MapInfo>() { |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
101 @Override |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 public void onFailure(Throwable caught) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 String msg = caught.getMessage(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 GWT.log("Error while fetching MapInfo: " + msg); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 SC.warn(MSG.getString(msg)); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
109 @Override |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 public void onSuccess(MapInfo info) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 createMapWidget(info, geojson[0]); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 }); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 return selectBox; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
119 /** |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
120 * This method creates the content of the widget. |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
121 * |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
122 * @param data The {@link DataList} object. |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
123 * |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
124 * @return a combobox. |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
125 */ |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
126 @Override |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
127 protected Canvas createWidget(DataList data) { |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
128 GWT.log("DigitizePanel - createWidget()"); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
129 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
130 VLayout layout = new VLayout(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
131 layout.setAlign(VerticalAlignment.TOP); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
132 layout.setHeight(25); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
133 |
4131
360e22afb98b
Cosmetics, warnings and minor TODOs.
Christian Lins <christian.lins@intevation.de>
parents:
4062
diff
changeset
|
134 LinkedHashMap<String, String> initial = new LinkedHashMap<String, String>(); |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
135 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
136 form = new DynamicForm(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
137 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
138 int size = data.size(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
139 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
140 for (int i = 0; i < size; i++) { |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
141 Data d = data.get(i); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
142 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
143 Label label = new Label(d.getDescription()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
144 label.setValign(VerticalAlignment.TOP); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
145 label.setHeight(20); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
146 label.setWidth(400); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
147 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
148 SelectItem combobox = new SelectItem(d.getLabel()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
149 combobox.setWidth(250); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
150 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
151 LinkedHashMap<String, String> it = new LinkedHashMap<String, String>(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
152 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
153 boolean defaultSet = false; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
154 boolean first = true; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
155 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
156 DataItem def = d.getDefault(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
157 String defValue = def != null ? def.getStringValue() : null; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
158 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
159 if (defValue != null && defValue.length() > 0) { |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
160 initial.put(d.getLabel(), def.getStringValue()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
161 defaultSet = true; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
162 } |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
163 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
164 // I was here. |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
165 for (DataItem item: d.getItems()) { |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
166 if (!defaultSet && first) { |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
167 initial.put(d.getLabel(), item.getStringValue()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
168 first = false; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
169 } |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
170 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
171 it.put(item.getStringValue(), item.getLabel()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
172 } |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
173 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
174 label.setWidth(50); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
175 combobox.setValueMap(it); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
176 combobox.setShowTitle(false); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
177 form.setItems(combobox); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
178 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
179 HTMLPane frame = new HTMLPane(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
180 frame.setWidth("1px"); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
181 frame.setHeight("1px"); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
182 frame.setContents("<iframe id='uploadTarget' name='uploadTarget'></iframe>"); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
183 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
184 final DynamicForm uploadForm = new DynamicForm(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
185 uploadForm.setAction("flys/fileupload?uuid=" + artifact.getUuid()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
186 uploadForm.setTarget("uploadTarget"); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
187 uploadForm.setEncoding(Encoding.MULTIPART); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
188 Label uploadLabel = new Label(MSG.shape_file_upload()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
189 uploadLabel.setHeight(20); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
190 UploadItem uploadItem = new UploadItem(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
191 uploadItem.setShowTitle(false); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
192 uploadForm.setFields(uploadItem); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
193 Button submit = new Button(MSG.upload_file()); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
194 submit.addClickHandler(new ClickHandler() { |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
195 @Override |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
196 public void onClick(ClickEvent e) { |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
197 uploadForm.submitForm(); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
198 } |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
199 }); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
200 layout.addMember(frame); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
201 layout.addMember(label); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
202 layout.addMember(form); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
203 layout.addMember(uploadLabel); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
204 layout.addMember(uploadForm); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
205 layout.addMember(submit); |
4574
32a4651eef93
flys-client: Shapefile upload widget readded again (regression).
Christian Lins <christian.lins@intevation.de>
parents:
4553
diff
changeset
|
206 layout.addMember(getNextButton()); |
2494
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
207 } |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
208 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
209 form.setValues(initial); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
210 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
211 layout.setAlign(VerticalAlignment.TOP); |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
212 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
213 return layout; |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
214 } |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
215 |
88b51e6e0334
Issue 657.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1425
diff
changeset
|
216 |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 @Override |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 protected Data[] getData() { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 Data[] data = super.getData(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 Data[] total = new Data[2]; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
222 if (floodMap != null) { |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
223 DataItem item = new DefaultDataItem( |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
224 UESK_BARRIERS, UESK_BARRIERS, floodMap.getFeaturesAsGeoJSON()); |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
225 total[0] = data[0]; |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
226 total[1] = new DefaultData( |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
227 UESK_BARRIERS, null, null, new DataItem[] { item }); |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
228 } |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
229 else { |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
230 // Happens when OpenLayers is missing |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
231 GWT.log("floodMap is null -> OpenLayers missing?"); |
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
232 } |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
233 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
234 return total; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
235 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
236 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
237 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
238 public void createMapWidget(MapInfo mapInfo, String geojson) { |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
239 mapPanel = new MapPanel(mapInfo, true); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
240 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
241 floodMap = mapPanel.getFloodMap(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
242 Map map = floodMap.getMap(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
243 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
244 helperContainer.addMember(mapPanel); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
245 |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
246 parameterList.registerCollectionViewTabHandler(this); |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
247 |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
248 WMS axis = getLayer( |
4553
fac54b8470d4
Map view in DigitizePanel now shows OSM background, river axis and
Christian Lins <christian.lins@intevation.de>
parents:
4476
diff
changeset
|
249 mapInfo.getWmsUrl(), "FLYS-Map", // FIXME: Make layer name configurable |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
250 mapInfo.getProjection(), false); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
251 WMS back = getLayer( |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
252 mapInfo.getBackgroundWmsUrl(), mapInfo.getBackgroundWmsLayers(), |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
253 mapInfo.getProjection(), false); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
254 |
4553
fac54b8470d4
Map view in DigitizePanel now shows OSM background, river axis and
Christian Lins <christian.lins@intevation.de>
parents:
4476
diff
changeset
|
255 map.addLayer(back); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
256 map.addLayer(axis); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
257 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
258 if (geojson != null && geojson.length() > 0) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
259 VectorFeature[] features = new GeoJSON().read(geojson); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
260 floodMap.getBarrierLayer().addFeatures(features); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
261 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
262 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
263 map.zoomToMaxExtent(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
264 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
265 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
266 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
267 protected WMS getLayer(String url, String layers, String proj, boolean x) { |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
268 WMSParams params = new WMSParams(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
269 params.setLayers(layers); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
270 params.setFormat("image/png"); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
271 params.setIsTransparent(!x); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
272 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 WMSOptions opts = new WMSOptions(); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 opts.setProjection(proj); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 opts.setSingleTile(true); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
276 opts.setRatio(1); |
1302
17e7d5e437fb
Bumped OpenLayers to version 2.11 and GWT-OpenLayers to version 0.6
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
915
diff
changeset
|
277 opts.setBuffer(0); |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
278 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
279 WMS wms = new WMS(layers, url, params, opts); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
280 wms.setIsVisible(true); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
281 wms.setIsBaseLayer(x); |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
282 |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
283 return wms; |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
284 } |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
285 |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
286 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
287 @Override |
915
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
288 public void onTabSelected(TabSelectedEvent tse) { |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
289 if (tse.getTabNum () != 0) { |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
290 floodMap.hideBarrierLayer(); |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
291 } |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
292 else { |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
293 floodMap.showBarrierLayer(); |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
294 } |
89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
873
diff
changeset
|
295 } |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
296 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
2494
diff
changeset
|
297 @Override |
1389
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
298 public void onVisibilityChanged(VisibilityChangedEvent vce) { |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
299 if (!vce.getIsVisible()) { |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
300 floodMap.hideBarrierLayer(); |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
301 mapPanel.getMapToolbar().activateDrawFeature(false); |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
302 } |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
303 else { |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
304 floodMap.showBarrierLayer(); |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
305 } |
d29a9fa10313
Issue 265.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1322
diff
changeset
|
306 } |
833
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
307 } |
dcecdd9693a8
Added a UIProvider that displays a combobox on the left and a map widget in the helper container.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
308 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |