Mercurial > dive4elements > river
changeset 832:303a923d232b
Added a panel that wraps all the stuff to combine SmartGWT and GWT-OpenLayers.
flys-client/trunk@2543 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 24 Aug 2011 08:32:23 +0000 (2011-08-24) |
parents | 9101b4d64666 |
children | dcecdd9693a8 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java |
diffstat | 2 files changed, 72 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Tue Aug 23 16:58:07 2011 +0000 +++ b/flys-client/ChangeLog Wed Aug 24 08:32:23 2011 +0000 @@ -1,3 +1,9 @@ +2011-08-24 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java: + New. A widget that displays a map with a toolbar. It wraps all the stuff + to combine SmartGWT with GWT-OpenLayers. + 2011-08-23 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/client/shared/model/ToLoad.java:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java Wed Aug 24 08:32:23 2011 +0000 @@ -0,0 +1,66 @@ +package de.intevation.flys.client.client.ui.map; + +import com.google.gwt.user.client.ui.HorizontalPanel; + +import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.layout.VLayout; + +import org.gwtopenmaps.openlayers.client.Bounds; + +import de.intevation.flys.client.shared.model.BBox; +import de.intevation.flys.client.shared.model.MapInfo; + + +public class MapPanel extends VLayout { + + protected MapToolbar toolbar; + protected HorizontalPanel mapArea; + + protected FloodMap floodMap; + protected boolean digitizeEnabled; + + + public MapPanel(MapInfo mapInfo, boolean digitizeEnabled) { + super(); + + BBox bbox = mapInfo.getBBox(); + + this.digitizeEnabled = digitizeEnabled; + this.floodMap = new FloodMap( + String.valueOf(mapInfo.getSrid()), + new Bounds( + bbox.getLowerX(), + bbox.getLowerY(), + bbox.getUpperX(), + bbox.getUpperY())); + + initLayout(); + } + + + private void initLayout() { + setWidth100(); + setHeight100(); + + mapArea = new HorizontalPanel(); + mapArea.setWidth("99%"); + mapArea.setHeight("99%"); + mapArea.add(floodMap.getMapWidget()); + + Canvas wrapper = new Canvas(); + wrapper.setWidth100(); + wrapper.setHeight100(); + wrapper.addChild(mapArea); + + toolbar = new MapToolbar(floodMap, this, digitizeEnabled); + + addMember(toolbar); + addMember(mapArea); + } + + + public FloodMap getFloodMap() { + return floodMap; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :