view flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java @ 4215:c179cd02177d

Logout the current user Add code to the logout button to remove the current user from the session and to redirect the browser window to the login page. Part of flys/issue916 (Logout: "Abmelden" Knopf mit Funktion belegen)
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 23 Oct 2012 09:59:16 +0200
parents 61020a61ed38
children c84630d544a1
line wrap: on
line source
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 de.intevation.flys.client.shared.model.BBox;
import de.intevation.flys.client.shared.model.MapInfo;

import org.gwtopenmaps.openlayers.client.Bounds;


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, digitizeEnabled);

        addMember(toolbar);
        addMember(wrapper);
    }


    public FloodMap getFloodMap() {
        return floodMap;
    }

    public MapToolbar getMapToolbar () {
        return toolbar;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org