changeset 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 4b177fd52f06
children 13d07b7daa89
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java
diffstat 4 files changed, 34 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Wed Nov 09 17:07:36 2011 +0000
+++ b/flys-client/ChangeLog	Wed Nov 09 18:00:12 2011 +0000
@@ -1,3 +1,15 @@
+2011-11-09  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Issue 265.
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java:
+	  Added getter for toolbar.
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java,
+	  src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java:
+	  Hide the barrier layer and deactivate draw control on stacksection
+	  minimize.
+
 2011-11-08  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/ParameterList.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java	Wed Nov 09 17:07:36 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java	Wed Nov 09 18:00:12 2011 +0000
@@ -11,6 +11,8 @@
 import com.smartgwt.client.widgets.events.ResizedHandler;
 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler;
 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent;
+import com.smartgwt.client.widgets.events.VisibilityChangedHandler;
+import com.smartgwt.client.widgets.events.VisibilityChangedEvent;
 
 import org.gwtopenmaps.openlayers.client.Map;
 import org.gwtopenmaps.openlayers.client.feature.VectorFeature;
@@ -35,12 +37,13 @@
 
 public class DigitizePanel
 extends SelectProvider
-implements TabSelectedHandler {
+implements TabSelectedHandler, VisibilityChangedHandler {
 
     protected MapInfoServiceAsync mapInfo = GWT.create(MapInfoService.class);
 
     protected FloodMap floodMap;
 
+    protected MapPanel mapPanel;
 
     public static final String UESK_BARRIERS = "uesk.barriers";
 
@@ -53,6 +56,8 @@
     public Canvas create(DataList list) {
         List<Data> data = list.getAll();
 
+        helperContainer.addVisibilityChangedHandler(this);
+
         Data barriers = null;
         for (int i = data.size()-1; i >= 0; i--) {
             Data d = data.get(i);
@@ -117,7 +122,7 @@
 
 
     public void createMapWidget(MapInfo mapInfo, String geojson) {
-        final MapPanel mapPanel = new MapPanel(mapInfo, true);
+        mapPanel = new MapPanel(mapInfo, true);
 
         floodMap = mapPanel.getFloodMap();
         Map map  = floodMap.getMap();
@@ -188,5 +193,15 @@
             floodMap.showBarrierLayer();
         }
     }
+
+    public void onVisibilityChanged(VisibilityChangedEvent vce) {
+        if (!vce.getIsVisible()) {
+            floodMap.hideBarrierLayer();
+            mapPanel.getMapToolbar().activateDrawFeature(false);
+        }
+        else {
+            floodMap.showBarrierLayer();
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java	Wed Nov 09 17:07:36 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java	Wed Nov 09 18:00:12 2011 +0000
@@ -62,5 +62,9 @@
     public FloodMap getFloodMap() {
         return floodMap;
     }
+
+    public MapToolbar getMapToolbar () {
+        return toolbar;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java	Wed Nov 09 17:07:36 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapToolbar.java	Wed Nov 09 18:00:12 2011 +0000
@@ -139,7 +139,7 @@
     }
 
 
-    protected void activateDrawFeature(boolean activate) {
+    public void activateDrawFeature(boolean activate) {
         drawControl.activate(activate);
     }
 

http://dive4elements.wald.intevation.org