view flys-client/src/main/java/de/intevation/flys/client/shared/model/BBox.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 910b03de6857
children
line wrap: on
line source
package de.intevation.flys.client.shared.model;

import java.io.Serializable;


public class BBox implements Serializable {

    public double lowerX;
    public double upperX;
    public double lowerY;
    public double upperY;


    public BBox() {
    }


    public BBox(double lowerX, double lowerY, double upperX, double upperY) {
        this.lowerX = lowerX;
        this.lowerY = lowerY;
        this.upperX = upperX;
        this.upperY = upperY;
    }


    public double getLowerX() {
        return lowerX;
    }


    public double getLowerY() {
        return lowerY;
    }


    public double getUpperX() {
        return upperX;
    }


    public double getUpperY() {
        return upperY;
    }


    public String toString() {
        return
            "(" + lowerX + "," + lowerY + ")" +
            "(" + upperX + "," + upperY + ")";
    }


    public static BBox getBBoxFromString(String bbox) {
        String[] coords = bbox != null ? bbox.split(" ") : null;

        if (coords == null || coords.length < 4) {
            return null;
        }

        try {
            return new BBox(
                Double.parseDouble(coords[0]),
                Double.parseDouble(coords[1]),
                Double.parseDouble(coords[2]),
                Double.parseDouble(coords[3]));
        }
        catch (NumberFormatException nfe) {
            // do nothing here
        }

        return null;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org