[Webflysuesk-commits] r39 - in webflysuesk/branches/openlayers-integration: . webflys/src/main/java/de/intevation/webflys/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Mar 26 11:50:27 CET 2009


Author: iweinzierl
Date: 2009-03-26 11:50:26 +0100 (Thu, 26 Mar 2009)
New Revision: 39

Added:
   webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/BBox.java
Modified:
   webflysuesk/branches/openlayers-integration/ChangeLog.txt
   webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/River.java
Log:
Now, the River object has a method to return his BoundingBox.

Modified: webflysuesk/branches/openlayers-integration/ChangeLog.txt
===================================================================
--- webflysuesk/branches/openlayers-integration/ChangeLog.txt	2009-03-26 10:25:12 UTC (rev 38)
+++ webflysuesk/branches/openlayers-integration/ChangeLog.txt	2009-03-26 10:50:26 UTC (rev 39)
@@ -1,5 +1,13 @@
 2009-03-26  Ingo Weinzierl <ingo.weinzierl at intevation.de>
 
+	* webflys/src/main/java/de/intevation/webflys/model/River.java,
+	  webflys/src/main/java/de/intevation/webflys/model/BBox.java: Now, we are
+	  able to ask the River for it's BoundingBox.
+	  TODO: At the moment, there are two BoundingBoxes defined in an array. We
+	  should find the BoundingBox for a River on a better way.
+
+2009-03-26  Ingo Weinzierl <ingo.weinzierl at intevation.de>
+
 	* webflys/src/main/webapp/pages/main.jsp,
 	  webflys/src/main/webapp/pages/karte.js: Integrated an OpenLayers map in
 	  the div container besides the parameter panel. A basic background layer

Added: webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/BBox.java
===================================================================
--- webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/BBox.java	2009-03-26 10:25:12 UTC (rev 38)
+++ webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/BBox.java	2009-03-26 10:50:26 UTC (rev 39)
@@ -0,0 +1,134 @@
+/*
+ * BBox.java
+ * ----------
+ * (c) 2009 by Invetation GmbH
+ *
+ * This file is part of WebFLYS/UeSK.
+ *
+ * WebFLYS is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * any later version.
+ *
+ * WebFLYS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with WebFLYS.  If not, see <http://www.gnu.org/licenses/>.
+ */
+package de.intevation.webflys.model;
+
+/**
+ *  @author Ingo Weinzierl
+ */
+
+public class BBox
+{
+    /** lower left corner of the bounding box */
+    double xmin;
+    double ymin;
+
+    /** upper right corner of the bounding box */
+    double xmax;
+    double ymax;
+
+    public BBox(double xmin, double ymin, double xmax, double ymax) {
+        this.xmin = xmin;
+        this.ymin = ymin;
+        this.xmax = xmax;
+        this.ymax = ymax;
+    }
+
+    
+    /**
+     * Get xmin.
+     *
+     * @return xmin as double.
+     */
+    public double getXmin() {
+        return xmin;
+    }
+    
+    /**
+     * Set xmin.
+     *
+     * @param xmin the value to set.
+     */
+    public void setXmin(double xmin) {
+        this.xmin = xmin;
+    }
+    
+    /**
+     * Get ymin.
+     *
+     * @return ymin as double.
+     */
+    public double getYmin() {
+        return ymin;
+    }
+    
+    /**
+     * Set ymin.
+     *
+     * @param ymin the value to set.
+     */
+    public void setYmin(double ymin) {
+        this.ymin = ymin;
+    }
+    
+    /**
+     * Get xmax.
+     *
+     * @return xmax as double.
+     */
+    public double getXmax() {
+        return xmax;
+    }
+    
+    /**
+     * Set xmax.
+     *
+     * @param xmax the value to set.
+     */
+    public void setXmax(double xmax) {
+        this.xmax = xmax;
+    }
+    
+    /**
+     * Get ymax.
+     *
+     * @return ymax as double.
+     */
+    public double getYmax() {
+        return ymax;
+    }
+    
+    /**
+     * Set ymax.
+     *
+     * @param ymax the value to set.
+     */
+    public void setYmax(double ymax) {
+        this.ymax = ymax;
+    }
+
+    /**
+     * @return BoundingBox as String.
+     */
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+
+        sb.append(xmin);
+        sb.append(",");
+        sb.append(ymin);
+        sb.append(",");
+        sb.append(xmax);
+        sb.append(",");
+        sb.append(ymax);
+
+        return sb.toString();
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

Modified: webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/River.java
===================================================================
--- webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/River.java	2009-03-26 10:25:12 UTC (rev 38)
+++ webflysuesk/branches/openlayers-integration/webflys/src/main/java/de/intevation/webflys/model/River.java	2009-03-26 10:50:26 UTC (rev 39)
@@ -109,5 +109,34 @@
 
         return null;
     }
+
+    /**
+     * This method returns the BoundingBox of a river.
+     *
+     * TODO Remove array of BBoxes and find another way to get the BoundingBox
+     * of this river.
+     *
+     * @return {BBox} BoundingBox
+     */
+    public BBox getBBox( ) {
+
+        BBox[] boxes = {
+            new BBox(
+            6.5166181515507615, 49.166960703640434,
+            7.071726699026244, 49.72876558358557) ,
+            new BBox(
+                5.8973842508272325, 49.00593609353314,
+                8.513166819648188, 51.92111268724259)
+        };
+
+        if( name.equals( "Saar" ) )
+            return boxes[0];
+
+        else if( name.equals( "Rhein" ) )
+            return boxes[1];
+
+        else
+            return null;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Webflysuesk-commits mailing list