teichmann@5835: package org.dive4elements.river.client.client.ui.map; ingo@796: ingo@823: import com.google.gwt.core.client.GWT; ingo@825: import com.google.gwt.user.client.rpc.AsyncCallback; christian@4402: import com.google.gwt.user.client.ui.AbsolutePanel; ingo@1414: import com.smartgwt.client.util.SC; ingo@796: import com.smartgwt.client.widgets.Canvas; christian@4570: import com.smartgwt.client.widgets.events.ParentMovedEvent; christian@4570: import com.smartgwt.client.widgets.events.ParentMovedHandler; ingo@798: import com.smartgwt.client.widgets.events.ResizedEvent; ingo@798: import com.smartgwt.client.widgets.events.ResizedHandler; ingo@796: import com.smartgwt.client.widgets.layout.HLayout; ingo@798: import com.smartgwt.client.widgets.layout.VLayout; christian@2983: import com.smartgwt.client.widgets.tab.events.TabSelectedEvent; raimund@1542: import com.smartgwt.client.widgets.tab.events.TabSelectedHandler; ingo@796: teichmann@5835: import org.dive4elements.river.client.client.Config; teichmann@5835: import org.dive4elements.river.client.client.FLYSConstants; teichmann@5835: import org.dive4elements.river.client.client.event.OutputParameterChangeEvent; teichmann@5835: import org.dive4elements.river.client.client.event.OutputParameterChangeHandler; teichmann@5835: import org.dive4elements.river.client.client.event.RedrawRequestEvent; teichmann@5835: import org.dive4elements.river.client.client.event.RedrawRequestHandler; teichmann@5835: import org.dive4elements.river.client.client.services.LoadArtifactService; teichmann@5835: import org.dive4elements.river.client.client.services.LoadArtifactServiceAsync; teichmann@5835: import org.dive4elements.river.client.client.services.MapOutputService; teichmann@5835: import org.dive4elements.river.client.client.services.MapOutputServiceAsync; teichmann@5835: import org.dive4elements.river.client.client.services.StepForwardService; teichmann@5835: import org.dive4elements.river.client.client.services.StepForwardServiceAsync; teichmann@5835: import org.dive4elements.river.client.client.ui.CollectionView; teichmann@5835: import org.dive4elements.river.client.client.ui.OutputTab; teichmann@5835: import org.dive4elements.river.client.client.ui.ThemePanel; teichmann@5835: import org.dive4elements.river.client.shared.model.Artifact; teichmann@5835: import org.dive4elements.river.client.shared.model.ArtifactDescription; teichmann@5835: import org.dive4elements.river.client.shared.model.AttributedTheme; teichmann@5835: import org.dive4elements.river.client.shared.model.Collection; teichmann@5835: import org.dive4elements.river.client.shared.model.Data; teichmann@5835: import org.dive4elements.river.client.shared.model.DataItem; teichmann@5835: import org.dive4elements.river.client.shared.model.DataList; teichmann@5835: import org.dive4elements.river.client.shared.model.DefaultData; teichmann@5835: import org.dive4elements.river.client.shared.model.DefaultDataItem; teichmann@5835: import org.dive4elements.river.client.shared.model.MapConfig; teichmann@5835: import org.dive4elements.river.client.shared.model.OutputMode; teichmann@5835: import org.dive4elements.river.client.shared.model.Recommendation; teichmann@5835: import org.dive4elements.river.client.shared.model.Theme; teichmann@5835: import org.dive4elements.river.client.shared.model.ThemeList; teichmann@5835: import org.dive4elements.river.client.shared.model.WMSLayer; ingo@796: christian@4739: import java.util.HashMap; christian@2983: import java.util.List; christian@2983: christian@2983: import org.gwtopenmaps.openlayers.client.Bounds; christian@2983: import org.gwtopenmaps.openlayers.client.Map; christian@4402: import org.gwtopenmaps.openlayers.client.MapWidget; christian@2983: import org.gwtopenmaps.openlayers.client.event.VectorFeatureAddedListener; christian@2983: import org.gwtopenmaps.openlayers.client.event.VectorFeatureRemovedListener; christian@2983: import org.gwtopenmaps.openlayers.client.feature.VectorFeature; christian@2983: import org.gwtopenmaps.openlayers.client.format.GeoJSON; christian@2983: import org.gwtopenmaps.openlayers.client.layer.Layer; christian@5612: import org.gwtopenmaps.openlayers.client.layer.TransitionEffect; christian@2983: import org.gwtopenmaps.openlayers.client.layer.Vector; christian@2983: import org.gwtopenmaps.openlayers.client.layer.WMS; christian@2983: import org.gwtopenmaps.openlayers.client.layer.WMSOptions; christian@2983: import org.gwtopenmaps.openlayers.client.layer.WMSParams; ingo@796: ingo@796: ingo@1412: public class MapOutputTab ingo@1412: extends OutputTab ingo@4329: implements RedrawRequestHandler, ExternalWMSWindow.LayerLoader, TabSelectedHandler, OutputParameterChangeHandler { ingo@796: ingo@823: public static final String DEFAULT_SRID = "4326"; ingo@823: ingo@825: public static final String BARRIERS_PARAMETER_KEY = "uesk.barriers"; ingo@825: ingo@1269: public static final String WSPLGEN_FACET = "floodmap.wsplgen"; ingo@1269: ingo@1414: public static final String EXTERNAL_WMS_FACTORY = "externalwmsfactory"; ingo@1414: ingo@825: ingo@825: protected StepForwardServiceAsync feedService = ingo@825: GWT.create(StepForwardService.class); ingo@823: ingo@1365: protected MapOutputServiceAsync mapService = ingo@1365: GWT.create(MapOutputService.class); ingo@1365: ingo@1414: /** Service handle to clone and add artifacts to collection. */ ingo@1414: protected LoadArtifactServiceAsync loadArtifactService = ingo@1414: GWT.create(LoadArtifactService.class); ingo@1414: ingo@1415: protected FLYSConstants MSG = GWT.create(FLYSConstants.class); ingo@1415: ingo@825: protected MapToolbar controlPanel; ingo@806: protected ThemePanel themePanel; christian@2983: protected Canvas themePanelCanvas; christian@4402: protected MapWidget mapPanel; christian@3347: protected Canvas mapPanelCanvas; christian@4402: protected VLayout rootLayout = new VLayout(); christian@4402: protected AbsolutePanel absPan = new AbsolutePanel(); ingo@797: protected FloodMap floodMap; christian@4739: protected java.util.Map wmsUrls = new HashMap(); ingo@796: ingo@796: ingo@796: public MapOutputTab( ingo@796: String title, ingo@796: Collection collection, ingo@796: OutputMode mode, ingo@796: CollectionView collectionView ingo@796: ){ ingo@1364: super(title, collection, collectionView, mode); ingo@796: raimund@1542: collectionView.registerTabHandler(this); raimund@1542: ingo@1376: mapService.doOut(collection, new AsyncCallback() { christian@2983: @Override ingo@1365: public void onFailure(Throwable caught) { ingo@1365: GWT.log("MAP ERROR: " + caught.getMessage()); ingo@1365: } ingo@1365: christian@2983: @Override ingo@1376: public void onSuccess(MapConfig c) { ingo@1365: GWT.log("MAP SUCCESS!"); ingo@1376: ingo@1376: Bounds max = boundsFromString(c.getMaxExtent()); ingo@1376: Bounds initial = boundsFromString(c.getInitialExtent()); ingo@1376: ingo@1376: if (initial == null) { ingo@1376: GWT.log("Warning: No initial extent set."); ingo@1376: initial = max; ingo@1376: } ingo@1376: christian@4476: setFloodmap(new FloodMap(c.getSrid(), max, 640, 480)); ingo@1376: ingo@1376: initLayout(); ingo@1376: initBarriers(); ingo@1376: ingo@1376: GWT.log("MAX EXTENT: " + max); ingo@1376: GWT.log("ZOOM TO: " + initial); ingo@1376: getMap().zoomToExtent(initial); ingo@1365: } ingo@1365: } ingo@1365: ); ingo@796: } ingo@796: ingo@796: ingo@796: protected void initLayout() { ingo@798: rootLayout.setHeight100(); ingo@798: rootLayout.setWidth100(); ingo@798: rootLayout.setMembersMargin(2); ingo@797: christian@5612: HLayout hlayout = new HLayout(); christian@4402: hlayout.setMembersMargin(0); ingo@798: christian@2983: this.themePanelCanvas = createThemePanel(); raimund@1386: raimund@1386: controlPanel = createControlPanel(); christian@3347: mapPanel = floodMap.getMapWidget(); ingo@798: ingo@798: rootLayout.addMember(controlPanel); christian@4402: rootLayout.addMember(absPan); christian@4402: absPan.setWidth("100%"); christian@4402: absPan.setHeight("100%"); christian@4402: absPan.add(themePanelCanvas); christian@4402: absPan.add(mapPanel); ingo@798: christian@4402: rootLayout.addResizedHandler(new ResizedHandler() { christian@2983: @Override ingo@798: public void onResized(ResizedEvent e) { christian@4402: doLayout(); ingo@798: } ingo@798: }); ingo@798: christian@4570: rootLayout.addParentMovedHandler(new ParentMovedHandler() { christian@4570: @Override christian@4570: public void onParentMoved(ParentMovedEvent event) { christian@4570: mapPanel.getMap().updateSize(); christian@4570: } christian@4570: }); christian@4570: ingo@798: setPane(rootLayout); ingo@797: } ingo@797: ingo@797: christian@4402: protected void doLayout() { christian@4402: if(!rootLayout.isVisible()) { christian@4402: return; christian@4402: } christian@4402: christian@4402: // Manually set the height of the AbsolutePanel, somehow this is necessary christian@4402: absPan.setHeight(String.valueOf( christian@4402: rootLayout.getHeight() - controlPanel.getHeight() - 2) + "px"); christian@4402: christian@4402: // Calculate bounds of Map christian@4402: int height = rootLayout.getHeight() - christian@4402: controlPanel.getHeight() - 6; christian@4402: int width = controlPanel.getWidth() - christian@4531: (themePanelCanvas.isVisible() ? themePanelCanvas.getWidth() + 4 : 2); christian@4402: christian@4402: // Set size and position of Map christian@4402: String w = String.valueOf(width) + "px"; christian@4402: String h = String.valueOf(height) + "px"; christian@4402: GWT.log("width=" + w); christian@4402: christian@4402: mapPanel.setSize(w, h); christian@4531: mapPanel.getMap().updateSize(); christian@4402: if(themePanelCanvas.isVisible()) { christian@4402: absPan.setWidgetPosition(mapPanel, themePanelCanvas.getWidth() + 2, 0); christian@4402: } christian@4402: else { christian@4402: absPan.setWidgetPosition(mapPanel, 0, 0); christian@4402: } christian@4402: christian@4402: // Set bounds of ThemePanelCanvas christian@4402: themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(), String.valueOf(height + 2) + "px"); christian@4402: } christian@4402: christian@4402: ingo@825: protected void initBarriers() { ingo@825: Vector vector = floodMap.getBarrierLayer(); ingo@825: vector.addVectorFeatureAddedListener( ingo@825: new VectorFeatureAddedListener() { christian@2983: @Override ingo@825: public void onFeatureAdded(FeatureAddedEvent e) { ingo@825: saveBarriers(); ingo@825: } ingo@825: } ingo@825: ); ingo@825: ingo@825: vector.addVectorFeatureRemovedListener( ingo@825: new VectorFeatureRemovedListener() { christian@2983: @Override ingo@825: public void onFeatureRemoved(FeatureRemovedEvent e) { ingo@825: saveBarriers(); ingo@825: } ingo@825: } ingo@825: ); ingo@825: ingo@825: ingo@825: Artifact artifact = getArtifact(); ingo@825: ingo@825: if (artifact == null) { ingo@825: return; ingo@825: } ingo@825: ingo@825: ArtifactDescription desc = artifact.getArtifactDescription(); ingo@825: ingo@825: String geojson = getGeoJSONFromStatic(desc); ingo@825: geojson = geojson != null ? geojson : getGeoJSONFromDynamic(desc); ingo@825: ingo@825: if (geojson == null || geojson.length() == 0) { ingo@825: GWT.log("No geojson string found -> no barriers existing."); ingo@825: return; ingo@825: } ingo@825: ingo@825: GeoJSON reader = new GeoJSON(); ingo@825: VectorFeature[] features = reader.read(geojson); ingo@825: ingo@825: vector.addFeatures(features); ingo@825: } ingo@825: ingo@825: ingo@1382: public void addLayer(Layer layer) { ingo@1448: FloodMap map = getFloodmap(); ingo@1382: ingo@1382: if (map != null) { ingo@1382: GWT.log("Add new layer '" + layer.getName() + "' to map."); ingo@1382: map.addLayer(layer); aheinecke@5793: if (layer instanceof WMS) { aheinecke@5793: wmsUrls.put(layer.getName(), aheinecke@5793: ((WMS)layer).getFullRequestString(new WMSParams(), null)); aheinecke@5793: } ingo@1382: } ingo@1382: } ingo@1382: ingo@1382: ingo@1382: public void removeLayer(String name) { ingo@1382: Map map = getMap(); ingo@1382: ingo@1382: Layer[] layers = map.getLayers(); ingo@1382: ingo@1382: for (Layer layer: layers) { ingo@1382: if (name.equals(layer.getName())) { ingo@1382: map.removeLayer(layer); ingo@1382: } ingo@1382: } ingo@1382: } ingo@1382: ingo@1382: ingo@1364: @Override ingo@1364: public void onRedrawRequest(RedrawRequestEvent event) { ingo@1382: mapService.doOut(collection, new AsyncCallback() { christian@2983: @Override ingo@1382: public void onFailure(Throwable caught) { ingo@1382: GWT.log("MAP ERROR: " + caught.getMessage()); ingo@1382: } ingo@1382: christian@2983: @Override ingo@1382: public void onSuccess(MapConfig c) { ingo@1397: GWT.log("We want to refresh the map now!"); ingo@1382: themePanel.updateCollection(); ingo@1397: getFloodmap().update(); ingo@1382: } ingo@1382: }); ingo@1364: } ingo@1364: ingo@1364: ingo@1412: @Override ingo@1412: public void load(List toLoad) { ingo@1412: GWT.log("The user wants to add " + toLoad.size() + " new WMS layers."); ingo@1414: ingo@1414: int len = toLoad.size(); ingo@1414: ingo@1414: Recommendation[] recom = new Recommendation[len]; ingo@1414: ingo@1414: for (int i = 0; i < len; i++) { ingo@1414: WMSLayer w = toLoad.get(i); ingo@1414: ingo@1414: String ids = w.getServer() + ";" + w.getName() + ";" + w.getTitle(); ingo@1414: recom[i] = new Recommendation(EXTERNAL_WMS_FACTORY, ids); ingo@1414: } ingo@1414: ingo@1414: Collection c = getCollection(); ingo@1414: ingo@1414: Config config = Config.getInstance(); ingo@1414: String locale = config.getLocale(); ingo@1414: ingo@1414: loadArtifactService.loadMany(c, recom, EXTERNAL_WMS_FACTORY, locale, ingo@1414: new AsyncCallback() { ingo@1414: ingo@1414: @Override ingo@1414: public void onFailure(Throwable throwable) { ingo@1415: SC.warn(MSG.getString(throwable.getMessage())); ingo@1414: } ingo@1414: ingo@1414: @Override ingo@1414: public void onSuccess(Artifact[] newArtifacts) { ingo@1415: getThemePanel().updateCollection(); ingo@1414: } ingo@1414: } ingo@1414: ); ingo@1412: } ingo@1412: ingo@1412: ingo@1376: protected void setFloodmap(FloodMap floodMap) { ingo@1376: this.floodMap = floodMap; ingo@1376: } ingo@1376: ingo@1376: ingo@1397: protected FloodMap getFloodmap() { ingo@1397: return floodMap; ingo@1397: } ingo@1397: ingo@1397: ingo@1306: protected Map getMap() { ingo@1306: return floodMap.getMap(); ingo@1306: } ingo@1306: ingo@1306: ingo@1382: protected ThemePanel getThemePanel() { ingo@1382: return themePanel; ingo@1382: } ingo@1382: ingo@1382: ingo@825: protected String getGeoJSONFromDynamic(ArtifactDescription desc) { ingo@825: DataList list = desc.getCurrentData(); ingo@825: ingo@835: if (list == null) { ingo@835: return null; ingo@835: } ingo@835: ingo@825: List datas = list.getAll(); ingo@825: for (Data data: datas) { ingo@825: String key = data.getLabel(); ingo@825: ingo@825: if (key != null && key.equals(BARRIERS_PARAMETER_KEY)) { ingo@825: DataItem def = data.getDefault(); ingo@825: ingo@825: if (def != null) { ingo@825: return def.getStringValue(); ingo@825: } ingo@825: } ingo@825: } ingo@825: ingo@825: return null; ingo@825: } ingo@825: ingo@825: ingo@825: protected String getGeoJSONFromStatic(ArtifactDescription desc) { ingo@825: // TODO Implement this method, if there are reachable states right after ingo@825: // the floodmap state - which is currently not the case. ingo@825: return null; ingo@825: } ingo@825: ingo@825: ingo@823: public ThemeList getThemeList() { ingo@823: return collection.getThemeList(mode.getName()); ingo@823: } ingo@823: ingo@823: ingo@823: public String getSrid() { ingo@823: ThemeList themeList = getThemeList(); ingo@823: ingo@823: int num = themeList.getThemeCount(); ingo@823: ingo@823: for (int i = 1; i <= num; i++) { ingo@823: AttributedTheme theme = (AttributedTheme) themeList.getThemeAt(i); ingo@835: ingo@835: if (theme == null) { ingo@835: continue; ingo@835: } ingo@835: ingo@823: String srid = theme.getAttr("srid"); ingo@823: ingo@823: if (srid != null && srid.length() > 0) { ingo@823: return srid; ingo@823: } ingo@823: } ingo@823: ingo@823: return DEFAULT_SRID; ingo@823: } ingo@823: ingo@823: ingo@806: protected Bounds boundsFromString(String bounds) { ingo@1376: GWT.log("Create Bounds from String: '" + bounds + "'"); ingo@806: if (bounds == null || bounds.length() == 0) { ingo@806: return null; ingo@806: } ingo@806: ingo@806: String[] values = bounds.split(" "); ingo@806: ingo@806: if (values == null || values.length < 4) { ingo@806: return null; ingo@806: } ingo@806: ingo@806: try { ingo@806: return new Bounds( ingo@806: Double.valueOf(values[0]), ingo@823: Double.valueOf(values[1]), ingo@806: Double.valueOf(values[2]), ingo@823: Double.valueOf(values[3])); ingo@806: } ingo@806: catch (NumberFormatException nfe) {} ingo@806: ingo@806: return null; ingo@806: } ingo@806: ingo@806: ingo@1382: public Layer createWMSLayer(Theme theme) { teichmann@4752: if (!(theme instanceof AttributedTheme)) { ingo@806: return null; ingo@806: } ingo@806: ingo@806: AttributedTheme at = (AttributedTheme) theme; ingo@806: christian@4739: String name = at.getAttr("name"); christian@4739: String desc = at.getAttr("description"); ingo@1400: String url = at.getAttr("url"); ingo@1400: String layers = at.getAttr("layers"); ingo@806: ingo@806: if (url == null || layers == null) { ingo@806: return null; ingo@806: } ingo@797: ingo@797: WMSParams params = new WMSParams(); ingo@797: params.setLayers(layers); ingo@797: params.setFormat("image/png"); ingo@806: params.setIsTransparent(true); ingo@797: ingo@823: WMSOptions opts = new WMSOptions(); ingo@823: opts.setProjection("EPSG:" + getSrid()); ingo@823: opts.setSingleTile(true); ingo@823: opts.setRatio(1); rrenkert@5032: if (layers.equals("OSM-WMS-Dienst")) { rrenkert@5032: opts.setAttribution(MSG.attribution()); christian@5612: opts.setSingleTile(true); christian@5612: opts.setTransitionEffect(TransitionEffect.RESIZE); rrenkert@5032: } ingo@1400: WMS wms = new WMS(layers, url, params, opts); ingo@806: wms.setIsVisible(at.getActive() == 1); ingo@806: wms.setIsBaseLayer(false); aheinecke@5793: // We can't set the full_url attribute here because map is not set aheinecke@5793: // at.addAttr("full_url", wms.getFullRequestString(params, null)); ingo@806: return wms; ingo@797: } ingo@797: ingo@797: christian@4739: public java.util.Map wmsUrls() { christian@4739: return this.wmsUrls; christian@4739: } christian@4739: christian@4739: raimund@1386: protected MapToolbar createControlPanel() { raimund@1386: return new MapToolbar(this, floodMap, false); ingo@796: } ingo@796: ingo@796: ingo@796: protected Canvas createThemePanel() { ingo@796: Canvas c = new Canvas(); ingo@1327: c.setMinWidth(300); ingo@4330: c.setWidth(200); ingo@796: c.setHeight100(); ingo@1327: c.setCanDragResize(true); ingo@797: c.setBorder("1px solid black"); ingo@796: ingo@806: themePanel = new MapThemePanel( felix@1555: this.getCollectionView(), ingo@1306: mode, ingo@1382: this, ingo@1306: new MapThemePanel.ActivateCallback() { christian@2983: @Override ingo@806: public void activate(Theme theme, boolean active) { ingo@4329: fireActivateTheme(theme, active); ingo@806: } ingo@1306: }, ingo@1306: new MapThemePanel.ThemeMovedCallback() { christian@2983: @Override ingo@1306: public void onThemeMoved(Theme theme, int oldIdx, int newIdx) { ingo@1306: // this code synchronizes the ThemePanel and the OpenLayers ingo@1306: // internal order of layers. ingo@1403: AttributedTheme at = (AttributedTheme) theme; ingo@1403: ingo@1403: String name = at.getAttr("layers"); ingo@1306: Map map = getMap(); ingo@1306: Layer[] layers = map.getLayersByName(name); ingo@1306: ingo@1306: if (layers == null || layers.length == 0) { ingo@1306: GWT.log("Error: Cannot find layer '" + name + "'"); ingo@1306: return; ingo@1306: } ingo@1306: ingo@1306: map.raiseLayer(layers[0], (newIdx-oldIdx)*-1); ingo@1306: map.zoomTo(map.getZoom()-1); ingo@1306: map.zoomTo(map.getZoom()+1); ingo@1306: } ingo@1377: }, ingo@1377: new MapThemePanel.LayerZoomCallback() { christian@2983: @Override ingo@1377: public void onLayerZoom(Theme theme, String extent) { ingo@1377: Bounds zoomTo = boundsFromString(extent); ingo@1377: ingo@1377: if (zoomTo == null) { ingo@1377: GWT.log("WARNING: No valid bounds for zooming found!"); ingo@1377: return; ingo@1377: } ingo@1377: ingo@1377: getMap().zoomToExtent(zoomTo); ingo@1377: } ingo@1306: } ingo@1306: ); ingo@1397: themePanel.addRedrawRequestHandler(this); ingo@4329: themePanel.addOutputParameterChangeHandler(this); ingo@806: c.addChild(themePanel); ingo@796: ingo@796: return c; ingo@796: } ingo@806: ingo@806: ingo@4329: private void fireActivateTheme(Theme theme, boolean active) { ingo@4329: activateTheme(theme, active); ingo@4329: } ingo@4329: ingo@4329: ingo@806: protected void activateTheme(Theme theme, boolean active) { ingo@1403: AttributedTheme at = (AttributedTheme) theme; ingo@1403: ingo@1403: String name = at.getAttr("layers"); ingo@806: Layer layer = floodMap.getMap().getLayerByName(name); ingo@806: ingo@1382: GWT.log("Set visibility of '" + name + "': " + active); ingo@1382: ingo@806: if (layer != null) { ingo@806: layer.setIsVisible(active); ingo@806: } ingo@806: } ingo@825: ingo@825: ingo@825: protected void saveBarriers() { ingo@825: Vector layer = floodMap.getBarrierLayer(); ingo@825: ingo@825: GeoJSON format = new GeoJSON(); ingo@825: String features = format.write(layer.getFeatures()); ingo@825: ingo@825: DataItem item = new DefaultDataItem( ingo@825: BARRIERS_PARAMETER_KEY, BARRIERS_PARAMETER_KEY, features); ingo@825: ingo@825: Data data = new DefaultData( ingo@825: BARRIERS_PARAMETER_KEY, BARRIERS_PARAMETER_KEY, "String", ingo@825: new DataItem[] {item} ); ingo@825: ingo@825: Config config = Config.getInstance(); christian@5612: String locale = config.getLocale(); ingo@825: raimund@1425: feedService.go(locale, getArtifact(), new Data[] { data }, ingo@825: new AsyncCallback() { christian@2983: @Override ingo@825: public void onFailure(Throwable caught) { ingo@825: GWT.log("Could not save barrier geometries: " + ingo@825: caught.getMessage()); ingo@825: } ingo@825: christian@2983: @Override ingo@825: public void onSuccess(Artifact artifact) { ingo@825: GWT.log("Successfully saved barrier geometries."); ingo@825: } ingo@825: } ingo@825: ); ingo@825: } raimund@1542: raimund@1542: christian@2983: @Override raimund@1542: public void onTabSelected(TabSelectedEvent tse) { raimund@1542: if(floodMap == null) { raimund@1542: return; raimund@1542: } raimund@1542: if(this.equals(tse.getTab())) { raimund@1542: floodMap.activateScaleLine(true); raimund@1542: } raimund@1542: else { raimund@1542: controlPanel.activateMeasureControl(false); raimund@1542: floodMap.activateScaleLine(false); raimund@1542: } raimund@1542: } christian@2983: christian@2983: public void toogleThemePanel() { christian@2983: this.themePanelCanvas.setVisible(!themePanelCanvas.isVisible()); christian@4402: christian@4402: // Trigger resize event handler christian@4402: doLayout(); christian@2983: } ingo@4329: ingo@4329: ingo@4329: @Override ingo@4329: public void onOutputParameterChanged(OutputParameterChangeEvent evt) { ingo@4329: GWT.log("OutputParameterChanged"); ingo@4329: controlPanel.updateThemes(getThemePanel().getThemeList()); ingo@4329: } ingo@796: } ingo@796: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :