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
16public abstract class PolylineMapObject extends MapObject {
24 public abstract boolean setPolyLine(LocationPolyline polyline);
25
33 public abstract boolean setWidth(float width);
34
45 public abstract boolean setColor(float red, float green, float blue, float alpha);
46
54 public abstract boolean setOrder(int order);
55
63 public abstract boolean setCapType(CapType cap);
64
72 public abstract boolean setJoinType(JoinType join);
73
81 public abstract boolean setMiterLimit(float miterLimit);
82
93 public abstract boolean setOutlineColor(float red, float green, float blue, float alpha);
94
102 public abstract boolean setOutlineWidth(float radius);
103
111 public abstract boolean setOutlineAlpha(float alpha);
112
120 public abstract boolean setOutlineCapType(CapType cap);
121
129 public abstract boolean setOutlineJoinType(JoinType join);
130
138 public abstract boolean setOutlineMiterLimit(float miterLimit);
139
147 public abstract boolean setOutlineOrder(int order);
148
149 private static final class CppProxy extends PolylineMapObject
150 {
151 private final long nativeRef;
152 private final AtomicBoolean destroyed = new AtomicBoolean(false);
153
154 private CppProxy(long nativeRef)
155 {
156 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
157 this.nativeRef = nativeRef;
158 }
159
160 private native void nativeDestroy(long nativeRef);
161 public void _djinni_private_destroy()
162 {
163 boolean destroyed = this.destroyed.getAndSet(true);
164 if (!destroyed) nativeDestroy(this.nativeRef);
165 }
166 protected void finalize() throws java.lang.Throwable
167 {
168 _djinni_private_destroy();
169 super.finalize();
170 }
171
172 // PolylineMapObject methods
173
174 @Override
175 public boolean setPolyLine(LocationPolyline polyline)
176 {
177 assert !this.destroyed.get() : "trying to use a destroyed object";
178 return native_setPolyLine(this.nativeRef, polyline);
179 }
180 private native boolean native_setPolyLine(long _nativeRef, LocationPolyline polyline);
181
182 @Override
183 public boolean setWidth(float width)
184 {
185 assert !this.destroyed.get() : "trying to use a destroyed object";
186 return native_setWidth(this.nativeRef, width);
187 }
188 private native boolean native_setWidth(long _nativeRef, float width);
189
190 @Override
191 public boolean setColor(float red, float green, float blue, float alpha)
192 {
193 assert !this.destroyed.get() : "trying to use a destroyed object";
194 return native_setColor(this.nativeRef, red, green, blue, alpha);
195 }
196 private native boolean native_setColor(long _nativeRef, float red, float green, float blue, float alpha);
197
198 @Override
199 public boolean setOrder(int order)
200 {
201 assert !this.destroyed.get() : "trying to use a destroyed object";
202 return native_setOrder(this.nativeRef, order);
203 }
204 private native boolean native_setOrder(long _nativeRef, int order);
205
206 @Override
207 public boolean setCapType(CapType cap)
208 {
209 assert !this.destroyed.get() : "trying to use a destroyed object";
210 return native_setCapType(this.nativeRef, cap);
211 }
212 private native boolean native_setCapType(long _nativeRef, CapType cap);
213
214 @Override
215 public boolean setJoinType(JoinType join)
216 {
217 assert !this.destroyed.get() : "trying to use a destroyed object";
218 return native_setJoinType(this.nativeRef, join);
219 }
220 private native boolean native_setJoinType(long _nativeRef, JoinType join);
221
222 @Override
223 public boolean setMiterLimit(float miterLimit)
224 {
225 assert !this.destroyed.get() : "trying to use a destroyed object";
226 return native_setMiterLimit(this.nativeRef, miterLimit);
227 }
228 private native boolean native_setMiterLimit(long _nativeRef, float miterLimit);
229
230 @Override
231 public boolean setOutlineColor(float red, float green, float blue, float alpha)
232 {
233 assert !this.destroyed.get() : "trying to use a destroyed object";
234 return native_setOutlineColor(this.nativeRef, red, green, blue, alpha);
235 }
236 private native boolean native_setOutlineColor(long _nativeRef, float red, float green, float blue, float alpha);
237
238 @Override
239 public boolean setOutlineWidth(float radius)
240 {
241 assert !this.destroyed.get() : "trying to use a destroyed object";
242 return native_setOutlineWidth(this.nativeRef, radius);
243 }
244 private native boolean native_setOutlineWidth(long _nativeRef, float radius);
245
246 @Override
247 public boolean setOutlineAlpha(float alpha)
248 {
249 assert !this.destroyed.get() : "trying to use a destroyed object";
250 return native_setOutlineAlpha(this.nativeRef, alpha);
251 }
252 private native boolean native_setOutlineAlpha(long _nativeRef, float alpha);
253
254 @Override
255 public boolean setOutlineCapType(CapType cap)
256 {
257 assert !this.destroyed.get() : "trying to use a destroyed object";
258 return native_setOutlineCapType(this.nativeRef, cap);
259 }
260 private native boolean native_setOutlineCapType(long _nativeRef, CapType cap);
261
262 @Override
263 public boolean setOutlineJoinType(JoinType join)
264 {
265 assert !this.destroyed.get() : "trying to use a destroyed object";
266 return native_setOutlineJoinType(this.nativeRef, join);
267 }
268 private native boolean native_setOutlineJoinType(long _nativeRef, JoinType join);
269
270 @Override
271 public boolean setOutlineMiterLimit(float miterLimit)
272 {
273 assert !this.destroyed.get() : "trying to use a destroyed object";
274 return native_setOutlineMiterLimit(this.nativeRef, miterLimit);
275 }
276 private native boolean native_setOutlineMiterLimit(long _nativeRef, float miterLimit);
277
278 @Override
279 public boolean setOutlineOrder(int order)
280 {
281 assert !this.destroyed.get() : "trying to use a destroyed object";
282 return native_setOutlineOrder(this.nativeRef, order);
283 }
284 private native boolean native_setOutlineOrder(long _nativeRef, int order);
285
286 // MapObject methods
287
288 @Override
289 public int getId()
290 {
291 assert !this.destroyed.get() : "trying to use a destroyed object";
292 return native_getId(this.nativeRef);
293 }
294 private native int native_getId(long _nativeRef);
295
296 @Override
297 public MapObjectType getType()
298 {
299 assert !this.destroyed.get() : "trying to use a destroyed object";
300 return native_getType(this.nativeRef);
301 }
302 private native MapObjectType native_getType(long _nativeRef);
303
304 @Override
305 public byte[] getData()
306 {
307 assert !this.destroyed.get() : "trying to use a destroyed object";
308 return native_getData(this.nativeRef);
309 }
310 private native byte[] native_getData(long _nativeRef);
311
312 @Override
313 public boolean setVisible(boolean visible)
314 {
315 assert !this.destroyed.get() : "trying to use a destroyed object";
316 return native_setVisible(this.nativeRef, visible);
317 }
318 private native boolean native_setVisible(long _nativeRef, boolean visible);
319
320 @Override
321 public boolean setInteractive(boolean interactive)
322 {
323 assert !this.destroyed.get() : "trying to use a destroyed object";
324 return native_setInteractive(this.nativeRef, interactive);
325 }
326 private native boolean native_setInteractive(long _nativeRef, boolean interactive);
327
328 @Override
329 public void setData(byte[] data)
330 {
331 assert !this.destroyed.get() : "trying to use a destroyed object";
332 native_setData(this.nativeRef, data);
333 }
334 private native void native_setData(long _nativeRef, byte[] data);
335
336 @Override
337 public boolean setTitle(String title)
338 {
339 assert !this.destroyed.get() : "trying to use a destroyed object";
340 return native_setTitle(this.nativeRef, title);
341 }
342 private native boolean native_setTitle(long _nativeRef, String title);
343
344 @Override
345 public boolean setAlpha(float alpha)
346 {
347 assert !this.destroyed.get() : "trying to use a destroyed object";
348 return native_setAlpha(this.nativeRef, alpha);
349 }
350 private native boolean native_setAlpha(long _nativeRef, float alpha);
351 }
352}