1
2
3
4
5
6 package nl.javel.gisbeans.map;
7
8 import java.awt.Graphics2D;
9 import java.awt.geom.Point2D;
10 import java.awt.geom.Rectangle2D;
11 import java.rmi.RemoteException;
12 import java.util.List;
13
14 import nl.javel.gisbeans.geom.SerializableRectangle2D;
15
16 /***
17 * This interface defines the map.
18 *
19 * @author <a href="mailto:paul.jacobs@javel.nl">Paul Jacobs </a>
20 * @since JDK 1.0
21 * @version 1.0
22 */
23 public interface MapInterface extends java.io.Serializable
24 {
25 /*** MINX contant */
26 public static final byte MINX = 0;
27
28 /*** MINY contant */
29 public static final byte MINY = 1;
30
31 /*** MAXX contant */
32 public static final byte MAXX = 2;
33
34 /*** MAXY contant */
35 public static final byte MAXY = 3;
36
37 /*** FEET contant */
38 public static final byte FEET = 0;
39
40 /*** INCHES contant */
41 public static final byte INCHES = 1;
42
43 /*** KILOMETERS contant */
44 public static final byte KILOMETERS = 2;
45
46 /*** METERS contant */
47 public static final byte METERS = 3;
48
49 /*** MILES contant */
50 public static final byte MILES = 4;
51
52 /*** DD contant */
53 public static final byte DD = 5;
54
55 /*** UL */
56 public static final byte UL = 0;
57
58 /*** UC */
59 public static final byte UC = 1;
60
61 /*** UR */
62 public static final byte UR = 2;
63
64 /*** CL */
65 public static final byte CL = 3;
66
67 /*** CC */
68 public static final byte CC = 4;
69
70 /*** CR */
71 public static final byte CR = 5;
72
73 /*** LL */
74 public static final byte LL = 6;
75
76 /*** LC */
77 public static final byte LC = 7;
78
79 /*** LR */
80 public static final byte LR = 8;
81
82 /*** TEXT */
83 public static final byte TEXT = 0;
84
85 /*** ANGLEDEG */
86 public static final byte ANGLEDEG = 1;
87
88 /*** ANGLERAD */
89 public static final byte ANGLERAD = 2;
90
91 /*** IMAGE */
92 public static final byte IMAGE = 3;
93
94 /*** AIRPHOTO */
95 public static final byte AIRPHOTO = 4;
96
97 /*** POLYGON */
98 public static final byte POLYGON = 0;
99
100 /*** POINT */
101 public static final byte POINT = 1;
102
103 /*** LINE */
104 public static final byte LINE = 2;
105
106 /*** FEET_TO_METER */
107 public static final double FEET_TO_METER = 0.3048;
108
109 /*** INCH_TO_METER */
110 public static final double INCH_TO_METER = 0.0254;
111
112 /*** KILOMETER_TO_METER */
113 public static final double KILOMETER_TO_METER = 1000;
114
115 /*** MILES_TO_METER */
116 public static final double MILES_TO_METER = 1609.34;
117
118 /*** DD_TO_METER */
119 public static final double DD_TO_METER = 111119;
120
121 /*** CENTIMETER_PER_INCH */
122 public static final double CENTIMETER_PER_INCH = 2.54;
123
124 /***
125 * draws the legend on a graphics object
126 *
127 * @return Graphics2D
128 * @param graphics the graphics object
129 * @throws GraphicsException on drawing failure
130 * @throws RemoteException on network failure
131 */
132 public Graphics2D drawLegend(Graphics2D graphics) throws GraphicsException,
133 RemoteException;
134
135 /***
136 * draws the map on a graphics object
137 *
138 * @param graphics the graphics object
139 * @return Graphics2D
140 * @throws GraphicsException on drawing failure
141 * @throws RemoteException on network failure
142 */
143 public Graphics2D drawMap(Graphics2D graphics) throws GraphicsException,
144 RemoteException;
145
146 /***
147 * draws the reference map on a graphics object
148 *
149 * @param graphics the graphics object
150 * @return Graphics2D
151 * @throws GraphicsException on drawing failure
152 * @throws RemoteException on network failure
153 */
154 public Graphics2D drawReferenceMap(Graphics2D graphics)
155 throws GraphicsException, RemoteException;
156
157 /***
158 * draws the scalebar on a graphics object
159 *
160 * @param graphics the graphics object
161 * @return Graphics2D
162 * @throws GraphicsException on drawing failure
163 * @throws RemoteException on network failure
164 */
165 public Graphics2D drawScalebar(Graphics2D graphics)
166 throws GraphicsException, RemoteException;
167
168 /***
169 * Getter for property extent
170 *
171 * @return the extent of the map
172 * @throws RemoteException on network exception
173 */
174 public Rectangle2D getExtent() throws RemoteException;
175
176 /***
177 * Getter for property image
178 *
179 * @return ImageInterface the value of property image.
180 * @throws RemoteException on network exception
181 */
182 public ImageInterface getImage() throws RemoteException;
183
184 /***
185 * Getter for property layers
186 *
187 * @return List the value of property layers.
188 * @throws RemoteException on network exception
189 */
190 public List getLayers() throws RemoteException;
191
192 /***
193 * Getter for property name
194 *
195 * @return String the value of property extent.
196 * @throws RemoteException on network exception
197 */
198 public String getName() throws RemoteException;
199
200 /***
201 * Getter for property referenceMap
202 *
203 * @return ReferenceMap the value of property referenceMap.
204 * @throws RemoteException on network exception
205 */
206 public ReferenceMapInterface getReferenceMap() throws RemoteException;
207
208 /***
209 * returns the sclale of the map
210 *
211 * @return double the scale of the map in its units
212 * @throws RemoteException on network exception
213 */
214 public double getScale() throws RemoteException;
215
216 /***
217 * returns the scale of the Image
218 *
219 * @return double the unitPerPixel
220 * @throws RemoteException on network exception
221 */
222 public double getUnitImageRatio() throws RemoteException;
223
224 /***
225 * Getter for property units
226 *
227 * @return int the value of property units.
228 * @throws RemoteException on network exception
229 */
230 public int getUnits() throws RemoteException;
231
232 /***
233 * Setter for property extent.
234 *
235 * @param extent New value of property extent..
236 * @throws RemoteException on network exception
237 */
238 public void setExtent(Rectangle2D extent) throws RemoteException;
239
240 /***
241 * Setter for property image.
242 *
243 * @param image New value of property image.
244 * @throws RemoteException on network exception
245 */
246 public void setImage(ImageInterface image) throws RemoteException;
247
248 /***
249 * Setter for property layers.
250 *
251 * @param layers New value of property layers.
252 * @throws RemoteException on network exception
253 */
254 public void setLayers(List layers) throws RemoteException;
255
256 /***
257 * Setter for property layers.
258 *
259 * @param index Index value of layer
260 * @param layer New value of property layers.
261 * @throws RemoteException on network exception
262 */
263 public void setLayer(int index, LayerInterface layer)
264 throws RemoteException;
265
266 /***
267 * Setter for property layers.
268 *
269 * @param layer New value of property layers.
270 * @throws RemoteException on network exception
271 */
272 public void addLayer(LayerInterface layer) throws RemoteException;
273
274 /***
275 * Setter for property name.
276 *
277 * @param name New value of property name.
278 * @throws RemoteException on network exception
279 */
280 public void setName(String name) throws RemoteException;
281
282 /***
283 * Setter for property referenceMap.
284 *
285 * @param referenceMap New value of property referenceMap.
286 * @throws RemoteException on network exception
287 */
288 public void setReferenceMap(ReferenceMapInterface referenceMap)
289 throws RemoteException;
290
291 /***
292 * Setter for property units.
293 *
294 * @param units New value of property units.
295 * @throws RemoteException on network exception
296 */
297 public void setUnits(int units) throws RemoteException;
298
299 /***
300 * zooms the map with a prticular factor
301 *
302 * @param zoomFactor (0=1)
303 * @throws RemoteException on network exception
304 */
305 public void zoom(double zoomFactor) throws RemoteException;
306
307 /***
308 * zooms the map based on a given position in the image
309 *
310 * @param pixelPosition the position in the image
311 * @param zoomFactor the zoomFactor (0=1)
312 * @throws RemoteException on network exception
313 */
314 public void zoomPoint(Point2D pixelPosition, double zoomFactor)
315 throws RemoteException;
316
317 /***
318 * zooms the map based on a given rectangle
319 *
320 * @param rectangle a rectangle in the map (image units)
321 * @throws RemoteException on network exception
322 */
323 public void zoomRectangle(SerializableRectangle2D rectangle)
324 throws RemoteException;
325
326 }