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 {
34 public abstract void setSublocationId(int id);
35
49 public abstract Integer getSublocationId();
50
65 public abstract Camera getEnclosingCamera(BoundingBox boundingBox);
66
82 public abstract Point screenPositionToMeters(android.graphics.PointF point);
83
100 public abstract android.graphics.PointF metersToScreenPosition(Point point, boolean clipToViewport);
101
117
133 public abstract boolean removeCircleMapObject(CircleMapObject circleMapObject);
134
150
166 public abstract boolean removeIconMapObject(IconMapObject iconMapObject);
167
183
199 public abstract boolean removePolygonMapObject(PolygonMapObject polygonMapObject);
200
216
232 public abstract boolean removePolylineMapObject(PolylineMapObject polylineMapObject);
233
249
265 public abstract boolean removeDottedPolylineMapObject(DottedPolylineMapObject dottedPolylineMapObject);
266
280 public abstract void removeAllMapObjects();
281
297 public abstract void pickMapObjectAt(android.graphics.PointF point);
298
314 public abstract void pickMapFeatureAt(android.graphics.PointF point);
315
331 public abstract void addPickListener(PickListener listener);
332
347 public abstract void removePickListener(PickListener listener);
348
364 public abstract void addInputListener(InputListener listener);
365
380 public abstract void removeInputListener(InputListener listener);
381
397 public abstract void addCameraListener(CameraListener listener);
398
413 public abstract void removeCameraListener(CameraListener listener);
414
430
446
463 public abstract void flyTo(Camera camera, int duration, CameraCallback callback);
464
482 public abstract void moveTo(Camera camera, int duration, AnimationType animationType, CameraCallback callback);
483
499 public abstract boolean selectMapFeature(String featureId);
500
516 public abstract boolean deselectMapFeature(String featureId);
517
531 public abstract void deselectAllMapFeatures();
532
540 public abstract void applyFilter(String filter, String layer);
541
556 public abstract float getZoomFactor();
557
572 public abstract void setZoomFactor(float newZoomFactor);
573
587 public abstract float getMinZoomFactor();
588
602 public abstract void setMinZoomFactor(float newMinZoomFactor);
603
617 public abstract float getMaxZoomFactor();
618
632 public abstract void setMaxZoomFactor(float newMaxZoomFactor);
633
648 public abstract boolean getStickToBorder();
649
664 public abstract void setStickToBorder(boolean newStickToBorder);
665
680 public abstract Camera getCamera();
681
696 public abstract void setCamera(Camera newCamera);
697
711 public abstract boolean getRotateGestureEnabled();
712
726 public abstract void setRotateGestureEnabled(boolean newRotateGestureEnabled);
727
741 public abstract boolean getTiltGesturesEnabled();
742
756 public abstract void setTiltGesturesEnabled(boolean newTiltGesturesEnabled);
757
771 public abstract boolean getScrollGesturesEnabled();
772
786 public abstract void setScrollGesturesEnabled(boolean newScrollGesturesEnabled);
787
801 public abstract boolean getZoomGesturesEnabled();
802
816 public abstract void setZoomGesturesEnabled(boolean newZoomGesturesEnabled);
817
832 public abstract float getPickRadius();
833
848 public abstract void setPickRadius(float newPickRadius);
849
863 public abstract ArrayList<String> getSelectedMapFeatures();
864
872 public static void setDebugFlag(DebugFlag flag, boolean on)
873 {
874 CppProxy.setDebugFlag(flag,
875 on);
876 }
877
885 public static boolean getDebugFlag(DebugFlag flag)
886 {
887 return CppProxy.getDebugFlag(flag);
888 }
889
890 private static final class CppProxy extends LocationWindow
891 {
892 private final long nativeRef;
893 private final AtomicBoolean destroyed = new AtomicBoolean(false);
894
895 private CppProxy(long nativeRef)
896 {
897 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
898 this.nativeRef = nativeRef;
899 }
900
901 private native void nativeDestroy(long nativeRef);
902 public void _djinni_private_destroy()
903 {
904 boolean destroyed = this.destroyed.getAndSet(true);
905 if (!destroyed) nativeDestroy(this.nativeRef);
906 }
907 protected void finalize() throws java.lang.Throwable
908 {
909 _djinni_private_destroy();
910 super.finalize();
911 }
912
913 // LocationWindow methods
914
915 @Override
916 public void setSublocationId(int id)
917 {
918 assert !this.destroyed.get() : "trying to use a destroyed object";
919 native_setSublocationId(this.nativeRef, id);
920 }
921 private native void native_setSublocationId(long _nativeRef, int id);
922
923 @Override
924 public Integer getSublocationId()
925 {
926 assert !this.destroyed.get() : "trying to use a destroyed object";
927 return native_getSublocationId(this.nativeRef);
928 }
929 private native Integer native_getSublocationId(long _nativeRef);
930
931 @Override
932 public Camera getEnclosingCamera(BoundingBox boundingBox)
933 {
934 assert !this.destroyed.get() : "trying to use a destroyed object";
935 return native_getEnclosingCamera(this.nativeRef, boundingBox);
936 }
937 private native Camera native_getEnclosingCamera(long _nativeRef, BoundingBox boundingBox);
938
939 @Override
940 public Point screenPositionToMeters(android.graphics.PointF point)
941 {
942 assert !this.destroyed.get() : "trying to use a destroyed object";
943 return native_screenPositionToMeters(this.nativeRef, point);
944 }
945 private native Point native_screenPositionToMeters(long _nativeRef, android.graphics.PointF point);
946
947 @Override
948 public android.graphics.PointF metersToScreenPosition(Point point, boolean clipToViewport)
949 {
950 assert !this.destroyed.get() : "trying to use a destroyed object";
951 return native_metersToScreenPosition(this.nativeRef, point, clipToViewport);
952 }
953 private native android.graphics.PointF native_metersToScreenPosition(long _nativeRef, Point point, boolean clipToViewport);
954
955 @Override
956 public CircleMapObject addCircleMapObject()
957 {
958 assert !this.destroyed.get() : "trying to use a destroyed object";
959 return native_addCircleMapObject(this.nativeRef);
960 }
961 private native CircleMapObject native_addCircleMapObject(long _nativeRef);
962
963 @Override
964 public boolean removeCircleMapObject(CircleMapObject circleMapObject)
965 {
966 assert !this.destroyed.get() : "trying to use a destroyed object";
967 return native_removeCircleMapObject(this.nativeRef, circleMapObject);
968 }
969 private native boolean native_removeCircleMapObject(long _nativeRef, CircleMapObject circleMapObject);
970
971 @Override
972 public IconMapObject addIconMapObject()
973 {
974 assert !this.destroyed.get() : "trying to use a destroyed object";
975 return native_addIconMapObject(this.nativeRef);
976 }
977 private native IconMapObject native_addIconMapObject(long _nativeRef);
978
979 @Override
980 public boolean removeIconMapObject(IconMapObject iconMapObject)
981 {
982 assert !this.destroyed.get() : "trying to use a destroyed object";
983 return native_removeIconMapObject(this.nativeRef, iconMapObject);
984 }
985 private native boolean native_removeIconMapObject(long _nativeRef, IconMapObject iconMapObject);
986
987 @Override
988 public PolygonMapObject addPolygonMapObject()
989 {
990 assert !this.destroyed.get() : "trying to use a destroyed object";
991 return native_addPolygonMapObject(this.nativeRef);
992 }
993 private native PolygonMapObject native_addPolygonMapObject(long _nativeRef);
994
995 @Override
996 public boolean removePolygonMapObject(PolygonMapObject polygonMapObject)
997 {
998 assert !this.destroyed.get() : "trying to use a destroyed object";
999 return native_removePolygonMapObject(this.nativeRef, polygonMapObject);
1000 }
1001 private native boolean native_removePolygonMapObject(long _nativeRef, PolygonMapObject polygonMapObject);
1002
1003 @Override
1004 public PolylineMapObject addPolylineMapObject()
1005 {
1006 assert !this.destroyed.get() : "trying to use a destroyed object";
1007 return native_addPolylineMapObject(this.nativeRef);
1008 }
1009 private native PolylineMapObject native_addPolylineMapObject(long _nativeRef);
1010
1011 @Override
1012 public boolean removePolylineMapObject(PolylineMapObject polylineMapObject)
1013 {
1014 assert !this.destroyed.get() : "trying to use a destroyed object";
1015 return native_removePolylineMapObject(this.nativeRef, polylineMapObject);
1016 }
1017 private native boolean native_removePolylineMapObject(long _nativeRef, PolylineMapObject polylineMapObject);
1018
1019 @Override
1020 public DottedPolylineMapObject addDottedPolylineMapObject()
1021 {
1022 assert !this.destroyed.get() : "trying to use a destroyed object";
1023 return native_addDottedPolylineMapObject(this.nativeRef);
1024 }
1025 private native DottedPolylineMapObject native_addDottedPolylineMapObject(long _nativeRef);
1026
1027 @Override
1028 public boolean removeDottedPolylineMapObject(DottedPolylineMapObject dottedPolylineMapObject)
1029 {
1030 assert !this.destroyed.get() : "trying to use a destroyed object";
1031 return native_removeDottedPolylineMapObject(this.nativeRef, dottedPolylineMapObject);
1032 }
1033 private native boolean native_removeDottedPolylineMapObject(long _nativeRef, DottedPolylineMapObject dottedPolylineMapObject);
1034
1035 @Override
1036 public void removeAllMapObjects()
1037 {
1038 assert !this.destroyed.get() : "trying to use a destroyed object";
1039 native_removeAllMapObjects(this.nativeRef);
1040 }
1041 private native void native_removeAllMapObjects(long _nativeRef);
1042
1043 @Override
1044 public void pickMapObjectAt(android.graphics.PointF point)
1045 {
1046 assert !this.destroyed.get() : "trying to use a destroyed object";
1047 native_pickMapObjectAt(this.nativeRef, point);
1048 }
1049 private native void native_pickMapObjectAt(long _nativeRef, android.graphics.PointF point);
1050
1051 @Override
1052 public void pickMapFeatureAt(android.graphics.PointF point)
1053 {
1054 assert !this.destroyed.get() : "trying to use a destroyed object";
1055 native_pickMapFeatureAt(this.nativeRef, point);
1056 }
1057 private native void native_pickMapFeatureAt(long _nativeRef, android.graphics.PointF point);
1058
1059 @Override
1060 public void addPickListener(PickListener listener)
1061 {
1062 assert !this.destroyed.get() : "trying to use a destroyed object";
1063 native_addPickListener(this.nativeRef, listener);
1064 }
1065 private native void native_addPickListener(long _nativeRef, PickListener listener);
1066
1067 @Override
1068 public void removePickListener(PickListener listener)
1069 {
1070 assert !this.destroyed.get() : "trying to use a destroyed object";
1071 native_removePickListener(this.nativeRef, listener);
1072 }
1073 private native void native_removePickListener(long _nativeRef, PickListener listener);
1074
1075 @Override
1076 public void addInputListener(InputListener listener)
1077 {
1078 assert !this.destroyed.get() : "trying to use a destroyed object";
1079 native_addInputListener(this.nativeRef, listener);
1080 }
1081 private native void native_addInputListener(long _nativeRef, InputListener listener);
1082
1083 @Override
1084 public void removeInputListener(InputListener listener)
1085 {
1086 assert !this.destroyed.get() : "trying to use a destroyed object";
1087 native_removeInputListener(this.nativeRef, listener);
1088 }
1089 private native void native_removeInputListener(long _nativeRef, InputListener listener);
1090
1091 @Override
1092 public void addCameraListener(CameraListener listener)
1093 {
1094 assert !this.destroyed.get() : "trying to use a destroyed object";
1095 native_addCameraListener(this.nativeRef, listener);
1096 }
1097 private native void native_addCameraListener(long _nativeRef, CameraListener listener);
1098
1099 @Override
1100 public void removeCameraListener(CameraListener listener)
1101 {
1102 assert !this.destroyed.get() : "trying to use a destroyed object";
1103 native_removeCameraListener(this.nativeRef, listener);
1104 }
1105 private native void native_removeCameraListener(long _nativeRef, CameraListener listener);
1106
1107 @Override
1108 public void addSublocationChangeListener(SublocationChangeListener listener)
1109 {
1110 assert !this.destroyed.get() : "trying to use a destroyed object";
1111 native_addSublocationChangeListener(this.nativeRef, listener);
1112 }
1113 private native void native_addSublocationChangeListener(long _nativeRef, SublocationChangeListener listener);
1114
1115 @Override
1116 public void removeSublocationChangeListener(SublocationChangeListener listener)
1117 {
1118 assert !this.destroyed.get() : "trying to use a destroyed object";
1119 native_removeSublocationChangeListener(this.nativeRef, listener);
1120 }
1121 private native void native_removeSublocationChangeListener(long _nativeRef, SublocationChangeListener listener);
1122
1123 @Override
1124 public void flyTo(Camera camera, int duration, CameraCallback callback)
1125 {
1126 assert !this.destroyed.get() : "trying to use a destroyed object";
1127 native_flyTo(this.nativeRef, camera, duration, callback);
1128 }
1129 private native void native_flyTo(long _nativeRef, Camera camera, int duration, CameraCallback callback);
1130
1131 @Override
1132 public void moveTo(Camera camera, int duration, AnimationType animationType, CameraCallback callback)
1133 {
1134 assert !this.destroyed.get() : "trying to use a destroyed object";
1135 native_moveTo(this.nativeRef, camera, duration, animationType, callback);
1136 }
1137 private native void native_moveTo(long _nativeRef, Camera camera, int duration, AnimationType animationType, CameraCallback callback);
1138
1139 @Override
1140 public boolean selectMapFeature(String featureId)
1141 {
1142 assert !this.destroyed.get() : "trying to use a destroyed object";
1143 return native_selectMapFeature(this.nativeRef, featureId);
1144 }
1145 private native boolean native_selectMapFeature(long _nativeRef, String featureId);
1146
1147 @Override
1148 public boolean deselectMapFeature(String featureId)
1149 {
1150 assert !this.destroyed.get() : "trying to use a destroyed object";
1151 return native_deselectMapFeature(this.nativeRef, featureId);
1152 }
1153 private native boolean native_deselectMapFeature(long _nativeRef, String featureId);
1154
1155 @Override
1156 public void deselectAllMapFeatures()
1157 {
1158 assert !this.destroyed.get() : "trying to use a destroyed object";
1159 native_deselectAllMapFeatures(this.nativeRef);
1160 }
1161 private native void native_deselectAllMapFeatures(long _nativeRef);
1162
1163 @Override
1164 public void applyFilter(String filter, String layer)
1165 {
1166 assert !this.destroyed.get() : "trying to use a destroyed object";
1167 native_applyFilter(this.nativeRef, filter, layer);
1168 }
1169 private native void native_applyFilter(long _nativeRef, String filter, String layer);
1170
1171 @Override
1172 public float getZoomFactor()
1173 {
1174 assert !this.destroyed.get() : "trying to use a destroyed object";
1175 return native_getZoomFactor(this.nativeRef);
1176 }
1177 private native float native_getZoomFactor(long _nativeRef);
1178
1179 @Override
1180 public void setZoomFactor(float newZoomFactor)
1181 {
1182 assert !this.destroyed.get() : "trying to use a destroyed object";
1183 native_setZoomFactor(this.nativeRef, newZoomFactor);
1184 }
1185 private native void native_setZoomFactor(long _nativeRef, float newZoomFactor);
1186
1187 @Override
1188 public float getMinZoomFactor()
1189 {
1190 assert !this.destroyed.get() : "trying to use a destroyed object";
1191 return native_getMinZoomFactor(this.nativeRef);
1192 }
1193 private native float native_getMinZoomFactor(long _nativeRef);
1194
1195 @Override
1196 public void setMinZoomFactor(float newMinZoomFactor)
1197 {
1198 assert !this.destroyed.get() : "trying to use a destroyed object";
1199 native_setMinZoomFactor(this.nativeRef, newMinZoomFactor);
1200 }
1201 private native void native_setMinZoomFactor(long _nativeRef, float newMinZoomFactor);
1202
1203 @Override
1204 public float getMaxZoomFactor()
1205 {
1206 assert !this.destroyed.get() : "trying to use a destroyed object";
1207 return native_getMaxZoomFactor(this.nativeRef);
1208 }
1209 private native float native_getMaxZoomFactor(long _nativeRef);
1210
1211 @Override
1212 public void setMaxZoomFactor(float newMaxZoomFactor)
1213 {
1214 assert !this.destroyed.get() : "trying to use a destroyed object";
1215 native_setMaxZoomFactor(this.nativeRef, newMaxZoomFactor);
1216 }
1217 private native void native_setMaxZoomFactor(long _nativeRef, float newMaxZoomFactor);
1218
1219 @Override
1220 public boolean getStickToBorder()
1221 {
1222 assert !this.destroyed.get() : "trying to use a destroyed object";
1223 return native_getStickToBorder(this.nativeRef);
1224 }
1225 private native boolean native_getStickToBorder(long _nativeRef);
1226
1227 @Override
1228 public void setStickToBorder(boolean newStickToBorder)
1229 {
1230 assert !this.destroyed.get() : "trying to use a destroyed object";
1231 native_setStickToBorder(this.nativeRef, newStickToBorder);
1232 }
1233 private native void native_setStickToBorder(long _nativeRef, boolean newStickToBorder);
1234
1235 @Override
1236 public Camera getCamera()
1237 {
1238 assert !this.destroyed.get() : "trying to use a destroyed object";
1239 return native_getCamera(this.nativeRef);
1240 }
1241 private native Camera native_getCamera(long _nativeRef);
1242
1243 @Override
1244 public void setCamera(Camera newCamera)
1245 {
1246 assert !this.destroyed.get() : "trying to use a destroyed object";
1247 native_setCamera(this.nativeRef, newCamera);
1248 }
1249 private native void native_setCamera(long _nativeRef, Camera newCamera);
1250
1251 @Override
1252 public boolean getRotateGestureEnabled()
1253 {
1254 assert !this.destroyed.get() : "trying to use a destroyed object";
1255 return native_getRotateGestureEnabled(this.nativeRef);
1256 }
1257 private native boolean native_getRotateGestureEnabled(long _nativeRef);
1258
1259 @Override
1260 public void setRotateGestureEnabled(boolean newRotateGestureEnabled)
1261 {
1262 assert !this.destroyed.get() : "trying to use a destroyed object";
1263 native_setRotateGestureEnabled(this.nativeRef, newRotateGestureEnabled);
1264 }
1265 private native void native_setRotateGestureEnabled(long _nativeRef, boolean newRotateGestureEnabled);
1266
1267 @Override
1268 public boolean getTiltGesturesEnabled()
1269 {
1270 assert !this.destroyed.get() : "trying to use a destroyed object";
1271 return native_getTiltGesturesEnabled(this.nativeRef);
1272 }
1273 private native boolean native_getTiltGesturesEnabled(long _nativeRef);
1274
1275 @Override
1276 public void setTiltGesturesEnabled(boolean newTiltGesturesEnabled)
1277 {
1278 assert !this.destroyed.get() : "trying to use a destroyed object";
1279 native_setTiltGesturesEnabled(this.nativeRef, newTiltGesturesEnabled);
1280 }
1281 private native void native_setTiltGesturesEnabled(long _nativeRef, boolean newTiltGesturesEnabled);
1282
1283 @Override
1284 public boolean getScrollGesturesEnabled()
1285 {
1286 assert !this.destroyed.get() : "trying to use a destroyed object";
1287 return native_getScrollGesturesEnabled(this.nativeRef);
1288 }
1289 private native boolean native_getScrollGesturesEnabled(long _nativeRef);
1290
1291 @Override
1292 public void setScrollGesturesEnabled(boolean newScrollGesturesEnabled)
1293 {
1294 assert !this.destroyed.get() : "trying to use a destroyed object";
1295 native_setScrollGesturesEnabled(this.nativeRef, newScrollGesturesEnabled);
1296 }
1297 private native void native_setScrollGesturesEnabled(long _nativeRef, boolean newScrollGesturesEnabled);
1298
1299 @Override
1300 public boolean getZoomGesturesEnabled()
1301 {
1302 assert !this.destroyed.get() : "trying to use a destroyed object";
1303 return native_getZoomGesturesEnabled(this.nativeRef);
1304 }
1305 private native boolean native_getZoomGesturesEnabled(long _nativeRef);
1306
1307 @Override
1308 public void setZoomGesturesEnabled(boolean newZoomGesturesEnabled)
1309 {
1310 assert !this.destroyed.get() : "trying to use a destroyed object";
1311 native_setZoomGesturesEnabled(this.nativeRef, newZoomGesturesEnabled);
1312 }
1313 private native void native_setZoomGesturesEnabled(long _nativeRef, boolean newZoomGesturesEnabled);
1314
1315 @Override
1316 public float getPickRadius()
1317 {
1318 assert !this.destroyed.get() : "trying to use a destroyed object";
1319 return native_getPickRadius(this.nativeRef);
1320 }
1321 private native float native_getPickRadius(long _nativeRef);
1322
1323 @Override
1324 public void setPickRadius(float newPickRadius)
1325 {
1326 assert !this.destroyed.get() : "trying to use a destroyed object";
1327 native_setPickRadius(this.nativeRef, newPickRadius);
1328 }
1329 private native void native_setPickRadius(long _nativeRef, float newPickRadius);
1330
1331 @Override
1332 public ArrayList<String> getSelectedMapFeatures()
1333 {
1334 assert !this.destroyed.get() : "trying to use a destroyed object";
1335 return native_getSelectedMapFeatures(this.nativeRef);
1336 }
1337 private native ArrayList<String> native_getSelectedMapFeatures(long _nativeRef);
1338
1339 public static native void setDebugFlag(DebugFlag flag, boolean on);
1340
1341 public static native boolean getDebugFlag(DebugFlag flag);
1342 }
1343}