Loading...
Searching...
No Matches
ClusterMapObjectController.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
23public abstract class ClusterMapObjectController {
39 public abstract boolean addIconMapObject(IconMapObject iconMapObject);
40
56 public abstract boolean removeIconMapObject(IconMapObject iconMapObject);
57
71 public abstract void clear();
72
86 public abstract void setEnabled(boolean enabled);
87
101 public abstract boolean isEnabled();
102
116 public abstract void setRadius(float radius);
117
131 public abstract float getRadius();
132
147 public abstract boolean setInteractive(boolean interactive);
148
163 public abstract boolean setClusterSize(float width, float height);
164
179 public abstract void addListener(ClusterMapObjectControllerListener listener);
180
196
210 public abstract ArrayList<ClusterMapObject> getClusters();
211
212 private static final class CppProxy extends ClusterMapObjectController
213 {
214 private final long nativeRef;
215 private final AtomicBoolean destroyed = new AtomicBoolean(false);
216
217 private CppProxy(long nativeRef)
218 {
219 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
220 this.nativeRef = nativeRef;
221 }
222
223 private native void nativeDestroy(long nativeRef);
224 public void _djinni_private_destroy()
225 {
226 boolean destroyed = this.destroyed.getAndSet(true);
227 if (!destroyed) nativeDestroy(this.nativeRef);
228 }
229 protected void finalize() throws java.lang.Throwable
230 {
231 _djinni_private_destroy();
232 super.finalize();
233 }
234
235 // ClusterMapObjectController methods
236
237 @Override
238 public boolean addIconMapObject(IconMapObject iconMapObject)
239 {
240 assert !this.destroyed.get() : "trying to use a destroyed object";
241 return native_addIconMapObject(this.nativeRef, iconMapObject);
242 }
243 private native boolean native_addIconMapObject(long _nativeRef, IconMapObject iconMapObject);
244
245 @Override
246 public boolean removeIconMapObject(IconMapObject iconMapObject)
247 {
248 assert !this.destroyed.get() : "trying to use a destroyed object";
249 return native_removeIconMapObject(this.nativeRef, iconMapObject);
250 }
251 private native boolean native_removeIconMapObject(long _nativeRef, IconMapObject iconMapObject);
252
253 @Override
254 public void clear()
255 {
256 assert !this.destroyed.get() : "trying to use a destroyed object";
257 native_clear(this.nativeRef);
258 }
259 private native void native_clear(long _nativeRef);
260
261 @Override
262 public void setEnabled(boolean enabled)
263 {
264 assert !this.destroyed.get() : "trying to use a destroyed object";
265 native_setEnabled(this.nativeRef, enabled);
266 }
267 private native void native_setEnabled(long _nativeRef, boolean enabled);
268
269 @Override
270 public boolean isEnabled()
271 {
272 assert !this.destroyed.get() : "trying to use a destroyed object";
273 return native_isEnabled(this.nativeRef);
274 }
275 private native boolean native_isEnabled(long _nativeRef);
276
277 @Override
278 public void setRadius(float radius)
279 {
280 assert !this.destroyed.get() : "trying to use a destroyed object";
281 native_setRadius(this.nativeRef, radius);
282 }
283 private native void native_setRadius(long _nativeRef, float radius);
284
285 @Override
286 public float getRadius()
287 {
288 assert !this.destroyed.get() : "trying to use a destroyed object";
289 return native_getRadius(this.nativeRef);
290 }
291 private native float native_getRadius(long _nativeRef);
292
293 @Override
294 public boolean setInteractive(boolean interactive)
295 {
296 assert !this.destroyed.get() : "trying to use a destroyed object";
297 return native_setInteractive(this.nativeRef, interactive);
298 }
299 private native boolean native_setInteractive(long _nativeRef, boolean interactive);
300
301 @Override
302 public boolean setClusterSize(float width, float height)
303 {
304 assert !this.destroyed.get() : "trying to use a destroyed object";
305 return native_setClusterSize(this.nativeRef, width, height);
306 }
307 private native boolean native_setClusterSize(long _nativeRef, float width, float height);
308
309 @Override
310 public void addListener(ClusterMapObjectControllerListener listener)
311 {
312 assert !this.destroyed.get() : "trying to use a destroyed object";
313 native_addListener(this.nativeRef, listener);
314 }
315 private native void native_addListener(long _nativeRef, ClusterMapObjectControllerListener listener);
316
317 @Override
318 public void removeListener(ClusterMapObjectControllerListener listener)
319 {
320 assert !this.destroyed.get() : "trying to use a destroyed object";
321 native_removeListener(this.nativeRef, listener);
322 }
323 private native void native_removeListener(long _nativeRef, ClusterMapObjectControllerListener listener);
324
325 @Override
326 public ArrayList<ClusterMapObject> getClusters()
327 {
328 assert !this.destroyed.get() : "trying to use a destroyed object";
329 return native_getClusters(this.nativeRef);
330 }
331 private native ArrayList<ClusterMapObject> native_getClusters(long _nativeRef);
332 }
333}