comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/BBox.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/shared/model/BBox.java@821a02bbfb4e
children 172338b1407f
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.client.shared.model;
2
3 import java.io.Serializable;
4
5
6 public class BBox implements Serializable {
7
8 public double lowerX;
9 public double upperX;
10 public double lowerY;
11 public double upperY;
12
13
14 public BBox() {
15 }
16
17
18 public BBox(double lowerX, double lowerY, double upperX, double upperY) {
19 this.lowerX = lowerX;
20 this.lowerY = lowerY;
21 this.upperX = upperX;
22 this.upperY = upperY;
23 }
24
25
26 public double getLowerX() {
27 return lowerX;
28 }
29
30
31 public double getLowerY() {
32 return lowerY;
33 }
34
35
36 public double getUpperX() {
37 return upperX;
38 }
39
40
41 public double getUpperY() {
42 return upperY;
43 }
44
45
46 public String toString() {
47 return
48 "(" + lowerX + "," + lowerY + ")" +
49 "(" + upperX + "," + upperY + ")";
50 }
51
52
53 public static BBox getBBoxFromString(String bbox) {
54 String[] coords = bbox != null ? bbox.split(" ") : null;
55
56 if (coords == null || coords.length < 4) {
57 return null;
58 }
59
60 try {
61 return new BBox(
62 Double.parseDouble(coords[0]),
63 Double.parseDouble(coords[1]),
64 Double.parseDouble(coords[2]),
65 Double.parseDouble(coords[3]));
66 }
67 catch (NumberFormatException nfe) {
68 // do nothing here
69 }
70
71 return null;
72 }
73 }
74 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org