Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
4328:25157125f4a0 | 4329:c9dcce9448f2 |
---|---|
13 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; | 13 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; |
14 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; | 14 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; |
15 | 15 |
16 import de.intevation.flys.client.client.Config; | 16 import de.intevation.flys.client.client.Config; |
17 import de.intevation.flys.client.client.FLYSConstants; | 17 import de.intevation.flys.client.client.FLYSConstants; |
18 import de.intevation.flys.client.client.event.OutputParameterChangeEvent; | |
19 import de.intevation.flys.client.client.event.OutputParameterChangeHandler; | |
18 import de.intevation.flys.client.client.event.RedrawRequestEvent; | 20 import de.intevation.flys.client.client.event.RedrawRequestEvent; |
19 import de.intevation.flys.client.client.event.RedrawRequestHandler; | 21 import de.intevation.flys.client.client.event.RedrawRequestHandler; |
20 import de.intevation.flys.client.client.services.LoadArtifactService; | 22 import de.intevation.flys.client.client.services.LoadArtifactService; |
21 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; | 23 import de.intevation.flys.client.client.services.LoadArtifactServiceAsync; |
22 import de.intevation.flys.client.client.services.MapOutputService; | 24 import de.intevation.flys.client.client.services.MapOutputService; |
57 import org.gwtopenmaps.openlayers.client.layer.WMSParams; | 59 import org.gwtopenmaps.openlayers.client.layer.WMSParams; |
58 | 60 |
59 | 61 |
60 public class MapOutputTab | 62 public class MapOutputTab |
61 extends OutputTab | 63 extends OutputTab |
62 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler { | 64 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler, OutputParameterChangeHandler { |
63 | 65 |
64 public static final String DEFAULT_SRID = "4326"; | 66 public static final String DEFAULT_SRID = "4326"; |
65 | 67 |
66 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; | 68 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; |
67 | 69 |
455 mode, | 457 mode, |
456 this, | 458 this, |
457 new MapThemePanel.ActivateCallback() { | 459 new MapThemePanel.ActivateCallback() { |
458 @Override | 460 @Override |
459 public void activate(Theme theme, boolean active) { | 461 public void activate(Theme theme, boolean active) { |
460 activateTheme(theme, active); | 462 fireActivateTheme(theme, active); |
461 } | 463 } |
462 }, | 464 }, |
463 new MapThemePanel.ThemeMovedCallback() { | 465 new MapThemePanel.ThemeMovedCallback() { |
464 @Override | 466 @Override |
465 public void onThemeMoved(Theme theme, int oldIdx, int newIdx) { | 467 public void onThemeMoved(Theme theme, int oldIdx, int newIdx) { |
494 getMap().zoomToExtent(zoomTo); | 496 getMap().zoomToExtent(zoomTo); |
495 } | 497 } |
496 } | 498 } |
497 ); | 499 ); |
498 themePanel.addRedrawRequestHandler(this); | 500 themePanel.addRedrawRequestHandler(this); |
501 themePanel.addOutputParameterChangeHandler(this); | |
499 c.addChild(themePanel); | 502 c.addChild(themePanel); |
500 | 503 |
501 return c; | 504 return c; |
505 } | |
506 | |
507 | |
508 private void fireActivateTheme(Theme theme, boolean active) { | |
509 activateTheme(theme, active); | |
502 } | 510 } |
503 | 511 |
504 | 512 |
505 protected void activateTheme(Theme theme, boolean active) { | 513 protected void activateTheme(Theme theme, boolean active) { |
506 AttributedTheme at = (AttributedTheme) theme; | 514 AttributedTheme at = (AttributedTheme) theme; |
566 public void toogleThemePanel() { | 574 public void toogleThemePanel() { |
567 this.themePanelCanvas.setVisible(!themePanelCanvas.isVisible()); | 575 this.themePanelCanvas.setVisible(!themePanelCanvas.isVisible()); |
568 this.themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), | 576 this.themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), |
569 themePanelCanvas.getHeightAsString()); | 577 themePanelCanvas.getHeightAsString()); |
570 } | 578 } |
579 | |
580 | |
581 @Override | |
582 public void onOutputParameterChanged(OutputParameterChangeEvent evt) { | |
583 GWT.log("OutputParameterChanged"); | |
584 controlPanel.updateThemes(getThemePanel().getThemeList()); | |
585 } | |
571 } | 586 } |
572 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 587 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |