# HG changeset patch # User Raimund Renkert # Date 1316177808 0 # Node ID 89a47098bcbd6ee2dac624e4694a152e6e213c63 # Parent 39a39e9be5af5c430914ce4a3375414ca21aee19 Hide geometry layer in floodmap when tab selection changes. (Issue265) flys-client/trunk@2778 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 39a39e9be5af -r 89a47098bcbd flys-client/ChangeLog --- a/flys-client/ChangeLog Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/ChangeLog Fri Sep 16 12:56:48 2011 +0000 @@ -1,3 +1,21 @@ +2011-09-16 Raimund Renkert + + Issue265 + + * src/main/java/de/intevation/flys/client/client/ui/ParameterList.java, + src/main/java/de/intevation/flys/client/client/ui/CollectionView.java: + Added method to be able to register TabSelecedHandler at the + CollectionView. + + * src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java, + src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java: + Register the panel as TabSelectedHandler to hide or show the barrier + layer in the FloodMap. + + * src/main/java/de/intevation/flys/client/client/ui/UIProvider.java, + src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java: + Added setter for ParameterList. + 2011-09-16 Felix Wolfsteller Updated implementation to a working (but limited and buggy) diff -r 39a39e9be5af -r 89a47098bcbd flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java Fri Sep 16 12:56:48 2011 +0000 @@ -55,6 +55,9 @@ /** The Collection.*/ protected Collection collection; + /** The ParameterList.*/ + protected ParameterList parameterList; + /** * Creates a new UIProvider instance of this class. */ @@ -206,6 +209,11 @@ } + public void setParameterList(ParameterList list) { + this.parameterList = list; + } + + public Collection getCollection() { return collection; } diff -r 39a39e9be5af -r 89a47098bcbd flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java Fri Sep 16 12:56:48 2011 +0000 @@ -17,6 +17,8 @@ import com.smartgwt.client.widgets.layout.Layout; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.TabSet; +import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; +import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; import de.intevation.flys.client.shared.model.Artifact; import de.intevation.flys.client.shared.model.ArtifactDescription; @@ -654,5 +656,10 @@ }); } } + + + public void registerTabHandler(TabSelectedHandler tse) { + tabs.addTabSelectedHandler(tse); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 39a39e9be5af -r 89a47098bcbd flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java Fri Sep 16 12:56:48 2011 +0000 @@ -9,6 +9,8 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.events.ResizedEvent; import com.smartgwt.client.widgets.events.ResizedHandler; +import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; +import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; import org.gwtopenmaps.openlayers.client.Map; import org.gwtopenmaps.openlayers.client.feature.VectorFeature; @@ -31,7 +33,9 @@ import de.intevation.flys.client.client.services.MapInfoServiceAsync; -public class DigitizePanel extends SelectProvider { +public class DigitizePanel +extends SelectProvider +implements TabSelectedHandler { protected MapInfoServiceAsync mapInfo = GWT.create(MapInfoService.class); @@ -134,6 +138,8 @@ } }); + parameterList.registerCollectionViewTabHandler(this); + WMS axis = getLayer( mapInfo.getWmsUrl(), "riveraxis", mapInfo.getProjection(), false); @@ -170,5 +176,15 @@ return wms; } + + + public void onTabSelected(TabSelectedEvent tse) { + if (tse.getTabNum () != 0) { + floodMap.hideBarrierLayer(); + } + else { + floodMap.showBarrierLayer(); + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 39a39e9be5af -r 89a47098bcbd flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java Fri Sep 16 12:56:48 2011 +0000 @@ -18,6 +18,7 @@ import com.smartgwt.client.widgets.layout.SectionStackSection; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; +import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; import de.intevation.flys.client.shared.model.Artifact; import de.intevation.flys.client.shared.model.ArtifactDescription; @@ -681,6 +682,7 @@ provider.setContainer(helperPanel); provider.setArtifact(art); provider.setCollection(cView.getCollection()); + provider.setParameterList(this); ((HasStepForwardHandlers) provider).addStepForwardHandler(this); ((HasStepBackHandlers) provider).addStepBackHandler(this); @@ -696,6 +698,7 @@ UIProvider ui = UIProviderFactory.getProvider("continue", null); ui.setArtifact(art); ui.setCollection(cView.getCollection()); + ui.setParameterList(this); ((ContinuePanel) ui).addAdvanceHandler(this); @@ -864,5 +867,10 @@ tablePanel.removeMembers(members); } } + + + public void registerCollectionViewTabHandler (TabSelectedHandler tsh) { + this.cView.registerTabHandler (tsh); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 39a39e9be5af -r 89a47098bcbd flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProvider.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProvider.java Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProvider.java Fri Sep 16 12:56:48 2011 +0000 @@ -59,5 +59,7 @@ * Sets the parent Collection of the Artifact. */ public void setCollection(Collection collection); + + public void setParameterList(ParameterList list); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 39a39e9be5af -r 89a47098bcbd flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Fri Sep 16 11:21:38 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java Fri Sep 16 12:56:48 2011 +0000 @@ -158,5 +158,18 @@ mapWidget.setWidth(width); mapWidget.setHeight(height); } + + + public void hideBarrierLayer () { + if (barrierLayer != null) { + barrierLayer.setIsVisible(false); + } + } + + public void showBarrierLayer () { + if (barrierLayer != null) { + barrierLayer.setIsVisible(true); + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :