View Javadoc

1   /* Copyright (2007) Schibsted Søk AS
2    * This file is part of SESAT.
3    *
4    *   SESAT is free software: you can redistribute it and/or modify
5    *   it under the terms of the GNU Affero General Public License as published by
6    *   the Free Software Foundation, either version 3 of the License, or
7    *   (at your option) any later version.
8    *
9    *   SESAT is distributed in the hope that it will be useful,
10   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   *   GNU Affero General Public License for more details.
13   *
14   *   You should have received a copy of the GNU Affero General Public License
15   *   along with SESAT.  If not, see <http://www.gnu.org/licenses/>.
16   */
17  package no.geodata.maputil;
18  
19  /*
20   * MapEnvelope.java
21   *
22   * Created on 22. august 2005, 12:55
23   *
24   *
25   */
26  public class MapEnvelope {
27      MapPoint upperLeft = new MapPoint();
28      MapPoint lowerRight = new MapPoint();
29      double maxX;
30      double minX;
31      double maxY;
32      double minY;
33      double centerX;
34      double centerY;
35  
36      /** Creates a new instance of MapPoint. */
37      public MapEnvelope() {
38      }
39  
40  
41      /** Creates a new instance of MapEnvelope
42       * @param maxX double
43       * @param minX double
44       * @param maxY double
45       * @param minY double
46       */
47      public MapEnvelope(double maxX, double minX, double maxY, double minY){
48          this.maxX = maxX;
49          this.minX = minX;
50          this.maxY = maxY;
51          this.minY = minY;
52          this.centerX = minX + (maxX - minX)/2;
53          this.centerY = minY + (maxY - minY)/2;
54      }
55       /** Sets single value.
56       * @param maxX double.
57       */
58      public void setMaxX(double maxX){
59          this.maxX = maxX;
60      }
61      /** Gets a single value.
62       *  @return maxX double
63       */
64      public double getMaxX(){
65          return this.maxX;
66      }
67       /** Sets single value.
68       * @param minX double.
69       */
70      public void setMinX(double minX){
71          this.minX = minX;
72      }
73       /** Gets a single value.
74       *  @return minX double
75       */
76      public double getMinX(){
77          return this.minX;
78      }
79       /** Sets single value.
80       * @param maxY double.
81       */
82      public void setMaxY(double maxY){
83          this.maxY = maxY;
84      }
85       /** Gets a single value.
86       *  @return maxY double
87       */
88      public double getMaxY(){
89          return this.maxY;
90      }
91      /** Sets single value.
92       * @param centerX double.
93       */
94      public void setCenterX(double centerX){
95          this.centerX = centerX;
96      }
97       /** Gets a single value.
98       *  @return centerX double
99       */
100     public double getCenterX(){
101         return this.centerX;
102     }
103      /** Sets single value.
104      * @param centerX double.
105      */
106     public void setCenterY(double centerY){
107         this.centerY = centerY;
108     }
109      /** Gets a single value.
110      *  @return centerX double
111      */
112     public double getCenterY(){
113         return this.centerY;
114     }
115 
116      /** Sets single value.
117      * @param minY double.
118      */
119     public void setMinY(double minY){
120         this.minY = minY;
121     }
122      /** Gets a single value.
123      *  @return minY double
124      */
125     public double getMinY(){
126         return this.minY;
127     }
128 
129     /** Creates a new instance of MapEnvelope
130      * @param upperLeft UpperLeft corner of Envelope
131      * @param lowerRight LowerRight corner of Envelope.
132      */
133     public MapEnvelope(MapPoint ul, MapPoint lr) {
134         this.upperLeft = ul;
135         this.lowerRight = lr;
136     }
137     /** Sets single value.
138      * @param ul UpperLeft corner of Envelope.
139      */
140     public void setUpperLeft(MapPoint ul) {
141         this.upperLeft = ul;
142     }
143     /** Sets single value.
144      * @param lr LowerRight corner of Envelope.
145      */
146     public void setLowerRight(MapPoint lr) {
147         this.lowerRight = lr;
148     }
149     /** Gets a single value.
150      *  @return MapPoint upperLeft
151      */
152     public MapPoint getUpperLeft(){
153         return this.upperLeft;
154     }
155     /** Gets a single value.
156      *  @return MapPoint lowerRight
157      */
158     public MapPoint getLowerRight(){
159         return this.lowerRight;
160     }
161 
162 
163 }