Loading...
Searching...
No Matches
PolylineMapObject.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.concurrent.atomic.AtomicBoolean;
4
18public abstract class PolylineMapObject extends MapObject {
34 public abstract boolean setPolyLine(LocationPolyline polyline);
35
51 public abstract boolean setWidth(float width);
52
71 public abstract boolean setColor(float red, float green, float blue, float alpha);
72
88 public abstract boolean setOrder(int order);
89
105 public abstract boolean setCapType(CapType cap);
106
122 public abstract boolean setJoinType(JoinType join);
123
139 public abstract boolean setMiterLimit(float miterLimit);
140
159 public abstract boolean setOutlineColor(float red, float green, float blue, float alpha);
160
176 public abstract boolean setOutlineWidth(float radius);
177
193 public abstract boolean setOutlineAlpha(float alpha);
194
210 public abstract boolean setOutlineCapType(CapType cap);
211
227 public abstract boolean setOutlineJoinType(JoinType join);
228
244 public abstract boolean setOutlineMiterLimit(float miterLimit);
245
261 public abstract boolean setOutlineOrder(int order);
262
263 private static final class CppProxy extends PolylineMapObject
264 {
265 private final long nativeRef;
266 private final AtomicBoolean destroyed = new AtomicBoolean(false);
267
268 private CppProxy(long nativeRef)
269 {
270 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
271 this.nativeRef = nativeRef;
272 }
273
274 private native void nativeDestroy(long nativeRef);
275 public void _djinni_private_destroy()
276 {
277 boolean destroyed = this.destroyed.getAndSet(true);
278 if (!destroyed) nativeDestroy(this.nativeRef);
279 }
280 protected void finalize() throws java.lang.Throwable
281 {
282 _djinni_private_destroy();
283 super.finalize();
284 }
285
286 // PolylineMapObject methods
287
288 @Override
289 public boolean setPolyLine(LocationPolyline polyline)
290 {
291 assert !this.destroyed.get() : "trying to use a destroyed object";
292 return native_setPolyLine(this.nativeRef, polyline);
293 }
294 private native boolean native_setPolyLine(long _nativeRef, LocationPolyline polyline);
295
296 @Override
297 public boolean setWidth(float width)
298 {
299 assert !this.destroyed.get() : "trying to use a destroyed object";
300 return native_setWidth(this.nativeRef, width);
301 }
302 private native boolean native_setWidth(long _nativeRef, float width);
303
304 @Override
305 public boolean setColor(float red, float green, float blue, float alpha)
306 {
307 assert !this.destroyed.get() : "trying to use a destroyed object";
308 return native_setColor(this.nativeRef, red, green, blue, alpha);
309 }
310 private native boolean native_setColor(long _nativeRef, float red, float green, float blue, float alpha);
311
312 @Override
313 public boolean setOrder(int order)
314 {
315 assert !this.destroyed.get() : "trying to use a destroyed object";
316 return native_setOrder(this.nativeRef, order);
317 }
318 private native boolean native_setOrder(long _nativeRef, int order);
319
320 @Override
321 public boolean setCapType(CapType cap)
322 {
323 assert !this.destroyed.get() : "trying to use a destroyed object";
324 return native_setCapType(this.nativeRef, cap);
325 }
326 private native boolean native_setCapType(long _nativeRef, CapType cap);
327
328 @Override
329 public boolean setJoinType(JoinType join)
330 {
331 assert !this.destroyed.get() : "trying to use a destroyed object";
332 return native_setJoinType(this.nativeRef, join);
333 }
334 private native boolean native_setJoinType(long _nativeRef, JoinType join);
335
336 @Override
337 public boolean setMiterLimit(float miterLimit)
338 {
339 assert !this.destroyed.get() : "trying to use a destroyed object";
340 return native_setMiterLimit(this.nativeRef, miterLimit);
341 }
342 private native boolean native_setMiterLimit(long _nativeRef, float miterLimit);
343
344 @Override
345 public boolean setOutlineColor(float red, float green, float blue, float alpha)
346 {
347 assert !this.destroyed.get() : "trying to use a destroyed object";
348 return native_setOutlineColor(this.nativeRef, red, green, blue, alpha);
349 }
350 private native boolean native_setOutlineColor(long _nativeRef, float red, float green, float blue, float alpha);
351
352 @Override
353 public boolean setOutlineWidth(float radius)
354 {
355 assert !this.destroyed.get() : "trying to use a destroyed object";
356 return native_setOutlineWidth(this.nativeRef, radius);
357 }
358 private native boolean native_setOutlineWidth(long _nativeRef, float radius);
359
360 @Override
361 public boolean setOutlineAlpha(float alpha)
362 {
363 assert !this.destroyed.get() : "trying to use a destroyed object";
364 return native_setOutlineAlpha(this.nativeRef, alpha);
365 }
366 private native boolean native_setOutlineAlpha(long _nativeRef, float alpha);
367
368 @Override
369 public boolean setOutlineCapType(CapType cap)
370 {
371 assert !this.destroyed.get() : "trying to use a destroyed object";
372 return native_setOutlineCapType(this.nativeRef, cap);
373 }
374 private native boolean native_setOutlineCapType(long _nativeRef, CapType cap);
375
376 @Override
377 public boolean setOutlineJoinType(JoinType join)
378 {
379 assert !this.destroyed.get() : "trying to use a destroyed object";
380 return native_setOutlineJoinType(this.nativeRef, join);
381 }
382 private native boolean native_setOutlineJoinType(long _nativeRef, JoinType join);
383
384 @Override
385 public boolean setOutlineMiterLimit(float miterLimit)
386 {
387 assert !this.destroyed.get() : "trying to use a destroyed object";
388 return native_setOutlineMiterLimit(this.nativeRef, miterLimit);
389 }
390 private native boolean native_setOutlineMiterLimit(long _nativeRef, float miterLimit);
391
392 @Override
393 public boolean setOutlineOrder(int order)
394 {
395 assert !this.destroyed.get() : "trying to use a destroyed object";
396 return native_setOutlineOrder(this.nativeRef, order);
397 }
398 private native boolean native_setOutlineOrder(long _nativeRef, int order);
399
400 // MapObject methods
401
402 @Override
403 public int getId()
404 {
405 assert !this.destroyed.get() : "trying to use a destroyed object";
406 return native_getId(this.nativeRef);
407 }
408 private native int native_getId(long _nativeRef);
409
410 @Override
411 public MapObjectType getType()
412 {
413 assert !this.destroyed.get() : "trying to use a destroyed object";
414 return native_getType(this.nativeRef);
415 }
416 private native MapObjectType native_getType(long _nativeRef);
417
418 @Override
419 public byte[] getData()
420 {
421 assert !this.destroyed.get() : "trying to use a destroyed object";
422 return native_getData(this.nativeRef);
423 }
424 private native byte[] native_getData(long _nativeRef);
425
426 @Override
427 public boolean setVisible(boolean visible)
428 {
429 assert !this.destroyed.get() : "trying to use a destroyed object";
430 return native_setVisible(this.nativeRef, visible);
431 }
432 private native boolean native_setVisible(long _nativeRef, boolean visible);
433
434 @Override
435 public boolean setInteractive(boolean interactive)
436 {
437 assert !this.destroyed.get() : "trying to use a destroyed object";
438 return native_setInteractive(this.nativeRef, interactive);
439 }
440 private native boolean native_setInteractive(long _nativeRef, boolean interactive);
441
442 @Override
443 public void setData(byte[] data)
444 {
445 assert !this.destroyed.get() : "trying to use a destroyed object";
446 native_setData(this.nativeRef, data);
447 }
448 private native void native_setData(long _nativeRef, byte[] data);
449
450 @Override
451 public boolean setTitle(String title)
452 {
453 assert !this.destroyed.get() : "trying to use a destroyed object";
454 return native_setTitle(this.nativeRef, title);
455 }
456 private native boolean native_setTitle(long _nativeRef, String title);
457
458 @Override
459 public boolean setAlpha(float alpha)
460 {
461 assert !this.destroyed.get() : "trying to use a destroyed object";
462 return native_setAlpha(this.nativeRef, alpha);
463 }
464 private native boolean native_setAlpha(long _nativeRef, float alpha);
465 }
466}