Loading...
Searching...
No Matches
DottedPolylineMapObject.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.concurrent.atomic.AtomicBoolean;
4
18public abstract class DottedPolylineMapObject extends MapObject {
34 public abstract boolean setPolyLine(LocationPolyline polyline);
35
54 public abstract boolean setColor(float red, float green, float blue, float alpha);
55
72 public abstract boolean setSize(float width, float height);
73
89 public abstract boolean setCollisionEnabled(boolean enabled);
90
106 public abstract boolean setPlacement(Placement placement);
107
123 public abstract boolean setPlacementMinRatio(float ratio);
124
140 public abstract boolean setPlacementSpacing(float spacing);
141
157 public abstract boolean setRepeatDistance(float distance);
158
174 public abstract boolean setRepeatGroup(int group);
175
191 public abstract boolean setPriority(float priority);
192
193 private static final class CppProxy extends DottedPolylineMapObject
194 {
195 private final long nativeRef;
196 private final AtomicBoolean destroyed = new AtomicBoolean(false);
197
198 private CppProxy(long nativeRef)
199 {
200 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
201 this.nativeRef = nativeRef;
202 }
203
204 private native void nativeDestroy(long nativeRef);
205 public void _djinni_private_destroy()
206 {
207 boolean destroyed = this.destroyed.getAndSet(true);
208 if (!destroyed) nativeDestroy(this.nativeRef);
209 }
210 protected void finalize() throws java.lang.Throwable
211 {
212 _djinni_private_destroy();
213 super.finalize();
214 }
215
216 // DottedPolylineMapObject methods
217
218 @Override
219 public boolean setPolyLine(LocationPolyline polyline)
220 {
221 assert !this.destroyed.get() : "trying to use a destroyed object";
222 return native_setPolyLine(this.nativeRef, polyline);
223 }
224 private native boolean native_setPolyLine(long _nativeRef, LocationPolyline polyline);
225
226 @Override
227 public boolean setColor(float red, float green, float blue, float alpha)
228 {
229 assert !this.destroyed.get() : "trying to use a destroyed object";
230 return native_setColor(this.nativeRef, red, green, blue, alpha);
231 }
232 private native boolean native_setColor(long _nativeRef, float red, float green, float blue, float alpha);
233
234 @Override
235 public boolean setSize(float width, float height)
236 {
237 assert !this.destroyed.get() : "trying to use a destroyed object";
238 return native_setSize(this.nativeRef, width, height);
239 }
240 private native boolean native_setSize(long _nativeRef, float width, float height);
241
242 @Override
243 public boolean setCollisionEnabled(boolean enabled)
244 {
245 assert !this.destroyed.get() : "trying to use a destroyed object";
246 return native_setCollisionEnabled(this.nativeRef, enabled);
247 }
248 private native boolean native_setCollisionEnabled(long _nativeRef, boolean enabled);
249
250 @Override
251 public boolean setPlacement(Placement placement)
252 {
253 assert !this.destroyed.get() : "trying to use a destroyed object";
254 return native_setPlacement(this.nativeRef, placement);
255 }
256 private native boolean native_setPlacement(long _nativeRef, Placement placement);
257
258 @Override
259 public boolean setPlacementMinRatio(float ratio)
260 {
261 assert !this.destroyed.get() : "trying to use a destroyed object";
262 return native_setPlacementMinRatio(this.nativeRef, ratio);
263 }
264 private native boolean native_setPlacementMinRatio(long _nativeRef, float ratio);
265
266 @Override
267 public boolean setPlacementSpacing(float spacing)
268 {
269 assert !this.destroyed.get() : "trying to use a destroyed object";
270 return native_setPlacementSpacing(this.nativeRef, spacing);
271 }
272 private native boolean native_setPlacementSpacing(long _nativeRef, float spacing);
273
274 @Override
275 public boolean setRepeatDistance(float distance)
276 {
277 assert !this.destroyed.get() : "trying to use a destroyed object";
278 return native_setRepeatDistance(this.nativeRef, distance);
279 }
280 private native boolean native_setRepeatDistance(long _nativeRef, float distance);
281
282 @Override
283 public boolean setRepeatGroup(int group)
284 {
285 assert !this.destroyed.get() : "trying to use a destroyed object";
286 return native_setRepeatGroup(this.nativeRef, group);
287 }
288 private native boolean native_setRepeatGroup(long _nativeRef, int group);
289
290 @Override
291 public boolean setPriority(float priority)
292 {
293 assert !this.destroyed.get() : "trying to use a destroyed object";
294 return native_setPriority(this.nativeRef, priority);
295 }
296 private native boolean native_setPriority(long _nativeRef, float priority);
297
298 // MapObject methods
299
300 @Override
301 public int getId()
302 {
303 assert !this.destroyed.get() : "trying to use a destroyed object";
304 return native_getId(this.nativeRef);
305 }
306 private native int native_getId(long _nativeRef);
307
308 @Override
309 public MapObjectType getType()
310 {
311 assert !this.destroyed.get() : "trying to use a destroyed object";
312 return native_getType(this.nativeRef);
313 }
314 private native MapObjectType native_getType(long _nativeRef);
315
316 @Override
317 public byte[] getData()
318 {
319 assert !this.destroyed.get() : "trying to use a destroyed object";
320 return native_getData(this.nativeRef);
321 }
322 private native byte[] native_getData(long _nativeRef);
323
324 @Override
325 public boolean setVisible(boolean visible)
326 {
327 assert !this.destroyed.get() : "trying to use a destroyed object";
328 return native_setVisible(this.nativeRef, visible);
329 }
330 private native boolean native_setVisible(long _nativeRef, boolean visible);
331
332 @Override
333 public boolean setInteractive(boolean interactive)
334 {
335 assert !this.destroyed.get() : "trying to use a destroyed object";
336 return native_setInteractive(this.nativeRef, interactive);
337 }
338 private native boolean native_setInteractive(long _nativeRef, boolean interactive);
339
340 @Override
341 public void setData(byte[] data)
342 {
343 assert !this.destroyed.get() : "trying to use a destroyed object";
344 native_setData(this.nativeRef, data);
345 }
346 private native void native_setData(long _nativeRef, byte[] data);
347
348 @Override
349 public boolean setTitle(String title)
350 {
351 assert !this.destroyed.get() : "trying to use a destroyed object";
352 return native_setTitle(this.nativeRef, title);
353 }
354 private native boolean native_setTitle(long _nativeRef, String title);
355
356 @Override
357 public boolean setAlpha(float alpha)
358 {
359 assert !this.destroyed.get() : "trying to use a destroyed object";
360 return native_setAlpha(this.nativeRef, alpha);
361 }
362 private native boolean native_setAlpha(long _nativeRef, float alpha);
363 }
364}