diff flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 4329:c9dcce9448f2

Added a new control 'show legend' to the map's toolbar. This control opens a window that displays the legends of all activated layers. Currently, the row in that window has a fixed size of 400x150. The size is fixed, because there are problems with SmartGWT to build panels with auto height/width :-/
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 30 Oct 2012 12:16:26 +0100
parents 61020a61ed38
children 93e023131546
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Tue Oct 30 13:05:26 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Tue Oct 30 12:16:26 2012 +0100
@@ -15,6 +15,8 @@
 
 import de.intevation.flys.client.client.Config;
 import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.event.OutputParameterChangeEvent;
+import de.intevation.flys.client.client.event.OutputParameterChangeHandler;
 import de.intevation.flys.client.client.event.RedrawRequestEvent;
 import de.intevation.flys.client.client.event.RedrawRequestHandler;
 import de.intevation.flys.client.client.services.LoadArtifactService;
@@ -59,7 +61,7 @@
 
 public class MapOutputTab
 extends      OutputTab
-implements   RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler {
+implements   RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler, OutputParameterChangeHandler {
 
     public static final String DEFAULT_SRID = "4326";
 
@@ -457,7 +459,7 @@
             new MapThemePanel.ActivateCallback() {
                 @Override
                 public void activate(Theme theme, boolean active) {
-                    activateTheme(theme, active);
+                    fireActivateTheme(theme, active);
                 }
             },
             new MapThemePanel.ThemeMovedCallback() {
@@ -496,12 +498,18 @@
             }
         );
         themePanel.addRedrawRequestHandler(this);
+        themePanel.addOutputParameterChangeHandler(this);
         c.addChild(themePanel);
 
         return c;
     }
 
 
+    private void fireActivateTheme(Theme theme, boolean active) {
+        activateTheme(theme, active);
+    }
+
+
     protected void activateTheme(Theme theme, boolean active) {
         AttributedTheme at = (AttributedTheme) theme;
 
@@ -568,5 +576,12 @@
         this.themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(),
                                        themePanelCanvas.getHeightAsString());
     }
+
+
+    @Override
+    public void onOutputParameterChanged(OutputParameterChangeEvent evt) {
+        GWT.log("OutputParameterChanged");
+        controlPanel.updateThemes(getThemePanel().getThemeList());
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org