Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java @ 1542:3e2ef8e0a0dc
Issue 265.
Deactivate measure control and scale line if the map output tab is not
selected.
flys-client/trunk@3761 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 25 Jan 2012 08:50:06 +0000 |
parents | c39aa5a6478c |
children | c057ef91b268 |
comparison
equal
deleted
inserted
replaced
1541:959e1d0df941 | 1542:3e2ef8e0a0dc |
---|---|
11 import com.smartgwt.client.widgets.Canvas; | 11 import com.smartgwt.client.widgets.Canvas; |
12 import com.smartgwt.client.widgets.events.ResizedEvent; | 12 import com.smartgwt.client.widgets.events.ResizedEvent; |
13 import com.smartgwt.client.widgets.events.ResizedHandler; | 13 import com.smartgwt.client.widgets.events.ResizedHandler; |
14 import com.smartgwt.client.widgets.layout.HLayout; | 14 import com.smartgwt.client.widgets.layout.HLayout; |
15 import com.smartgwt.client.widgets.layout.VLayout; | 15 import com.smartgwt.client.widgets.layout.VLayout; |
16 import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; | |
17 import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; | |
16 | 18 |
17 import org.gwtopenmaps.openlayers.client.Bounds; | 19 import org.gwtopenmaps.openlayers.client.Bounds; |
18 import org.gwtopenmaps.openlayers.client.Map; | 20 import org.gwtopenmaps.openlayers.client.Map; |
19 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener; | 21 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener; |
20 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener.FeatureAddedEvent; | 22 import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener.FeatureAddedEvent; |
59 import de.intevation.flys.client.client.ui.ThemePanel; | 61 import de.intevation.flys.client.client.ui.ThemePanel; |
60 | 62 |
61 | 63 |
62 public class MapOutputTab | 64 public class MapOutputTab |
63 extends OutputTab | 65 extends OutputTab |
64 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader { | 66 implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler { |
65 | 67 |
66 public static final String DEFAULT_SRID = "4326"; | 68 public static final String DEFAULT_SRID = "4326"; |
67 | 69 |
68 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; | 70 public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; |
69 | 71 |
97 OutputMode mode, | 99 OutputMode mode, |
98 CollectionView collectionView | 100 CollectionView collectionView |
99 ){ | 101 ){ |
100 super(title, collection, collectionView, mode); | 102 super(title, collection, collectionView, mode); |
101 | 103 |
104 collectionView.registerTabHandler(this); | |
105 | |
102 mapService.doOut(collection, new AsyncCallback<MapConfig>() { | 106 mapService.doOut(collection, new AsyncCallback<MapConfig>() { |
103 public void onFailure(Throwable caught) { | 107 public void onFailure(Throwable caught) { |
104 GWT.log("MAP ERROR: " + caught.getMessage()); | 108 GWT.log("MAP ERROR: " + caught.getMessage()); |
105 } | 109 } |
106 | 110 |
535 GWT.log("Successfully saved barrier geometries."); | 539 GWT.log("Successfully saved barrier geometries."); |
536 } | 540 } |
537 } | 541 } |
538 ); | 542 ); |
539 } | 543 } |
544 | |
545 | |
546 public void onTabSelected(TabSelectedEvent tse) { | |
547 if(floodMap == null) { | |
548 return; | |
549 } | |
550 if(this.equals(tse.getTab())) { | |
551 floodMap.activateScaleLine(true); | |
552 } | |
553 else { | |
554 controlPanel.activateMeasureControl(false); | |
555 floodMap.activateScaleLine(false); | |
556 } | |
557 } | |
540 } | 558 } |
541 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 559 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |