Line | Hits | Source |
---|---|---|
1 | // A Java MapScript module for MapServer. | |
2 | // See <http://mapserver.gis.umn.edu> for information on MapServer. | |
3 | // | |
4 | // Copyright (C) 2003 Andrew Collins <andrewrcollins@yahoo.com> | |
5 | // | |
6 | // This library is free software; you can redistribute it | |
7 | // and/or modify it under the terms of the GNU Lesser General | |
8 | // Public License as published by the Free Software Foundation; | |
9 | // either version 2.1 of the License, or (at your option) any | |
10 | // later version. | |
11 | // | |
12 | // This library is distributed in the hope that it will be useful, | |
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty | |
14 | // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
15 | // See the GNU Lesser General Public License for more details. | |
16 | // | |
17 | // You should have received a copy of the GNU Lesser General | |
18 | // Public License along with this library; if not, write to | |
19 | // the Free Software Foundation, Inc., 59 Temple Place, | |
20 | // Suite 330, Boston, MA 02111-1307 USA | |
21 | package edu.umn.gis.mapscript.imp; | |
22 | ||
23 | /** | |
24 | * DOCUMENT ME! | |
25 | * | |
26 | * @author <a href="mailto:ADDRESS">NAME</a> | |
27 | * | |
28 | * @todo CLASS_DESCRIPTION | |
29 | */ | |
30 | public class mapObj | |
31 | { | |
32 | /** | |
33 | * DOCUMENT ME! | |
34 | * | |
35 | * @todo FIELD_DESCRIPTION | |
36 | */ | |
37 | protected boolean swigCMemOwn; | |
38 | ||
39 | /** | |
40 | * DOCUMENT ME! | |
41 | * | |
42 | * @todo FIELD_DESCRIPTION | |
43 | */ | |
44 | private long swigCPtr; | |
45 | ||
46 | /** | |
47 | * Creates a new mapObj object. | |
48 | * | |
49 | * @param filename PARAMETER | |
50 | */ | |
51 | public mapObj(String filename) | |
52 | { | |
53 | 0 | this(MapScriptJNI.new_mapObj(filename), true); |
54 | 0 | } |
55 | ||
56 | /** | |
57 | * Creates a new mapObj object. | |
58 | * | |
59 | * @param cPtr PARAMETER | |
60 | * @param cMemoryOwn PARAMETER | |
61 | */ | |
62 | protected mapObj(long cPtr, boolean cMemoryOwn) | |
63 | 0 | { |
64 | 0 | swigCMemOwn = cMemoryOwn; |
65 | 0 | swigCPtr = cPtr; |
66 | 0 | } |
67 | ||
68 | /** | |
69 | * Creates a new mapObj object. | |
70 | */ | |
71 | protected mapObj() | |
72 | { | |
73 | 0 | this(0, false); |
74 | 0 | } |
75 | ||
76 | /** | |
77 | * DOCUMENT ME! | |
78 | * | |
79 | * @param cellsize PARAMETER | |
80 | * | |
81 | * @todo METHOD_DESCRIPTION | |
82 | */ | |
83 | public void setCellsize(double cellsize) | |
84 | { | |
85 | 0 | MapScriptJNI.set_mapObj_cellsize(swigCPtr, cellsize); |
86 | 0 | } |
87 | ||
88 | /** | |
89 | * DOCUMENT ME! | |
90 | * | |
91 | * @return RETURN | |
92 | * | |
93 | * @todo METHOD_DESCRIPTION | |
94 | */ | |
95 | public double getCellsize() | |
96 | { | |
97 | 0 | return MapScriptJNI.get_mapObj_cellsize(swigCPtr); |
98 | } | |
99 | ||
100 | /** | |
101 | * DOCUMENT ME! | |
102 | * | |
103 | * @param extent PARAMETER | |
104 | * | |
105 | * @todo METHOD_DESCRIPTION | |
106 | */ | |
107 | public void setExtent(rectObj extent) | |
108 | { | |
109 | 0 | MapScriptJNI.set_mapObj_extent(swigCPtr, rectObj.getCPtr(extent)); |
110 | 0 | } |
111 | ||
112 | /** | |
113 | * DOCUMENT ME! | |
114 | * | |
115 | * @return RETURN | |
116 | * | |
117 | * @todo METHOD_DESCRIPTION | |
118 | */ | |
119 | public rectObj getExtent() | |
120 | { | |
121 | 0 | return new rectObj(MapScriptJNI.get_mapObj_extent(swigCPtr), false); |
122 | } | |
123 | ||
124 | /** | |
125 | * DOCUMENT ME! | |
126 | * | |
127 | * @param szFileName PARAMETER | |
128 | * | |
129 | * @return RETURN | |
130 | * | |
131 | * @todo METHOD_DESCRIPTION | |
132 | */ | |
133 | public int setFontSet(String szFileName) | |
134 | { | |
135 | 0 | return MapScriptJNI.mapObj_setFontSet(swigCPtr, szFileName); |
136 | } | |
137 | ||
138 | /** | |
139 | * DOCUMENT ME! | |
140 | * | |
141 | * @param height PARAMETER | |
142 | * | |
143 | * @todo METHOD_DESCRIPTION | |
144 | */ | |
145 | public void setHeight(int height) | |
146 | { | |
147 | 0 | MapScriptJNI.set_mapObj_height(swigCPtr, height); |
148 | 0 | } |
149 | ||
150 | /** | |
151 | * DOCUMENT ME! | |
152 | * | |
153 | * @return RETURN | |
154 | * | |
155 | * @todo METHOD_DESCRIPTION | |
156 | */ | |
157 | public int getHeight() | |
158 | { | |
159 | 0 | return MapScriptJNI.get_mapObj_height(swigCPtr); |
160 | } | |
161 | ||
162 | /** | |
163 | * DOCUMENT ME! | |
164 | * | |
165 | * @param image PARAMETER | |
166 | * @param varname PARAMETER | |
167 | * | |
168 | * @return RETURN | |
169 | * | |
170 | * @todo METHOD_DESCRIPTION | |
171 | */ | |
172 | public int getImageToVar(imageObj image, String varname) | |
173 | { | |
174 | 0 | return MapScriptJNI.mapObj_getImageToVar(swigCPtr, imageObj.getCPtr(image), |
175 | varname); | |
176 | } | |
177 | ||
178 | /** | |
179 | * DOCUMENT ME! | |
180 | * | |
181 | * @param imagecolor PARAMETER | |
182 | * | |
183 | * @todo METHOD_DESCRIPTION | |
184 | */ | |
185 | public void setImagecolor(colorObj imagecolor) | |
186 | { | |
187 | 0 | MapScriptJNI.set_mapObj_imagecolor(swigCPtr, colorObj.getCPtr(imagecolor)); |
188 | 0 | } |
189 | ||
190 | /** | |
191 | * DOCUMENT ME! | |
192 | * | |
193 | * @return RETURN | |
194 | * | |
195 | * @todo METHOD_DESCRIPTION | |
196 | */ | |
197 | public colorObj getImagecolor() | |
198 | { | |
199 | 0 | return new colorObj(MapScriptJNI.get_mapObj_imagecolor(swigCPtr), false); |
200 | } | |
201 | ||
202 | /** | |
203 | * DOCUMENT ME! | |
204 | * | |
205 | * @param imagequality PARAMETER | |
206 | * | |
207 | * @todo METHOD_DESCRIPTION | |
208 | */ | |
209 | public void setImagequality(int imagequality) | |
210 | { | |
211 | 0 | MapScriptJNI.set_mapObj_imagequality(swigCPtr, imagequality); |
212 | 0 | } |
213 | ||
214 | /** | |
215 | * DOCUMENT ME! | |
216 | * | |
217 | * @return RETURN | |
218 | * | |
219 | * @todo METHOD_DESCRIPTION | |
220 | */ | |
221 | public int getImagequality() | |
222 | { | |
223 | 0 | return MapScriptJNI.get_mapObj_imagequality(swigCPtr); |
224 | } | |
225 | ||
226 | /** | |
227 | * DOCUMENT ME! | |
228 | * | |
229 | * @param imagetype PARAMETER | |
230 | * | |
231 | * @todo METHOD_DESCRIPTION | |
232 | */ | |
233 | public void setImagetype(int imagetype) | |
234 | { | |
235 | 0 | MapScriptJNI.set_mapObj_imagetype(swigCPtr, imagetype); |
236 | 0 | } |
237 | ||
238 | /** | |
239 | * DOCUMENT ME! | |
240 | * | |
241 | * @return RETURN | |
242 | * | |
243 | * @todo METHOD_DESCRIPTION | |
244 | */ | |
245 | public int getImagetype() | |
246 | { | |
247 | 0 | return MapScriptJNI.get_mapObj_imagetype(swigCPtr); |
248 | } | |
249 | ||
250 | /** | |
251 | * DOCUMENT ME! | |
252 | * | |
253 | * @param interlace PARAMETER | |
254 | * | |
255 | * @todo METHOD_DESCRIPTION | |
256 | */ | |
257 | public void setInterlace(int interlace) | |
258 | { | |
259 | 0 | MapScriptJNI.set_mapObj_interlace(swigCPtr, interlace); |
260 | 0 | } |
261 | ||
262 | /** | |
263 | * DOCUMENT ME! | |
264 | * | |
265 | * @return RETURN | |
266 | * | |
267 | * @todo METHOD_DESCRIPTION | |
268 | */ | |
269 | public int getInterlace() | |
270 | { | |
271 | 0 | return MapScriptJNI.get_mapObj_interlace(swigCPtr); |
272 | } | |
273 | ||
274 | /** | |
275 | * DOCUMENT ME! | |
276 | * | |
277 | * @param labelcache PARAMETER | |
278 | * | |
279 | * @todo METHOD_DESCRIPTION | |
280 | */ | |
281 | public void setLabelcache(labelCacheObj labelcache) | |
282 | { | |
283 | 0 | MapScriptJNI.set_mapObj_labelcache(swigCPtr, |
284 | labelCacheObj.getCPtr(labelcache)); | |
285 | 0 | } |
286 | ||
287 | /** | |
288 | * DOCUMENT ME! | |
289 | * | |
290 | * @return RETURN | |
291 | * | |
292 | * @todo METHOD_DESCRIPTION | |
293 | */ | |
294 | public labelCacheObj getLabelcache() | |
295 | { | |
296 | 0 | return new labelCacheObj(MapScriptJNI.get_mapObj_labelcache(swigCPtr), false); |
297 | } | |
298 | ||
299 | /** | |
300 | * DOCUMENT ME! | |
301 | * | |
302 | * @param i PARAMETER | |
303 | * | |
304 | * @return RETURN | |
305 | * | |
306 | * @todo METHOD_DESCRIPTION | |
307 | */ | |
308 | public layerObj getLayer(int i) | |
309 | { | |
310 | 0 | return new layerObj(MapScriptJNI.mapObj_getLayer(swigCPtr, i), false); |
311 | } | |
312 | ||
313 | /** | |
314 | * DOCUMENT ME! | |
315 | * | |
316 | * @param name PARAMETER | |
317 | * | |
318 | * @return RETURN | |
319 | * | |
320 | * @todo METHOD_DESCRIPTION | |
321 | */ | |
322 | public layerObj getLayerByName(String name) | |
323 | { | |
324 | 0 | return new layerObj(MapScriptJNI.mapObj_getLayerByName(swigCPtr, name), |
325 | false); | |
326 | } | |
327 | ||
328 | /** | |
329 | * DOCUMENT ME! | |
330 | * | |
331 | * @param layerorder PARAMETER | |
332 | * | |
333 | * @todo METHOD_DESCRIPTION | |
334 | */ | |
335 | public void setLayerorder(SWIGTYPE_p_int layerorder) | |
336 | { | |
337 | 0 | MapScriptJNI.set_mapObj_layerorder(swigCPtr, |
338 | SWIGTYPE_p_int.getCPtr(layerorder)); | |
339 | 0 | } |
340 | ||
341 | /** | |
342 | * DOCUMENT ME! | |
343 | * | |
344 | * @return RETURN | |
345 | * | |
346 | * @todo METHOD_DESCRIPTION | |
347 | */ | |
348 | public SWIGTYPE_p_int getLayerorder() | |
349 | { | |
350 | 0 | return new SWIGTYPE_p_int(MapScriptJNI.get_mapObj_layerorder(swigCPtr), |
351 | false); | |
352 | } | |
353 | ||
354 | /** | |
355 | * DOCUMENT ME! | |
356 | * | |
357 | * @param layers PARAMETER | |
358 | * | |
359 | * @todo METHOD_DESCRIPTION | |
360 | */ | |
361 | public void setLayers(layerObj layers) | |
362 | { | |
363 | 0 | MapScriptJNI.set_mapObj_layers(swigCPtr, layerObj.getCPtr(layers)); |
364 | 0 | } |
365 | ||
366 | /** | |
367 | * DOCUMENT ME! | |
368 | * | |
369 | * @return RETURN | |
370 | * | |
371 | * @todo METHOD_DESCRIPTION | |
372 | */ | |
373 | public layerObj getLayers() | |
374 | { | |
375 | 0 | return new layerObj(MapScriptJNI.get_mapObj_layers(swigCPtr), false); |
376 | } | |
377 | ||
378 | /** | |
379 | * DOCUMENT ME! | |
380 | * | |
381 | * @param panIndexes PARAMETER | |
382 | * | |
383 | * @return RETURN | |
384 | * | |
385 | * @todo METHOD_DESCRIPTION | |
386 | */ | |
387 | public int setLayersdrawingOrder(SWIGTYPE_p_int panIndexes) | |
388 | { | |
389 | 0 | return MapScriptJNI.mapObj_setLayersdrawingOrder(swigCPtr, |
390 | SWIGTYPE_p_int.getCPtr(panIndexes)); | |
391 | } | |
392 | ||
393 | /** | |
394 | * DOCUMENT ME! | |
395 | * | |
396 | * @return RETURN | |
397 | * | |
398 | * @todo METHOD_DESCRIPTION | |
399 | */ | |
400 | public SWIGTYPE_p_int getLayersdrawingOrder() | |
401 | { | |
402 | 0 | return new SWIGTYPE_p_int(MapScriptJNI.mapObj_getLayersdrawingOrder( |
403 | swigCPtr), false); | |
404 | } | |
405 | ||
406 | /** | |
407 | * DOCUMENT ME! | |
408 | * | |
409 | * @param legend PARAMETER | |
410 | * | |
411 | * @todo METHOD_DESCRIPTION | |
412 | */ | |
413 | public void setLegend(legendObj legend) | |
414 | { | |
415 | 0 | MapScriptJNI.set_mapObj_legend(swigCPtr, legendObj.getCPtr(legend)); |
416 | 0 | } |
417 | ||
418 | /** | |
419 | * DOCUMENT ME! | |
420 | * | |
421 | * @return RETURN | |
422 | * | |
423 | * @todo METHOD_DESCRIPTION | |
424 | */ | |
425 | public legendObj getLegend() | |
426 | { | |
427 | 0 | return new legendObj(MapScriptJNI.get_mapObj_legend(swigCPtr), false); |
428 | } | |
429 | ||
430 | /** | |
431 | * DOCUMENT ME! | |
432 | * | |
433 | * @param name PARAMETER | |
434 | * @param value PARAMETER | |
435 | * | |
436 | * @return RETURN | |
437 | * | |
438 | * @todo METHOD_DESCRIPTION | |
439 | */ | |
440 | public int setMetaData(String name, String value) | |
441 | { | |
442 | 0 | return MapScriptJNI.mapObj_setMetaData(swigCPtr, name, value); |
443 | } | |
444 | ||
445 | /** | |
446 | * DOCUMENT ME! | |
447 | * | |
448 | * @param name PARAMETER | |
449 | * | |
450 | * @return RETURN | |
451 | * | |
452 | * @todo METHOD_DESCRIPTION | |
453 | */ | |
454 | public String getMetaData(String name) | |
455 | { | |
456 | 0 | return MapScriptJNI.mapObj_getMetaData(swigCPtr, name); |
457 | } | |
458 | ||
459 | /** | |
460 | * DOCUMENT ME! | |
461 | * | |
462 | * @param name PARAMETER | |
463 | * | |
464 | * @todo METHOD_DESCRIPTION | |
465 | */ | |
466 | public void setName(String name) | |
467 | { | |
468 | 0 | MapScriptJNI.set_mapObj_name(swigCPtr, name); |
469 | 0 | } |
470 | ||
471 | /** | |
472 | * DOCUMENT ME! | |
473 | * | |
474 | * @return RETURN | |
475 | * | |
476 | * @todo METHOD_DESCRIPTION | |
477 | */ | |
478 | public String getName() | |
479 | { | |
480 | 0 | return MapScriptJNI.get_mapObj_name(swigCPtr); |
481 | } | |
482 | ||
483 | /** | |
484 | * DOCUMENT ME! | |
485 | * | |
486 | * @return RETURN | |
487 | * | |
488 | * @todo METHOD_DESCRIPTION | |
489 | */ | |
490 | public int getNumlayers() | |
491 | { | |
492 | 0 | return MapScriptJNI.get_mapObj_numlayers(swigCPtr); |
493 | } | |
494 | ||
495 | /** | |
496 | * DOCUMENT ME! | |
497 | * | |
498 | * @param palette PARAMETER | |
499 | * | |
500 | * @todo METHOD_DESCRIPTION | |
501 | */ | |
502 | public void setPalette(SWIGTYPE_p_paletteObj palette) | |
503 | { | |
504 | 0 | MapScriptJNI.set_mapObj_palette(swigCPtr, |
505 | SWIGTYPE_p_paletteObj.getCPtr(palette)); | |
506 | 0 | } |
507 | ||
508 | /** | |
509 | * DOCUMENT ME! | |
510 | * | |
511 | * @return RETURN | |
512 | * | |
513 | * @todo METHOD_DESCRIPTION | |
514 | */ | |
515 | public SWIGTYPE_p_paletteObj getPalette() | |
516 | { | |
517 | 0 | return new SWIGTYPE_p_paletteObj(MapScriptJNI.get_mapObj_palette(swigCPtr), |
518 | true); | |
519 | } | |
520 | ||
521 | /** | |
522 | * DOCUMENT ME! | |
523 | * | |
524 | * @param string PARAMETER | |
525 | * | |
526 | * @return RETURN | |
527 | * | |
528 | * @todo METHOD_DESCRIPTION | |
529 | */ | |
530 | public int setProjection(String string) | |
531 | { | |
532 | 0 | return MapScriptJNI.mapObj_setProjection(swigCPtr, string); |
533 | } | |
534 | ||
535 | /** | |
536 | * DOCUMENT ME! | |
537 | * | |
538 | * @return RETURN | |
539 | * | |
540 | * @todo METHOD_DESCRIPTION | |
541 | */ | |
542 | public String getProjection() | |
543 | { | |
544 | 0 | return MapScriptJNI.mapObj_getProjection(swigCPtr); |
545 | } | |
546 | ||
547 | /** | |
548 | * DOCUMENT ME! | |
549 | * | |
550 | * @param querymap PARAMETER | |
551 | * | |
552 | * @todo METHOD_DESCRIPTION | |
553 | */ | |
554 | public void setQuerymap(queryMapObj querymap) | |
555 | { | |
556 | 0 | MapScriptJNI.set_mapObj_querymap(swigCPtr, queryMapObj.getCPtr(querymap)); |
557 | 0 | } |
558 | ||
559 | /** | |
560 | * DOCUMENT ME! | |
561 | * | |
562 | * @return RETURN | |
563 | * | |
564 | * @todo METHOD_DESCRIPTION | |
565 | */ | |
566 | public queryMapObj getQuerymap() | |
567 | { | |
568 | 0 | return new queryMapObj(MapScriptJNI.get_mapObj_querymap(swigCPtr), false); |
569 | } | |
570 | ||
571 | /** | |
572 | * DOCUMENT ME! | |
573 | * | |
574 | * @param reference PARAMETER | |
575 | * | |
576 | * @todo METHOD_DESCRIPTION | |
577 | */ | |
578 | public void setReference(referenceMapObj reference) | |
579 | { | |
580 | 0 | MapScriptJNI.set_mapObj_reference(swigCPtr, |
581 | referenceMapObj.getCPtr(reference)); | |
582 | 0 | } |
583 | ||
584 | /** | |
585 | * DOCUMENT ME! | |
586 | * | |
587 | * @return RETURN | |
588 | * | |
589 | * @todo METHOD_DESCRIPTION | |
590 | */ | |
591 | public referenceMapObj getReference() | |
592 | { | |
593 | 0 | return new referenceMapObj(MapScriptJNI.get_mapObj_reference(swigCPtr), |
594 | false); | |
595 | } | |
596 | ||
597 | /** | |
598 | * DOCUMENT ME! | |
599 | * | |
600 | * @param resolution PARAMETER | |
601 | * | |
602 | * @todo METHOD_DESCRIPTION | |
603 | */ | |
604 | public void setResolution(int resolution) | |
605 | { | |
606 | 0 | MapScriptJNI.set_mapObj_resolution(swigCPtr, resolution); |
607 | 0 | } |
608 | ||
609 | /** | |
610 | * DOCUMENT ME! | |
611 | * | |
612 | * @return RETURN | |
613 | * | |
614 | * @todo METHOD_DESCRIPTION | |
615 | */ | |
616 | public int getResolution() | |
617 | { | |
618 | 0 | return MapScriptJNI.get_mapObj_resolution(swigCPtr); |
619 | } | |
620 | ||
621 | /** | |
622 | * DOCUMENT ME! | |
623 | * | |
624 | * @param scale PARAMETER | |
625 | * | |
626 | * @todo METHOD_DESCRIPTION | |
627 | */ | |
628 | public void setScale(double scale) | |
629 | { | |
630 | 0 | MapScriptJNI.set_mapObj_scale(swigCPtr, scale); |
631 | 0 | } |
632 | ||
633 | /** | |
634 | * DOCUMENT ME! | |
635 | * | |
636 | * @return RETURN | |
637 | * | |
638 | * @todo METHOD_DESCRIPTION | |
639 | */ | |
640 | public double getScale() | |
641 | { | |
642 | 0 | return MapScriptJNI.get_mapObj_scale(swigCPtr); |
643 | } | |
644 | ||
645 | /** | |
646 | * DOCUMENT ME! | |
647 | * | |
648 | * @param scalebar PARAMETER | |
649 | * | |
650 | * @todo METHOD_DESCRIPTION | |
651 | */ | |
652 | public void setScalebar(scalebarObj scalebar) | |
653 | { | |
654 | 0 | MapScriptJNI.set_mapObj_scalebar(swigCPtr, scalebarObj.getCPtr(scalebar)); |
655 | 0 | } |
656 | ||
657 | /** | |
658 | * DOCUMENT ME! | |
659 | * | |
660 | * @return RETURN | |
661 | * | |
662 | * @todo METHOD_DESCRIPTION | |
663 | */ | |
664 | public scalebarObj getScalebar() | |
665 | { | |
666 | 0 | return new scalebarObj(MapScriptJNI.get_mapObj_scalebar(swigCPtr), false); |
667 | } | |
668 | ||
669 | /** | |
670 | * DOCUMENT ME! | |
671 | * | |
672 | * @param shapepath PARAMETER | |
673 | * | |
674 | * @todo METHOD_DESCRIPTION | |
675 | */ | |
676 | public void setShapepath(String shapepath) | |
677 | { | |
678 | 0 | MapScriptJNI.set_mapObj_shapepath(swigCPtr, shapepath); |
679 | 0 | } |
680 | ||
681 | /** | |
682 | * DOCUMENT ME! | |
683 | * | |
684 | * @return RETURN | |
685 | * | |
686 | * @todo METHOD_DESCRIPTION | |
687 | */ | |
688 | public String getShapepath() | |
689 | { | |
690 | 0 | return MapScriptJNI.get_mapObj_shapepath(swigCPtr); |
691 | } | |
692 | ||
693 | /** | |
694 | * DOCUMENT ME! | |
695 | * | |
696 | * @param status PARAMETER | |
697 | * | |
698 | * @todo METHOD_DESCRIPTION | |
699 | */ | |
700 | public void setStatus(int status) | |
701 | { | |
702 | 0 | MapScriptJNI.set_mapObj_status(swigCPtr, status); |
703 | 0 | } |
704 | ||
705 | /** | |
706 | * DOCUMENT ME! | |
707 | * | |
708 | * @return RETURN | |
709 | * | |
710 | * @todo METHOD_DESCRIPTION | |
711 | */ | |
712 | public int getStatus() | |
713 | { | |
714 | 0 | return MapScriptJNI.get_mapObj_status(swigCPtr); |
715 | } | |
716 | ||
717 | /** | |
718 | * DOCUMENT ME! | |
719 | * | |
720 | * @param name PARAMETER | |
721 | * | |
722 | * @return RETURN | |
723 | * | |
724 | * @todo METHOD_DESCRIPTION | |
725 | */ | |
726 | public int getSymbolByName(String name) | |
727 | { | |
728 | 0 | return MapScriptJNI.mapObj_getSymbolByName(swigCPtr, name); |
729 | } | |
730 | ||
731 | /** | |
732 | * DOCUMENT ME! | |
733 | * | |
734 | * @param szFileName PARAMETER | |
735 | * | |
736 | * @return RETURN | |
737 | * | |
738 | * @todo METHOD_DESCRIPTION | |
739 | */ | |
740 | public int setSymbolSet(String szFileName) | |
741 | { | |
742 | 0 | return MapScriptJNI.mapObj_setSymbolSet(swigCPtr, szFileName); |
743 | } | |
744 | ||
745 | /** | |
746 | * DOCUMENT ME! | |
747 | * | |
748 | * @param transparent PARAMETER | |
749 | * | |
750 | * @todo METHOD_DESCRIPTION | |
751 | */ | |
752 | public void setTransparent(int transparent) | |
753 | { | |
754 | 0 | MapScriptJNI.set_mapObj_transparent(swigCPtr, transparent); |
755 | 0 | } |
756 | ||
757 | /** | |
758 | * DOCUMENT ME! | |
759 | * | |
760 | * @return RETURN | |
761 | * | |
762 | * @todo METHOD_DESCRIPTION | |
763 | */ | |
764 | public int getTransparent() | |
765 | { | |
766 | 0 | return MapScriptJNI.get_mapObj_transparent(swigCPtr); |
767 | } | |
768 | ||
769 | /** | |
770 | * DOCUMENT ME! | |
771 | * | |
772 | * @param units PARAMETER | |
773 | * | |
774 | * @todo METHOD_DESCRIPTION | |
775 | */ | |
776 | public void setUnits(int units) | |
777 | { | |
778 | 0 | MapScriptJNI.set_mapObj_units(swigCPtr, units); |
779 | 0 | } |
780 | ||
781 | /** | |
782 | * DOCUMENT ME! | |
783 | * | |
784 | * @return RETURN | |
785 | * | |
786 | * @todo METHOD_DESCRIPTION | |
787 | */ | |
788 | public int getUnits() | |
789 | { | |
790 | 0 | return MapScriptJNI.get_mapObj_units(swigCPtr); |
791 | } | |
792 | ||
793 | /** | |
794 | * DOCUMENT ME! | |
795 | * | |
796 | * @param web PARAMETER | |
797 | * | |
798 | * @todo METHOD_DESCRIPTION | |
799 | */ | |
800 | public void setWeb(webObj web) | |
801 | { | |
802 | 0 | MapScriptJNI.set_mapObj_web(swigCPtr, webObj.getCPtr(web)); |
803 | 0 | } |
804 | ||
805 | /** | |
806 | * DOCUMENT ME! | |
807 | * | |
808 | * @return RETURN | |
809 | * | |
810 | * @todo METHOD_DESCRIPTION | |
811 | */ | |
812 | public webObj getWeb() | |
813 | { | |
814 | 0 | return new webObj(MapScriptJNI.get_mapObj_web(swigCPtr), false); |
815 | } | |
816 | ||
817 | /** | |
818 | * DOCUMENT ME! | |
819 | * | |
820 | * @param width PARAMETER | |
821 | * | |
822 | * @todo METHOD_DESCRIPTION | |
823 | */ | |
824 | public void setWidth(int width) | |
825 | { | |
826 | 0 | MapScriptJNI.set_mapObj_width(swigCPtr, width); |
827 | 0 | } |
828 | ||
829 | /** | |
830 | * DOCUMENT ME! | |
831 | * | |
832 | * @return RETURN | |
833 | * | |
834 | * @todo METHOD_DESCRIPTION | |
835 | */ | |
836 | public int getWidth() | |
837 | { | |
838 | 0 | return MapScriptJNI.get_mapObj_width(swigCPtr); |
839 | } | |
840 | ||
841 | /** | |
842 | * DOCUMENT ME! | |
843 | * | |
844 | * @param r PARAMETER | |
845 | * @param g PARAMETER | |
846 | * @param b PARAMETER | |
847 | * | |
848 | * @return RETURN | |
849 | * | |
850 | * @todo METHOD_DESCRIPTION | |
851 | */ | |
852 | public int addColor(int r, int g, int b) | |
853 | { | |
854 | 0 | return MapScriptJNI.mapObj_addColor(swigCPtr, r, g, b); |
855 | } | |
856 | ||
857 | /** | |
858 | * DOCUMENT ME! | |
859 | * | |
860 | * @todo METHOD_DESCRIPTION | |
861 | */ | |
862 | public void delete() | |
863 | { | |
864 | 0 | if ((swigCPtr != 0) && swigCMemOwn) |
865 | { | |
866 | 0 | MapScriptJNI.delete_mapObj(swigCPtr); |
867 | 0 | swigCMemOwn = false; |
868 | } | |
869 | ||
870 | 0 | swigCPtr = 0; |
871 | 0 | } |
872 | ||
873 | /** | |
874 | * DOCUMENT ME! | |
875 | * | |
876 | * @return RETURN | |
877 | * | |
878 | * @todo METHOD_DESCRIPTION | |
879 | */ | |
880 | public imageObj draw() | |
881 | { | |
882 | 0 | return new imageObj(MapScriptJNI.mapObj_draw(swigCPtr), false); |
883 | } | |
884 | ||
885 | /** | |
886 | * DOCUMENT ME! | |
887 | * | |
888 | * @param image PARAMETER | |
889 | * | |
890 | * @return RETURN | |
891 | * | |
892 | * @todo METHOD_DESCRIPTION | |
893 | */ | |
894 | public int drawLabelCache(imageObj image) | |
895 | { | |
896 | 0 | return MapScriptJNI.mapObj_drawLabelCache(swigCPtr, imageObj.getCPtr(image)); |
897 | } | |
898 | ||
899 | /** | |
900 | * DOCUMENT ME! | |
901 | * | |
902 | * @return RETURN | |
903 | * | |
904 | * @todo METHOD_DESCRIPTION | |
905 | */ | |
906 | public imageObj drawLegend() | |
907 | { | |
908 | 0 | return new imageObj(MapScriptJNI.mapObj_drawLegend(swigCPtr), false); |
909 | } | |
910 | ||
911 | /** | |
912 | * DOCUMENT ME! | |
913 | * | |
914 | * @return RETURN | |
915 | * | |
916 | * @todo METHOD_DESCRIPTION | |
917 | */ | |
918 | public imageObj drawQuery() | |
919 | { | |
920 | 0 | return new imageObj(MapScriptJNI.mapObj_drawQuery(swigCPtr), false); |
921 | } | |
922 | ||
923 | /** | |
924 | * DOCUMENT ME! | |
925 | * | |
926 | * @return RETURN | |
927 | * | |
928 | * @todo METHOD_DESCRIPTION | |
929 | */ | |
930 | public imageObj drawReferenceMap() | |
931 | { | |
932 | 0 | return new imageObj(MapScriptJNI.mapObj_drawReferenceMap(swigCPtr), false); |
933 | } | |
934 | ||
935 | /** | |
936 | * DOCUMENT ME! | |
937 | * | |
938 | * @return RETURN | |
939 | * | |
940 | * @todo METHOD_DESCRIPTION | |
941 | */ | |
942 | public imageObj drawScalebar() | |
943 | { | |
944 | 0 | return new imageObj(MapScriptJNI.mapObj_drawScalebar(swigCPtr), false); |
945 | } | |
946 | ||
947 | /** | |
948 | * DOCUMENT ME! | |
949 | * | |
950 | * @param image PARAMETER | |
951 | * | |
952 | * @return RETURN | |
953 | * | |
954 | * @todo METHOD_DESCRIPTION | |
955 | */ | |
956 | public int embedLegend(imageObj image) | |
957 | { | |
958 | 0 | return MapScriptJNI.mapObj_embedLegend(swigCPtr, imageObj.getCPtr(image)); |
959 | } | |
960 | ||
961 | /** | |
962 | * DOCUMENT ME! | |
963 | * | |
964 | * @param image PARAMETER | |
965 | * | |
966 | * @return RETURN | |
967 | * | |
968 | * @todo METHOD_DESCRIPTION | |
969 | */ | |
970 | public int embedScalebar(imageObj image) | |
971 | { | |
972 | 0 | return MapScriptJNI.mapObj_embedScalebar(swigCPtr, imageObj.getCPtr(image)); |
973 | } | |
974 | ||
975 | /** | |
976 | * DOCUMENT ME! | |
977 | * | |
978 | * @param obj PARAMETER | |
979 | * | |
980 | * @return RETURN | |
981 | * | |
982 | * @todo METHOD_DESCRIPTION | |
983 | */ | |
984 | public boolean equals(Object obj) | |
985 | { | |
986 | 0 | boolean equal = false; |
987 | ||
988 | 0 | if (obj instanceof mapObj) |
989 | { | |
990 | 0 | equal = (((mapObj) obj).swigCPtr == this.swigCPtr); |
991 | } | |
992 | ||
993 | 0 | return equal; |
994 | } | |
995 | ||
996 | /** | |
997 | * DOCUMENT ME! | |
998 | * | |
999 | * @return RETURN | |
1000 | * | |
1001 | * @todo METHOD_DESCRIPTION | |
1002 | */ | |
1003 | public int mapObj_getNumSymbols() | |
1004 | { | |
1005 | 0 | return MapScriptJNI.mapObj_mapObj_getNumSymbols(swigCPtr); |
1006 | } | |
1007 | ||
1008 | /** | |
1009 | * DOCUMENT ME! | |
1010 | * | |
1011 | * @param layerindex PARAMETER | |
1012 | * | |
1013 | * @return RETURN | |
1014 | * | |
1015 | * @todo METHOD_DESCRIPTION | |
1016 | */ | |
1017 | public int moveLayerdown(int layerindex) | |
1018 | { | |
1019 | 0 | return MapScriptJNI.mapObj_moveLayerdown(swigCPtr, layerindex); |
1020 | } | |
1021 | ||
1022 | /** | |
1023 | * DOCUMENT ME! | |
1024 | * | |
1025 | * @param layerindex PARAMETER | |
1026 | * | |
1027 | * @return RETURN | |
1028 | * | |
1029 | * @todo METHOD_DESCRIPTION | |
1030 | */ | |
1031 | public int moveLayerup(int layerindex) | |
1032 | { | |
1033 | 0 | return MapScriptJNI.mapObj_moveLayerup(swigCPtr, layerindex); |
1034 | } | |
1035 | ||
1036 | /** | |
1037 | * DOCUMENT ME! | |
1038 | * | |
1039 | * @return RETURN | |
1040 | * | |
1041 | * @todo METHOD_DESCRIPTION | |
1042 | */ | |
1043 | public labelCacheMemberObj nextLabel() | |
1044 | { | |
1045 | 0 | return new labelCacheMemberObj(MapScriptJNI.mapObj_nextLabel(swigCPtr), |
1046 | false); | |
1047 | } | |
1048 | ||
1049 | /** | |
1050 | * DOCUMENT ME! | |
1051 | * | |
1052 | * @return RETURN | |
1053 | * | |
1054 | * @todo METHOD_DESCRIPTION | |
1055 | */ | |
1056 | public imageObj prepareImage() | |
1057 | { | |
1058 | 0 | return new imageObj(MapScriptJNI.mapObj_prepareImage(swigCPtr), false); |
1059 | } | |
1060 | ||
1061 | /** | |
1062 | * DOCUMENT ME! | |
1063 | * | |
1064 | * @todo METHOD_DESCRIPTION | |
1065 | */ | |
1066 | public void prepareQuery() | |
1067 | { | |
1068 | 0 | MapScriptJNI.mapObj_prepareQuery(swigCPtr); |
1069 | 0 | } |
1070 | ||
1071 | /** | |
1072 | * DOCUMENT ME! | |
1073 | * | |
1074 | * @param names PARAMETER | |
1075 | * @param values PARAMETER | |
1076 | * @param numentries PARAMETER | |
1077 | * | |
1078 | * @return RETURN | |
1079 | * | |
1080 | * @todo METHOD_DESCRIPTION | |
1081 | */ | |
1082 | public String processLegendTemplate(SWIGTYPE_p_p_char names, | |
1083 | SWIGTYPE_p_p_char values, int numentries) | |
1084 | { | |
1085 | 0 | return MapScriptJNI.mapObj_processLegendTemplate(swigCPtr, |
1086 | SWIGTYPE_p_p_char.getCPtr(names), SWIGTYPE_p_p_char.getCPtr(values), | |
1087 | numentries); | |
1088 | } | |
1089 | ||
1090 | /** | |
1091 | * DOCUMENT ME! | |
1092 | * | |
1093 | * @param names PARAMETER | |
1094 | * @param values PARAMETER | |
1095 | * @param numentries PARAMETER | |
1096 | * | |
1097 | * @return RETURN | |
1098 | * | |
1099 | * @todo METHOD_DESCRIPTION | |
1100 | */ | |
1101 | public String processQueryTemplate(SWIGTYPE_p_p_char names, | |
1102 | SWIGTYPE_p_p_char values, int numentries) | |
1103 | { | |
1104 | 0 | return MapScriptJNI.mapObj_processQueryTemplate(swigCPtr, |
1105 | SWIGTYPE_p_p_char.getCPtr(names), SWIGTYPE_p_p_char.getCPtr(values), | |
1106 | numentries); | |
1107 | } | |
1108 | ||
1109 | /** | |
1110 | * DOCUMENT ME! | |
1111 | * | |
1112 | * @param bGenerateImages PARAMETER | |
1113 | * @param names PARAMETER | |
1114 | * @param values PARAMETER | |
1115 | * @param numentries PARAMETER | |
1116 | * | |
1117 | * @return RETURN | |
1118 | * | |
1119 | * @todo METHOD_DESCRIPTION | |
1120 | */ | |
1121 | public String processTemplate(int bGenerateImages, SWIGTYPE_p_p_char names, | |
1122 | SWIGTYPE_p_p_char values, int numentries) | |
1123 | { | |
1124 | 0 | return MapScriptJNI.mapObj_processTemplate(swigCPtr, bGenerateImages, |
1125 | SWIGTYPE_p_p_char.getCPtr(names), SWIGTYPE_p_p_char.getCPtr(values), | |
1126 | numentries); | |
1127 | } | |
1128 | ||
1129 | /** | |
1130 | * DOCUMENT ME! | |
1131 | * | |
1132 | * @param slayer PARAMETER | |
1133 | * | |
1134 | * @return RETURN | |
1135 | * | |
1136 | * @todo METHOD_DESCRIPTION | |
1137 | */ | |
1138 | public int queryByFeatures(int slayer) | |
1139 | { | |
1140 | 0 | return MapScriptJNI.mapObj_queryByFeatures(swigCPtr, slayer); |
1141 | } | |
1142 | ||
1143 | /** | |
1144 | * DOCUMENT ME! | |
1145 | * | |
1146 | * @param point PARAMETER | |
1147 | * @param mode PARAMETER | |
1148 | * @param buffer PARAMETER | |
1149 | * | |
1150 | * @return RETURN | |
1151 | * | |
1152 | * @todo METHOD_DESCRIPTION | |
1153 | */ | |
1154 | public int queryByPoint(pointObj point, int mode, double buffer) | |
1155 | { | |
1156 | 0 | return MapScriptJNI.mapObj_queryByPoint(swigCPtr, pointObj.getCPtr(point), |
1157 | mode, buffer); | |
1158 | } | |
1159 | ||
1160 | /** | |
1161 | * DOCUMENT ME! | |
1162 | * | |
1163 | * @param rect PARAMETER | |
1164 | * | |
1165 | * @return RETURN | |
1166 | * | |
1167 | * @todo METHOD_DESCRIPTION | |
1168 | */ | |
1169 | public int queryByRect(rectObj rect) | |
1170 | { | |
1171 | 0 | return MapScriptJNI.mapObj_queryByRect(swigCPtr, rectObj.getCPtr(rect)); |
1172 | } | |
1173 | ||
1174 | /** | |
1175 | * DOCUMENT ME! | |
1176 | * | |
1177 | * @param shape PARAMETER | |
1178 | * | |
1179 | * @return RETURN | |
1180 | * | |
1181 | * @todo METHOD_DESCRIPTION | |
1182 | */ | |
1183 | public int queryByShape(shapeObj shape) | |
1184 | { | |
1185 | 0 | return MapScriptJNI.mapObj_queryByShape(swigCPtr, shapeObj.getCPtr(shape)); |
1186 | } | |
1187 | ||
1188 | /** | |
1189 | * DOCUMENT ME! | |
1190 | * | |
1191 | * @param filename PARAMETER | |
1192 | * | |
1193 | * @return RETURN | |
1194 | * | |
1195 | * @todo METHOD_DESCRIPTION | |
1196 | */ | |
1197 | public int save(String filename) | |
1198 | { | |
1199 | 0 | return MapScriptJNI.mapObj_save(swigCPtr, filename); |
1200 | } | |
1201 | ||
1202 | /** | |
1203 | * DOCUMENT ME! | |
1204 | * | |
1205 | * @param filename PARAMETER | |
1206 | * | |
1207 | * @return RETURN | |
1208 | * | |
1209 | * @todo METHOD_DESCRIPTION | |
1210 | */ | |
1211 | public int saveQuery(String filename) | |
1212 | { | |
1213 | 0 | return MapScriptJNI.mapObj_saveQuery(swigCPtr, filename); |
1214 | } | |
1215 | ||
1216 | /** | |
1217 | * DOCUMENT ME! | |
1218 | * | |
1219 | * @param filename PARAMETER | |
1220 | * | |
1221 | * @return RETURN | |
1222 | * | |
1223 | * @todo METHOD_DESCRIPTION | |
1224 | */ | |
1225 | public int saveQueryAsGML(String filename) | |
1226 | { | |
1227 | 0 | return MapScriptJNI.mapObj_saveQueryAsGML(swigCPtr, filename); |
1228 | } | |
1229 | ||
1230 | /** | |
1231 | * DOCUMENT ME! | |
1232 | * | |
1233 | * @param factor PARAMETER | |
1234 | * @param point PARAMETER | |
1235 | * @param width PARAMETER | |
1236 | * @param height PARAMETER | |
1237 | * @param current PARAMETER | |
1238 | * @param maximum PARAMETER | |
1239 | * | |
1240 | * @todo METHOD | |
1241 | */ | |
1242 | public void zoomPoint(int factor, pointObj point, int width, int height, | |
1243 | rectObj current, rectObj maximum) | |
1244 | { | |
1245 | /* -------------------------------------------------------------------- */ | |
1246 | /* check the validity of the parameters. */ | |
1247 | /* -------------------------------------------------------------------- */ | |
1248 | 0 | if ((factor == 0) || (point == null) || (width <= 0) || (height <= 0) || |
1249 | (current == null) || (maximum == null)) | |
1250 | { | |
1251 | 0 | System.out.println("zoomPoint failed : invald arguments"); |
1252 | ||
1253 | 0 | return; |
1254 | } | |
1255 | ||
1256 | 0 | System.out.println(Double.toString(current.getMinx())); |
1257 | 0 | System.out.println(Double.toString(current.getMaxx())); |
1258 | 0 | System.out.println(Double.toString(current.getMiny())); |
1259 | 0 | System.out.println(Double.toString(current.getMaxy())); |
1260 | ||
1261 | 0 | System.out.println(Double.toString(maximum.getMinx())); |
1262 | 0 | System.out.println(Double.toString(maximum.getMaxx())); |
1263 | 0 | System.out.println(Double.toString(maximum.getMiny())); |
1264 | 0 | System.out.println(Double.toString(maximum.getMaxy())); |
1265 | ||
1266 | /* -------------------------------------------------------------------- */ | |
1267 | /* check if the values passed are consistent min > max. */ | |
1268 | /* -------------------------------------------------------------------- */ | |
1269 | 0 | if (current.getMinx() >= current.getMaxx()) |
1270 | { | |
1271 | 0 | System.out.println( |
1272 | "zoomPoint failed : Georeferenced coordinates minx >= maxx"); | |
1273 | ||
1274 | 0 | return; |
1275 | } | |
1276 | ||
1277 | 0 | if (current.getMiny() >= current.getMaxy()) |
1278 | { | |
1279 | 0 | System.out.println( |
1280 | "zoomPoint failed : Georeferenced coordinates miny >= maxy"); | |
1281 | ||
1282 | 0 | return; |
1283 | } | |
1284 | ||
1285 | 0 | if (maximum.getMinx() >= maximum.getMaxx()) |
1286 | { | |
1287 | 0 | System.out.println( |
1288 | "zoomPoint failed : Max Georeferenced coordinates minx >= maxx"); | |
1289 | } | |
1290 | ||
1291 | 0 | if (maximum.getMiny() >= maximum.getMaxy()) |
1292 | { | |
1293 | 0 | System.out.println( |
1294 | "zoomPoint failed : Max Georeferenced coordinates miny >= maxy"); | |
1295 | } | |
1296 | ||
1297 | 0 | double newMaxScale = MapScript.CalculateScale(maximum, this.getUnits(), |
1298 | width, height, getResolution()); | |
1299 | ||
1300 | 0 | System.out.println("newMaxScale=[" + newMaxScale + "]"); |
1301 | ||
1302 | 0 | webObj web = getWeb(); |
1303 | 0 | web.setMaxscale(newMaxScale); |
1304 | 0 | web.setMinscale(5000); |
1305 | ||
1306 | 0 | int x = (int) point.getX(); |
1307 | 0 | int y = (int) point.getY(); |
1308 | ||
1309 | 0 | System.out.println("x=[" + x + "]"); |
1310 | 0 | System.out.println("width=[" + width + "]"); |
1311 | 0 | System.out.println("current.getMinx()=[" + current.getMinx() + "]"); |
1312 | 0 | System.out.println("current.getMaxx()=[" + current.getMaxx() + "]"); |
1313 | ||
1314 | 0 | System.out.println("y=[" + y + "]"); |
1315 | 0 | System.out.println("height=[" + height + "]"); |
1316 | 0 | System.out.println("current.getMiny()=[" + current.getMiny() + "]"); |
1317 | 0 | System.out.println("current.getMaxy()=[" + current.getMaxy() + "]"); |
1318 | ||
1319 | 0 | double dfGeoPosX = MapScript.Pix2Georef(x, 0, width, current.getMinx(), |
1320 | current.getMaxx(), false); | |
1321 | 0 | double dfGeoPosY = MapScript.Pix2Georef(y, 0, height, current.getMiny(), |
1322 | current.getMaxy(), true); | |
1323 | ||
1324 | 0 | double dfDeltaX = current.getMaxx() - current.getMinx(); |
1325 | 0 | double dfDeltaY = current.getMaxy() - current.getMiny(); |
1326 | ||
1327 | 0 | System.out.println("dfGeoPosX=[" + Double.toString(dfGeoPosX) + "]"); |
1328 | 0 | System.out.println("dfGeoPosY=[" + Double.toString(dfGeoPosY) + "]"); |
1329 | 0 | System.out.println("dfDeltaX=[" + Double.toString(dfDeltaX) + "]"); |
1330 | 0 | System.out.println("dfDeltaY=[" + Double.toString(dfDeltaY) + "]"); |
1331 | ||
1332 | 0 | rectObj newExtents = new rectObj(); |
1333 | ||
1334 | /* -------------------------------------------------------------------- */ | |
1335 | /* zoom in */ | |
1336 | /* -------------------------------------------------------------------- */ | |
1337 | 0 | if (factor > 1) |
1338 | { | |
1339 | 0 | newExtents.setMinx(dfGeoPosX - (dfDeltaX / (2 * factor))); |
1340 | 0 | newExtents.setMiny(dfGeoPosY - (dfDeltaY / (2 * factor))); |
1341 | 0 | newExtents.setMaxx(dfGeoPosX + (dfDeltaX / (2 * factor))); |
1342 | 0 | newExtents.setMaxy(dfGeoPosY + (dfDeltaY / (2 * factor))); |
1343 | } | |
1344 | ||
1345 | /* -------------------------------------------------------------------- */ | |
1346 | /* zoom out */ | |
1347 | /* -------------------------------------------------------------------- */ | |
1348 | 0 | if (factor < 0) |
1349 | { | |
1350 | 0 | newExtents.setMinx(dfGeoPosX - ((dfDeltaX / 2) * (Math.abs(factor)))); |
1351 | 0 | newExtents.setMiny(dfGeoPosY - ((dfDeltaY / 2) * (Math.abs(factor)))); |
1352 | 0 | newExtents.setMaxx(dfGeoPosX + ((dfDeltaX / 2) * (Math.abs(factor)))); |
1353 | 0 | newExtents.setMaxy(dfGeoPosY + ((dfDeltaY / 2) * (Math.abs(factor)))); |
1354 | } | |
1355 | ||
1356 | /* -------------------------------------------------------------------- */ | |
1357 | /* re-center */ | |
1358 | /* -------------------------------------------------------------------- */ | |
1359 | 0 | if (factor == 1) |
1360 | { | |
1361 | 0 | newExtents.setMinx(dfGeoPosX - (dfDeltaX / 2)); |
1362 | 0 | newExtents.setMiny(dfGeoPosY - (dfDeltaY / 2)); |
1363 | 0 | newExtents.setMaxx(dfGeoPosX + (dfDeltaX / 2)); |
1364 | 0 | newExtents.setMaxy(dfGeoPosY + (dfDeltaY / 2)); |
1365 | } | |
1366 | ||
1367 | /* -------------------------------------------------------------------- */ | |
1368 | /* if the min and max scale are set in the map file, we will */ | |
1369 | /* use them to test before zooming. */ | |
1370 | /* -------------------------------------------------------------------- */ | |
1371 | 0 | MapScript.AdjustExtent(newExtents, width, height); |
1372 | ||
1373 | 0 | double newScale = MapScript.CalculateScale(newExtents, this.getUnits(), |
1374 | width, height, getResolution()); | |
1375 | ||
1376 | 0 | double maxScale = web.getMaxscale(); |
1377 | ||
1378 | 0 | System.out.println("factor=[" + factor + "]"); |
1379 | 0 | System.out.println("newScale=[" + Double.toString(newScale) + "]"); |
1380 | 0 | System.out.println("maxScale=[" + Double.toString(maxScale) + "]"); |
1381 | ||
1382 | 0 | if (maxScale > 0) |
1383 | { | |
1384 | 0 | if ((factor < 0) && (newScale > maxScale)) |
1385 | { | |
1386 | 0 | double dfDeltaExt = MapScript.GetDeltaExtentsUsingScale(maxScale, |
1387 | this.getUnits(), width, getResolution()); | |
1388 | ||
1389 | 0 | if (dfDeltaExt > 0.0) |
1390 | { | |
1391 | 0 | newExtents.setMinx(dfGeoPosX - (dfDeltaExt / 2)); |
1392 | 0 | newExtents.setMiny(dfGeoPosY - (dfDeltaExt / 2)); |
1393 | 0 | newExtents.setMaxx(dfGeoPosX + (dfDeltaExt / 2)); |
1394 | 0 | newExtents.setMaxy(dfGeoPosY + (dfDeltaExt / 2)); |
1395 | } | |
1396 | else | |
1397 | { | |
1398 | 0 | return; |
1399 | } | |
1400 | } | |
1401 | } | |
1402 | ||
1403 | /* ==================================================================== */ | |
1404 | /* we do a spcial case for zoom in : we try to zoom as much as */ | |
1405 | /* possible using the mincale set in the .map. */ | |
1406 | /* ==================================================================== */ | |
1407 | 0 | double minScale = web.getMinscale(); |
1408 | ||
1409 | 0 | if ((minScale > 0) && (newScale < minScale) && (factor > 1)) |
1410 | { | |
1411 | 0 | double dfDeltaExt = MapScript.GetDeltaExtentsUsingScale(minScale, |
1412 | this.getUnits(), width, getResolution()); | |
1413 | ||
1414 | 0 | if (dfDeltaExt > 0.0) |
1415 | { | |
1416 | 0 | newExtents.setMinx(dfGeoPosX - (dfDeltaExt / 2)); |
1417 | 0 | newExtents.setMiny(dfGeoPosY - (dfDeltaExt / 2)); |
1418 | 0 | newExtents.setMaxx(dfGeoPosX + (dfDeltaExt / 2)); |
1419 | 0 | newExtents.setMaxy(dfGeoPosY + (dfDeltaExt / 2)); |
1420 | } | |
1421 | else | |
1422 | { | |
1423 | 0 | return; |
1424 | } | |
1425 | } | |
1426 | ||
1427 | /* -------------------------------------------------------------------- */ | |
1428 | /* If the buffer is set, make sure that the extents do not go */ | |
1429 | /* beyond the buffer. */ | |
1430 | /* -------------------------------------------------------------------- */ | |
1431 | 0 | dfDeltaX = newExtents.getMaxx() - newExtents.getMinx(); |
1432 | 0 | dfDeltaY = newExtents.getMaxy() - newExtents.getMiny(); |
1433 | ||
1434 | /* Make sure Current georef extents is not bigger than max extents */ | |
1435 | 0 | if (dfDeltaX > (maximum.getMaxx() - maximum.getMinx())) |
1436 | { | |
1437 | 0 | dfDeltaX = maximum.getMaxx() - maximum.getMinx(); |
1438 | } | |
1439 | ||
1440 | 0 | if (dfDeltaY > (maximum.getMaxy() - maximum.getMiny())) |
1441 | { | |
1442 | 0 | dfDeltaY = maximum.getMaxy() - maximum.getMiny(); |
1443 | } | |
1444 | ||
1445 | 0 | if (newExtents.getMinx() < maximum.getMinx()) |
1446 | { | |
1447 | 0 | newExtents.setMinx(maximum.getMinx()); |
1448 | 0 | newExtents.setMaxx(newExtents.getMinx() + dfDeltaX); |
1449 | } | |
1450 | ||
1451 | 0 | if (newExtents.getMaxx() > maximum.getMaxx()) |
1452 | { | |
1453 | 0 | newExtents.setMaxx(maximum.getMaxx()); |
1454 | 0 | newExtents.setMinx(newExtents.getMaxx() - dfDeltaX); |
1455 | } | |
1456 | ||
1457 | 0 | if (newExtents.getMiny() < maximum.getMiny()) |
1458 | { | |
1459 | 0 | newExtents.setMiny(maximum.getMiny()); |
1460 | 0 | newExtents.setMaxy(newExtents.getMiny() + dfDeltaY); |
1461 | } | |
1462 | ||
1463 | 0 | if (newExtents.getMaxy() > maximum.getMaxy()) |
1464 | { | |
1465 | 0 | newExtents.setMaxy(maximum.getMaxy()); |
1466 | 0 | newExtents.setMiny(newExtents.getMaxy() - dfDeltaY); |
1467 | } | |
1468 | ||
1469 | /* -------------------------------------------------------------------- */ | |
1470 | /* set the map extents with new values. */ | |
1471 | /* -------------------------------------------------------------------- */ | |
1472 | 0 | MapScriptJNI.set_mapObj_extent(swigCPtr, rectObj.getCPtr(newExtents)); |
1473 | 0 | } |
1474 | ||
1475 | /** | |
1476 | * DOCUMENT ME! | |
1477 | * | |
1478 | * @param rectangle PARAMETER | |
1479 | * @param width PARAMETER | |
1480 | * @param height PARAMETER | |
1481 | * @param current PARAMETER | |
1482 | * @param maximum PARAMETER | |
1483 | * | |
1484 | * @todo METHOD | |
1485 | */ | |
1486 | public void zoomRectangle(rectObj rectangle, int width, int height, | |
1487 | rectObj current, rectObj maximum) | |
1488 | { | |
1489 | /* -------------------------------------------------------------------- */ | |
1490 | /* check the validity of the parameters. */ | |
1491 | /* -------------------------------------------------------------------- */ | |
1492 | 0 | if ((rectangle == null) || (width <= 0) || (height <= 0) || |
1493 | (current == null) || (maximum == null)) | |
1494 | { | |
1495 | 0 | System.out.println("zoomRectangle failed : invald arguments"); |
1496 | ||
1497 | 0 | return; |
1498 | } | |
1499 | ||
1500 | /* -------------------------------------------------------------------- */ | |
1501 | /* check if the values passed are consistent min > max. */ | |
1502 | /* -------------------------------------------------------------------- */ | |
1503 | 0 | if (current.getMinx() >= current.getMaxx()) |
1504 | { | |
1505 | 0 | System.out.println( |
1506 | "zoomRectangle failed : Georeferenced coordinates minx >= maxx"); | |
1507 | ||
1508 | 0 | return; |
1509 | } | |
1510 | ||
1511 | 0 | if (current.getMiny() >= current.getMaxy()) |
1512 | { | |
1513 | 0 | System.out.println( |
1514 | "zoomRectangle failed : Georeferenced coordinates miny >= maxy"); | |
1515 | ||
1516 | 0 | return; |
1517 | } | |
1518 | ||
1519 | 0 | if (maximum.getMinx() >= maximum.getMaxx()) |
1520 | { | |
1521 | 0 | System.out.println( |
1522 | "zoomRectangle failed : Max Georeferenced coordinates minx >= maxx"); | |
1523 | } | |
1524 | ||
1525 | 0 | if (maximum.getMiny() >= maximum.getMaxy()) |
1526 | { | |
1527 | 0 | System.out.println( |
1528 | "zoomRectangle failed : Max Georeferenced coordinates miny >= maxy"); | |
1529 | } | |
1530 | ||
1531 | 0 | double newMaxScale = MapScript.CalculateScale(maximum, this.getUnits(), |
1532 | width, height, getResolution()); | |
1533 | ||
1534 | 0 | System.out.println("newMaxScale=[" + newMaxScale + "]"); |
1535 | ||
1536 | 0 | webObj web = getWeb(); |
1537 | 0 | web.setMaxscale(newMaxScale); |
1538 | 0 | web.setMinscale(5000); |
1539 | ||
1540 | 0 | rectObj newExtents = new rectObj(); |
1541 | ||
1542 | 0 | newExtents.setMinx(MapScript.Pix2Georef((int) rectangle.getMinx(), 0, |
1543 | width, current.getMinx(), current.getMaxx(), false)); | |
1544 | 0 | newExtents.setMaxx(MapScript.Pix2Georef((int) rectangle.getMaxx(), 0, |
1545 | width, current.getMinx(), current.getMaxx(), false)); | |
1546 | 0 | newExtents.setMiny(MapScript.Pix2Georef((int) rectangle.getMiny(), 0, |
1547 | height, current.getMiny(), current.getMaxy(), true)); | |
1548 | 0 | newExtents.setMaxy(MapScript.Pix2Georef((int) rectangle.getMaxy(), 0, |
1549 | height, current.getMiny(), current.getMaxy(), true)); | |
1550 | ||
1551 | /* -------------------------------------------------------------------- */ | |
1552 | /* if the min and max scale are set in the map file, we will */ | |
1553 | /* use them to test before setting extents. */ | |
1554 | /* -------------------------------------------------------------------- */ | |
1555 | 0 | MapScript.AdjustExtent(newExtents, width, height); |
1556 | ||
1557 | 0 | double newScale = MapScript.CalculateScale(newExtents, this.getUnits(), |
1558 | width, height, getResolution()); | |
1559 | ||
1560 | 0 | double maxScale = web.getMaxscale(); |
1561 | ||
1562 | 0 | System.out.println("newScale=[" + Double.toString(newScale) + "]"); |
1563 | 0 | System.out.println("maxScale=[" + Double.toString(maxScale) + "]"); |
1564 | ||
1565 | 0 | if ((maxScale > 0) && (newScale > maxScale)) |
1566 | { | |
1567 | 0 | System.out.println("Resizing to maxScale=[" + Double.toString(maxScale) + |
1568 | "]"); | |
1569 | ||
1570 | 0 | double dfDeltaExt = MapScript.GetDeltaExtentsUsingScale(maxScale, |
1571 | this.getUnits(), width, getResolution()); | |
1572 | ||
1573 | 0 | double dfMiddleX = newExtents.getMinx() + |
1574 | ((newExtents.getMaxx() - newExtents.getMinx()) / 2); | |
1575 | 0 | double dfMiddleY = newExtents.getMiny() + |
1576 | ((newExtents.getMaxy() - newExtents.getMiny()) / 2); | |
1577 | ||
1578 | 0 | if (dfDeltaExt > 0.0) |
1579 | { | |
1580 | 0 | newExtents.setMinx(dfMiddleX - (dfDeltaExt / 2)); |
1581 | 0 | newExtents.setMiny(dfMiddleY - (dfDeltaExt / 2)); |
1582 | 0 | newExtents.setMaxx(dfMiddleX + (dfDeltaExt / 2)); |
1583 | 0 | newExtents.setMaxy(dfMiddleY + (dfDeltaExt / 2)); |
1584 | } | |
1585 | else | |
1586 | { | |
1587 | 0 | System.out.println("Oh no..."); |
1588 | ||
1589 | 0 | return; |
1590 | } | |
1591 | } | |
1592 | ||
1593 | 0 | double minScale = web.getMinscale(); |
1594 | ||
1595 | 0 | System.out.println("newScale=[" + Double.toString(newScale) + "]"); |
1596 | 0 | System.out.println("minScale=[" + Double.toString(minScale) + "]"); |
1597 | ||
1598 | 0 | if ((minScale > 0) && (newScale < minScale)) |
1599 | { | |
1600 | 0 | System.out.println("Resizing to minScale=[" + Double.toString(minScale) + |
1601 | "]"); | |
1602 | ||
1603 | 0 | double dfDeltaExt = MapScript.GetDeltaExtentsUsingScale(minScale, |
1604 | this.getUnits(), width, getResolution()); | |
1605 | ||
1606 | 0 | double dfMiddleX = newExtents.getMinx() + |
1607 | ((newExtents.getMaxx() - newExtents.getMinx()) / 2); | |
1608 | 0 | double dfMiddleY = newExtents.getMiny() + |
1609 | ((newExtents.getMaxy() - newExtents.getMiny()) / 2); | |
1610 | ||
1611 | 0 | if (dfDeltaExt > 0.0) |
1612 | { | |
1613 | 0 | newExtents.setMinx(dfMiddleX - (dfDeltaExt / 2)); |
1614 | 0 | newExtents.setMiny(dfMiddleY - (dfDeltaExt / 2)); |
1615 | 0 | newExtents.setMaxx(dfMiddleX + (dfDeltaExt / 2)); |
1616 | 0 | newExtents.setMaxy(dfMiddleY + (dfDeltaExt / 2)); |
1617 | } | |
1618 | else | |
1619 | { | |
1620 | 0 | System.out.println("Oh no..."); |
1621 | ||
1622 | 0 | return; |
1623 | } | |
1624 | } | |
1625 | ||
1626 | /* -------------------------------------------------------------------- */ | |
1627 | /* If the buffer is set, make sure that the extents do not go */ | |
1628 | /* beyond the buffer. */ | |
1629 | /* -------------------------------------------------------------------- */ | |
1630 | 0 | double dfDeltaX = newExtents.getMaxx() - newExtents.getMinx(); |
1631 | 0 | double dfDeltaY = newExtents.getMaxy() - newExtents.getMiny(); |
1632 | ||
1633 | /* Make sure Current georef extents is not bigger than max extents */ | |
1634 | 0 | if (dfDeltaX > (maximum.getMaxx() - maximum.getMinx())) |
1635 | { | |
1636 | 0 | dfDeltaX = maximum.getMaxx() - maximum.getMinx(); |
1637 | } | |
1638 | ||
1639 | 0 | if (dfDeltaY > (maximum.getMaxy() - maximum.getMiny())) |
1640 | { | |
1641 | 0 | dfDeltaY = maximum.getMaxy() - maximum.getMiny(); |
1642 | } | |
1643 | ||
1644 | 0 | if (newExtents.getMinx() < maximum.getMinx()) |
1645 | { | |
1646 | 0 | newExtents.setMinx(maximum.getMinx()); |
1647 | 0 | newExtents.setMaxx(newExtents.getMinx() + dfDeltaX); |
1648 | } | |
1649 | ||
1650 | 0 | if (newExtents.getMaxx() > maximum.getMaxx()) |
1651 | { | |
1652 | 0 | newExtents.setMaxx(maximum.getMaxx()); |
1653 | 0 | newExtents.setMinx(newExtents.getMaxx() - dfDeltaX); |
1654 | } | |
1655 | ||
1656 | 0 | if (newExtents.getMiny() < maximum.getMiny()) |
1657 | { | |
1658 | 0 | newExtents.setMiny(maximum.getMiny()); |
1659 | 0 | newExtents.setMaxy(newExtents.getMiny() + dfDeltaY); |
1660 | } | |
1661 | ||
1662 | 0 | if (newExtents.getMaxy() > maximum.getMaxy()) |
1663 | { | |
1664 | 0 | newExtents.setMaxy(maximum.getMaxy()); |
1665 | 0 | newExtents.setMiny(newExtents.getMaxy() - dfDeltaY); |
1666 | } | |
1667 | ||
1668 | /* -------------------------------------------------------------------- */ | |
1669 | /* set the map extents with new values. */ | |
1670 | /* -------------------------------------------------------------------- */ | |
1671 | 0 | MapScriptJNI.set_mapObj_extent(swigCPtr, rectObj.getCPtr(newExtents)); |
1672 | ||
1673 | 0 | rectObj selfExtents = getExtent(); |
1674 | ||
1675 | 0 | dfDeltaX = selfExtents.getMaxx() - selfExtents.getMinx(); |
1676 | 0 | dfDeltaY = selfExtents.getMaxy() - selfExtents.getMiny(); |
1677 | ||
1678 | 0 | if (selfExtents.getMinx() < maximum.getMinx()) |
1679 | { | |
1680 | 0 | selfExtents.setMinx(maximum.getMinx()); |
1681 | 0 | selfExtents.setMaxx(selfExtents.getMinx() + dfDeltaX); |
1682 | } | |
1683 | ||
1684 | 0 | if (selfExtents.getMaxx() > maximum.getMaxx()) |
1685 | { | |
1686 | 0 | selfExtents.setMaxx(maximum.getMaxx()); |
1687 | 0 | selfExtents.setMinx(selfExtents.getMaxx() - dfDeltaX); |
1688 | } | |
1689 | ||
1690 | 0 | if (selfExtents.getMiny() < maximum.getMiny()) |
1691 | { | |
1692 | 0 | selfExtents.setMiny(maximum.getMiny()); |
1693 | 0 | selfExtents.setMaxy(selfExtents.getMiny() + dfDeltaY); |
1694 | } | |
1695 | ||
1696 | 0 | if (selfExtents.getMaxy() > maximum.getMaxy()) |
1697 | { | |
1698 | 0 | selfExtents.setMaxy(maximum.getMaxy()); |
1699 | 0 | selfExtents.setMiny(selfExtents.getMaxy() - dfDeltaY); |
1700 | } | |
1701 | 0 | } |
1702 | ||
1703 | /** | |
1704 | * DOCUMENT ME! | |
1705 | * | |
1706 | * @param obj PARAMETER | |
1707 | * | |
1708 | * @return RETURN | |
1709 | * | |
1710 | * @todo METHOD_DESCRIPTION | |
1711 | */ | |
1712 | protected static long getCPtr(mapObj obj) | |
1713 | { | |
1714 | 0 | return obj.swigCPtr; |
1715 | } | |
1716 | ||
1717 | /** | |
1718 | * DOCUMENT ME! | |
1719 | * | |
1720 | * @todo METHOD_DESCRIPTION | |
1721 | */ | |
1722 | protected void finalize() | |
1723 | { | |
1724 | 0 | delete(); |
1725 | 0 | } |
1726 | } |
this report was generated by version 1.0.2 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |