Mercurial > dive4elements > river
changeset 915:89a47098bcbd
Hide geometry layer in floodmap when tab selection changes.
(Issue265)
flys-client/trunk@2778 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 16 Sep 2011 12:56:48 +0000 |
parents | 39a39e9be5af |
children | a1a5dc2b9e34 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/DigitizePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ParameterList.java flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProvider.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/FloodMap.java |
diffstat | 7 files changed, 73 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 <raimund.renkert@intevation.de> + + 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 <felix.wolfsteller@intevation.de> Updated implementation to a working (but limited and buggy)
--- 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; }
--- 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 :
--- 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 :
--- 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 :
--- 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 :
--- 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 :