Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java @ 1389:d29a9fa10313
Issue 265.
Hide the barrier layer and deactivate draw control on stacksection
minimize.
flys-client/trunk@3206 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 09 Nov 2011 18:00:12 +0000 |
parents | e2749cc3b7ad |
children | bc06a671ef60 |
comparison
equal
deleted
inserted
replaced
1388:4b177fd52f06 | 1389:d29a9fa10313 |
---|---|
9 import com.smartgwt.client.widgets.Canvas; | 9 import com.smartgwt.client.widgets.Canvas; |
10 import com.smartgwt.client.widgets.events.ResizedEvent; | 10 import com.smartgwt.client.widgets.events.ResizedEvent; |
11 import com.smartgwt.client.widgets.events.ResizedHandler; | 11 import com.smartgwt.client.widgets.events.ResizedHandler; |
12 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; | 12 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
13 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; | 13 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; |
14 import com.smartgwt.client.widgets.events.VisibilityChangedHandler; | |
15 import com.smartgwt.client.widgets.events.VisibilityChangedEvent; | |
14 | 16 |
15 import org.gwtopenmaps.openlayers.client.Map; | 17 import org.gwtopenmaps.openlayers.client.Map; |
16 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; | 18 import org.gwtopenmaps.openlayers.client.feature.VectorFeature; |
17 import org.gwtopenmaps.openlayers.client.format.GeoJSON; | 19 import org.gwtopenmaps.openlayers.client.format.GeoJSON; |
18 import org.gwtopenmaps.openlayers.client.layer.WMS; | 20 import org.gwtopenmaps.openlayers.client.layer.WMS; |
33 import de.intevation.flys.client.client.services.MapInfoServiceAsync; | 35 import de.intevation.flys.client.client.services.MapInfoServiceAsync; |
34 | 36 |
35 | 37 |
36 public class DigitizePanel | 38 public class DigitizePanel |
37 extends SelectProvider | 39 extends SelectProvider |
38 implements TabSelectedHandler { | 40 implements TabSelectedHandler, VisibilityChangedHandler { |
39 | 41 |
40 protected MapInfoServiceAsync mapInfo = GWT.create(MapInfoService.class); | 42 protected MapInfoServiceAsync mapInfo = GWT.create(MapInfoService.class); |
41 | 43 |
42 protected FloodMap floodMap; | 44 protected FloodMap floodMap; |
43 | 45 |
46 protected MapPanel mapPanel; | |
44 | 47 |
45 public static final String UESK_BARRIERS = "uesk.barriers"; | 48 public static final String UESK_BARRIERS = "uesk.barriers"; |
46 | 49 |
47 | 50 |
48 public DigitizePanel() { | 51 public DigitizePanel() { |
50 | 53 |
51 | 54 |
52 @Override | 55 @Override |
53 public Canvas create(DataList list) { | 56 public Canvas create(DataList list) { |
54 List<Data> data = list.getAll(); | 57 List<Data> data = list.getAll(); |
58 | |
59 helperContainer.addVisibilityChangedHandler(this); | |
55 | 60 |
56 Data barriers = null; | 61 Data barriers = null; |
57 for (int i = data.size()-1; i >= 0; i--) { | 62 for (int i = data.size()-1; i >= 0; i--) { |
58 Data d = data.get(i); | 63 Data d = data.get(i); |
59 if (d.getLabel().equals(UESK_BARRIERS)) { | 64 if (d.getLabel().equals(UESK_BARRIERS)) { |
115 return total; | 120 return total; |
116 } | 121 } |
117 | 122 |
118 | 123 |
119 public void createMapWidget(MapInfo mapInfo, String geojson) { | 124 public void createMapWidget(MapInfo mapInfo, String geojson) { |
120 final MapPanel mapPanel = new MapPanel(mapInfo, true); | 125 mapPanel = new MapPanel(mapInfo, true); |
121 | 126 |
122 floodMap = mapPanel.getFloodMap(); | 127 floodMap = mapPanel.getFloodMap(); |
123 Map map = floodMap.getMap(); | 128 Map map = floodMap.getMap(); |
124 | 129 |
125 helperContainer.addMember(mapPanel); | 130 helperContainer.addMember(mapPanel); |
186 } | 191 } |
187 else { | 192 else { |
188 floodMap.showBarrierLayer(); | 193 floodMap.showBarrierLayer(); |
189 } | 194 } |
190 } | 195 } |
196 | |
197 public void onVisibilityChanged(VisibilityChangedEvent vce) { | |
198 if (!vce.getIsVisible()) { | |
199 floodMap.hideBarrierLayer(); | |
200 mapPanel.getMapToolbar().activateDrawFeature(false); | |
201 } | |
202 else { | |
203 floodMap.showBarrierLayer(); | |
204 } | |
205 } | |
191 } | 206 } |
192 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 207 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |