Loading...
Searching...
No Matches
LocationWindow.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.ArrayList;
4import java.util.concurrent.atomic.AtomicBoolean;
5
19public abstract class LocationWindow {
26 public abstract void setSublocationId(int id);
27
35 public abstract Point screenPositionToMeters(android.graphics.PointF point);
36
45 public abstract android.graphics.PointF metersToScreenPosition(Point point, boolean clipToViewport);
46
54
62 public abstract boolean removeCircleMapObject(CircleMapObject circleMapObject);
63
71
79 public abstract boolean removeIconMapObject(IconMapObject iconMapObject);
80
88
96 public abstract boolean removeFlatIconMapObject(FlatIconMapObject flatIconMapObject);
97
105
113 public abstract boolean removePolygonMapObject(PolygonMapObject polygonMapObject);
114
122
130 public abstract boolean removePolylineMapObject(PolylineMapObject polylineMapObject);
131
137 public abstract void removeAllMapObjects();
138
146 public abstract void pickMapObjectAt(android.graphics.PointF point);
147
155 public abstract void pickMapFeatureAt(android.graphics.PointF point);
156
165 public abstract void addPickListener(PickListener listener);
166
173 public abstract void removePickListener(PickListener listener);
174
183 public abstract void addInputListener(InputListener listener);
184
191 public abstract void removeInputListener(InputListener listener);
192
201 public abstract void addCameraListener(CameraListener listener);
202
209 public abstract void removeCameraListener(CameraListener listener);
210
220 public abstract void flyTo(Camera camera, int duration, CameraCallback callback);
221
231 public abstract boolean selectMapFeature(String featureId);
232
242 public abstract boolean deselectMapFeature(String featureId);
243
249 public abstract void deselectAllMapFeatures();
250
254 public abstract void applyFilter(String filter, String layer);
255
269 public abstract void moveTo(Camera camera, int duration, AnimationType animationType, CameraCallback callback);
270
277 public abstract float getZoomFactor();
278
285 public abstract void setZoomFactor(float newZoomFactor);
286
292 public abstract float getMinZoomFactor();
293
299 public abstract void setMinZoomFactor(float newMinZoomFactor);
300
306 public abstract float getMaxZoomFactor();
307
313 public abstract void setMaxZoomFactor(float newMaxZoomFactor);
314
321 public abstract boolean getStickToBorder();
322
329 public abstract void setStickToBorder(boolean newStickToBorder);
330
336 public abstract Camera getCamera();
337
343 public abstract void setCamera(Camera newCamera);
344
350 public abstract boolean getRotateGestureEnabled();
351
357 public abstract void setRotateGestureEnabled(boolean newRotateGestureEnabled);
358
364 public abstract boolean getTiltGesturesEnabled();
365
371 public abstract void setTiltGesturesEnabled(boolean newTiltGesturesEnabled);
372
378 public abstract boolean getScrollGesturesEnabled();
379
385 public abstract void setScrollGesturesEnabled(boolean newScrollGesturesEnabled);
386
392 public abstract boolean getZoomGesturesEnabled();
393
399 public abstract void setZoomGesturesEnabled(boolean newZoomGesturesEnabled);
400
406 public abstract float getPickRadius();
407
413 public abstract void setPickRadius(float newPickRadius);
414
420 public abstract ArrayList<String> getSelectedMapFeatures();
421
422 public static void setDebugFlag(DebugFlag flag, boolean on)
423 {
424 CppProxy.setDebugFlag(flag,
425 on);
426 }
427
428 public static boolean getDebugFlag(DebugFlag flag)
429 {
430 return CppProxy.getDebugFlag(flag);
431 }
432
433 private static final class CppProxy extends LocationWindow
434 {
435 private final long nativeRef;
436 private final AtomicBoolean destroyed = new AtomicBoolean(false);
437
438 private CppProxy(long nativeRef)
439 {
440 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
441 this.nativeRef = nativeRef;
442 }
443
444 private native void nativeDestroy(long nativeRef);
445 public void _djinni_private_destroy()
446 {
447 boolean destroyed = this.destroyed.getAndSet(true);
448 if (!destroyed) nativeDestroy(this.nativeRef);
449 }
450 protected void finalize() throws java.lang.Throwable
451 {
452 _djinni_private_destroy();
453 super.finalize();
454 }
455
456 // LocationWindow methods
457
458 @Override
459 public void setSublocationId(int id)
460 {
461 assert !this.destroyed.get() : "trying to use a destroyed object";
462 native_setSublocationId(this.nativeRef, id);
463 }
464 private native void native_setSublocationId(long _nativeRef, int id);
465
466 @Override
467 public Point screenPositionToMeters(android.graphics.PointF point)
468 {
469 assert !this.destroyed.get() : "trying to use a destroyed object";
470 return native_screenPositionToMeters(this.nativeRef, point);
471 }
472 private native Point native_screenPositionToMeters(long _nativeRef, android.graphics.PointF point);
473
474 @Override
475 public android.graphics.PointF metersToScreenPosition(Point point, boolean clipToViewport)
476 {
477 assert !this.destroyed.get() : "trying to use a destroyed object";
478 return native_metersToScreenPosition(this.nativeRef, point, clipToViewport);
479 }
480 private native android.graphics.PointF native_metersToScreenPosition(long _nativeRef, Point point, boolean clipToViewport);
481
482 @Override
483 public CircleMapObject addCircleMapObject()
484 {
485 assert !this.destroyed.get() : "trying to use a destroyed object";
486 return native_addCircleMapObject(this.nativeRef);
487 }
488 private native CircleMapObject native_addCircleMapObject(long _nativeRef);
489
490 @Override
491 public boolean removeCircleMapObject(CircleMapObject circleMapObject)
492 {
493 assert !this.destroyed.get() : "trying to use a destroyed object";
494 return native_removeCircleMapObject(this.nativeRef, circleMapObject);
495 }
496 private native boolean native_removeCircleMapObject(long _nativeRef, CircleMapObject circleMapObject);
497
498 @Override
499 public IconMapObject addIconMapObject()
500 {
501 assert !this.destroyed.get() : "trying to use a destroyed object";
502 return native_addIconMapObject(this.nativeRef);
503 }
504 private native IconMapObject native_addIconMapObject(long _nativeRef);
505
506 @Override
507 public boolean removeIconMapObject(IconMapObject iconMapObject)
508 {
509 assert !this.destroyed.get() : "trying to use a destroyed object";
510 return native_removeIconMapObject(this.nativeRef, iconMapObject);
511 }
512 private native boolean native_removeIconMapObject(long _nativeRef, IconMapObject iconMapObject);
513
514 @Override
515 public FlatIconMapObject addFlatIconMapObject()
516 {
517 assert !this.destroyed.get() : "trying to use a destroyed object";
518 return native_addFlatIconMapObject(this.nativeRef);
519 }
520 private native FlatIconMapObject native_addFlatIconMapObject(long _nativeRef);
521
522 @Override
523 public boolean removeFlatIconMapObject(FlatIconMapObject flatIconMapObject)
524 {
525 assert !this.destroyed.get() : "trying to use a destroyed object";
526 return native_removeFlatIconMapObject(this.nativeRef, flatIconMapObject);
527 }
528 private native boolean native_removeFlatIconMapObject(long _nativeRef, FlatIconMapObject flatIconMapObject);
529
530 @Override
531 public PolygonMapObject addPolygonMapObject()
532 {
533 assert !this.destroyed.get() : "trying to use a destroyed object";
534 return native_addPolygonMapObject(this.nativeRef);
535 }
536 private native PolygonMapObject native_addPolygonMapObject(long _nativeRef);
537
538 @Override
539 public boolean removePolygonMapObject(PolygonMapObject polygonMapObject)
540 {
541 assert !this.destroyed.get() : "trying to use a destroyed object";
542 return native_removePolygonMapObject(this.nativeRef, polygonMapObject);
543 }
544 private native boolean native_removePolygonMapObject(long _nativeRef, PolygonMapObject polygonMapObject);
545
546 @Override
547 public PolylineMapObject addPolylineMapObject()
548 {
549 assert !this.destroyed.get() : "trying to use a destroyed object";
550 return native_addPolylineMapObject(this.nativeRef);
551 }
552 private native PolylineMapObject native_addPolylineMapObject(long _nativeRef);
553
554 @Override
555 public boolean removePolylineMapObject(PolylineMapObject polylineMapObject)
556 {
557 assert !this.destroyed.get() : "trying to use a destroyed object";
558 return native_removePolylineMapObject(this.nativeRef, polylineMapObject);
559 }
560 private native boolean native_removePolylineMapObject(long _nativeRef, PolylineMapObject polylineMapObject);
561
562 @Override
563 public void removeAllMapObjects()
564 {
565 assert !this.destroyed.get() : "trying to use a destroyed object";
566 native_removeAllMapObjects(this.nativeRef);
567 }
568 private native void native_removeAllMapObjects(long _nativeRef);
569
570 @Override
571 public void pickMapObjectAt(android.graphics.PointF point)
572 {
573 assert !this.destroyed.get() : "trying to use a destroyed object";
574 native_pickMapObjectAt(this.nativeRef, point);
575 }
576 private native void native_pickMapObjectAt(long _nativeRef, android.graphics.PointF point);
577
578 @Override
579 public void pickMapFeatureAt(android.graphics.PointF point)
580 {
581 assert !this.destroyed.get() : "trying to use a destroyed object";
582 native_pickMapFeatureAt(this.nativeRef, point);
583 }
584 private native void native_pickMapFeatureAt(long _nativeRef, android.graphics.PointF point);
585
586 @Override
587 public void addPickListener(PickListener listener)
588 {
589 assert !this.destroyed.get() : "trying to use a destroyed object";
590 native_addPickListener(this.nativeRef, listener);
591 }
592 private native void native_addPickListener(long _nativeRef, PickListener listener);
593
594 @Override
595 public void removePickListener(PickListener listener)
596 {
597 assert !this.destroyed.get() : "trying to use a destroyed object";
598 native_removePickListener(this.nativeRef, listener);
599 }
600 private native void native_removePickListener(long _nativeRef, PickListener listener);
601
602 @Override
603 public void addInputListener(InputListener listener)
604 {
605 assert !this.destroyed.get() : "trying to use a destroyed object";
606 native_addInputListener(this.nativeRef, listener);
607 }
608 private native void native_addInputListener(long _nativeRef, InputListener listener);
609
610 @Override
611 public void removeInputListener(InputListener listener)
612 {
613 assert !this.destroyed.get() : "trying to use a destroyed object";
614 native_removeInputListener(this.nativeRef, listener);
615 }
616 private native void native_removeInputListener(long _nativeRef, InputListener listener);
617
618 @Override
619 public void addCameraListener(CameraListener listener)
620 {
621 assert !this.destroyed.get() : "trying to use a destroyed object";
622 native_addCameraListener(this.nativeRef, listener);
623 }
624 private native void native_addCameraListener(long _nativeRef, CameraListener listener);
625
626 @Override
627 public void removeCameraListener(CameraListener listener)
628 {
629 assert !this.destroyed.get() : "trying to use a destroyed object";
630 native_removeCameraListener(this.nativeRef, listener);
631 }
632 private native void native_removeCameraListener(long _nativeRef, CameraListener listener);
633
634 @Override
635 public void flyTo(Camera camera, int duration, CameraCallback callback)
636 {
637 assert !this.destroyed.get() : "trying to use a destroyed object";
638 native_flyTo(this.nativeRef, camera, duration, callback);
639 }
640 private native void native_flyTo(long _nativeRef, Camera camera, int duration, CameraCallback callback);
641
642 @Override
643 public boolean selectMapFeature(String featureId)
644 {
645 assert !this.destroyed.get() : "trying to use a destroyed object";
646 return native_selectMapFeature(this.nativeRef, featureId);
647 }
648 private native boolean native_selectMapFeature(long _nativeRef, String featureId);
649
650 @Override
651 public boolean deselectMapFeature(String featureId)
652 {
653 assert !this.destroyed.get() : "trying to use a destroyed object";
654 return native_deselectMapFeature(this.nativeRef, featureId);
655 }
656 private native boolean native_deselectMapFeature(long _nativeRef, String featureId);
657
658 @Override
659 public void deselectAllMapFeatures()
660 {
661 assert !this.destroyed.get() : "trying to use a destroyed object";
662 native_deselectAllMapFeatures(this.nativeRef);
663 }
664 private native void native_deselectAllMapFeatures(long _nativeRef);
665
666 @Override
667 public void applyFilter(String filter, String layer)
668 {
669 assert !this.destroyed.get() : "trying to use a destroyed object";
670 native_applyFilter(this.nativeRef, filter, layer);
671 }
672 private native void native_applyFilter(long _nativeRef, String filter, String layer);
673
674 @Override
675 public void moveTo(Camera camera, int duration, AnimationType animationType, CameraCallback callback)
676 {
677 assert !this.destroyed.get() : "trying to use a destroyed object";
678 native_moveTo(this.nativeRef, camera, duration, animationType, callback);
679 }
680 private native void native_moveTo(long _nativeRef, Camera camera, int duration, AnimationType animationType, CameraCallback callback);
681
682 @Override
683 public float getZoomFactor()
684 {
685 assert !this.destroyed.get() : "trying to use a destroyed object";
686 return native_getZoomFactor(this.nativeRef);
687 }
688 private native float native_getZoomFactor(long _nativeRef);
689
690 @Override
691 public void setZoomFactor(float newZoomFactor)
692 {
693 assert !this.destroyed.get() : "trying to use a destroyed object";
694 native_setZoomFactor(this.nativeRef, newZoomFactor);
695 }
696 private native void native_setZoomFactor(long _nativeRef, float newZoomFactor);
697
698 @Override
699 public float getMinZoomFactor()
700 {
701 assert !this.destroyed.get() : "trying to use a destroyed object";
702 return native_getMinZoomFactor(this.nativeRef);
703 }
704 private native float native_getMinZoomFactor(long _nativeRef);
705
706 @Override
707 public void setMinZoomFactor(float newMinZoomFactor)
708 {
709 assert !this.destroyed.get() : "trying to use a destroyed object";
710 native_setMinZoomFactor(this.nativeRef, newMinZoomFactor);
711 }
712 private native void native_setMinZoomFactor(long _nativeRef, float newMinZoomFactor);
713
714 @Override
715 public float getMaxZoomFactor()
716 {
717 assert !this.destroyed.get() : "trying to use a destroyed object";
718 return native_getMaxZoomFactor(this.nativeRef);
719 }
720 private native float native_getMaxZoomFactor(long _nativeRef);
721
722 @Override
723 public void setMaxZoomFactor(float newMaxZoomFactor)
724 {
725 assert !this.destroyed.get() : "trying to use a destroyed object";
726 native_setMaxZoomFactor(this.nativeRef, newMaxZoomFactor);
727 }
728 private native void native_setMaxZoomFactor(long _nativeRef, float newMaxZoomFactor);
729
730 @Override
731 public boolean getStickToBorder()
732 {
733 assert !this.destroyed.get() : "trying to use a destroyed object";
734 return native_getStickToBorder(this.nativeRef);
735 }
736 private native boolean native_getStickToBorder(long _nativeRef);
737
738 @Override
739 public void setStickToBorder(boolean newStickToBorder)
740 {
741 assert !this.destroyed.get() : "trying to use a destroyed object";
742 native_setStickToBorder(this.nativeRef, newStickToBorder);
743 }
744 private native void native_setStickToBorder(long _nativeRef, boolean newStickToBorder);
745
746 @Override
747 public Camera getCamera()
748 {
749 assert !this.destroyed.get() : "trying to use a destroyed object";
750 return native_getCamera(this.nativeRef);
751 }
752 private native Camera native_getCamera(long _nativeRef);
753
754 @Override
755 public void setCamera(Camera newCamera)
756 {
757 assert !this.destroyed.get() : "trying to use a destroyed object";
758 native_setCamera(this.nativeRef, newCamera);
759 }
760 private native void native_setCamera(long _nativeRef, Camera newCamera);
761
762 @Override
763 public boolean getRotateGestureEnabled()
764 {
765 assert !this.destroyed.get() : "trying to use a destroyed object";
766 return native_getRotateGestureEnabled(this.nativeRef);
767 }
768 private native boolean native_getRotateGestureEnabled(long _nativeRef);
769
770 @Override
771 public void setRotateGestureEnabled(boolean newRotateGestureEnabled)
772 {
773 assert !this.destroyed.get() : "trying to use a destroyed object";
774 native_setRotateGestureEnabled(this.nativeRef, newRotateGestureEnabled);
775 }
776 private native void native_setRotateGestureEnabled(long _nativeRef, boolean newRotateGestureEnabled);
777
778 @Override
779 public boolean getTiltGesturesEnabled()
780 {
781 assert !this.destroyed.get() : "trying to use a destroyed object";
782 return native_getTiltGesturesEnabled(this.nativeRef);
783 }
784 private native boolean native_getTiltGesturesEnabled(long _nativeRef);
785
786 @Override
787 public void setTiltGesturesEnabled(boolean newTiltGesturesEnabled)
788 {
789 assert !this.destroyed.get() : "trying to use a destroyed object";
790 native_setTiltGesturesEnabled(this.nativeRef, newTiltGesturesEnabled);
791 }
792 private native void native_setTiltGesturesEnabled(long _nativeRef, boolean newTiltGesturesEnabled);
793
794 @Override
795 public boolean getScrollGesturesEnabled()
796 {
797 assert !this.destroyed.get() : "trying to use a destroyed object";
798 return native_getScrollGesturesEnabled(this.nativeRef);
799 }
800 private native boolean native_getScrollGesturesEnabled(long _nativeRef);
801
802 @Override
803 public void setScrollGesturesEnabled(boolean newScrollGesturesEnabled)
804 {
805 assert !this.destroyed.get() : "trying to use a destroyed object";
806 native_setScrollGesturesEnabled(this.nativeRef, newScrollGesturesEnabled);
807 }
808 private native void native_setScrollGesturesEnabled(long _nativeRef, boolean newScrollGesturesEnabled);
809
810 @Override
811 public boolean getZoomGesturesEnabled()
812 {
813 assert !this.destroyed.get() : "trying to use a destroyed object";
814 return native_getZoomGesturesEnabled(this.nativeRef);
815 }
816 private native boolean native_getZoomGesturesEnabled(long _nativeRef);
817
818 @Override
819 public void setZoomGesturesEnabled(boolean newZoomGesturesEnabled)
820 {
821 assert !this.destroyed.get() : "trying to use a destroyed object";
822 native_setZoomGesturesEnabled(this.nativeRef, newZoomGesturesEnabled);
823 }
824 private native void native_setZoomGesturesEnabled(long _nativeRef, boolean newZoomGesturesEnabled);
825
826 @Override
827 public float getPickRadius()
828 {
829 assert !this.destroyed.get() : "trying to use a destroyed object";
830 return native_getPickRadius(this.nativeRef);
831 }
832 private native float native_getPickRadius(long _nativeRef);
833
834 @Override
835 public void setPickRadius(float newPickRadius)
836 {
837 assert !this.destroyed.get() : "trying to use a destroyed object";
838 native_setPickRadius(this.nativeRef, newPickRadius);
839 }
840 private native void native_setPickRadius(long _nativeRef, float newPickRadius);
841
842 @Override
843 public ArrayList<String> getSelectedMapFeatures()
844 {
845 assert !this.destroyed.get() : "trying to use a destroyed object";
846 return native_getSelectedMapFeatures(this.nativeRef);
847 }
848 private native ArrayList<String> native_getSelectedMapFeatures(long _nativeRef);
849
850 public static native void setDebugFlag(DebugFlag flag, boolean on);
851
852 public static native boolean getDebugFlag(DebugFlag flag);
853 }
854}