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
16public abstract class DottedPolylineMapObject extends MapObject {
24 public abstract boolean setPolyLine(LocationPolyline polyline);
25
36 public abstract boolean setColor(float red, float green, float blue, float alpha);
37
46 public abstract boolean setSize(float width, float height);
47
55 public abstract boolean setCollisionEnabled(boolean enabled);
56
64 public abstract boolean setPlacement(Placement placement);
65
73 public abstract boolean setPlacementMinRatio(float ratio);
74
82 public abstract boolean setPlacementSpacing(float spacing);
83
91 public abstract boolean setRepeatDistance(float distance);
92
100 public abstract boolean setRepeatGroup(int group);
101
109 public abstract boolean setPriority(float priority);
110
111 private static final class CppProxy extends DottedPolylineMapObject
112 {
113 private final long nativeRef;
114 private final AtomicBoolean destroyed = new AtomicBoolean(false);
115
116 private CppProxy(long nativeRef)
117 {
118 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
119 this.nativeRef = nativeRef;
120 }
121
122 private native void nativeDestroy(long nativeRef);
123 public void _djinni_private_destroy()
124 {
125 boolean destroyed = this.destroyed.getAndSet(true);
126 if (!destroyed) nativeDestroy(this.nativeRef);
127 }
128 protected void finalize() throws java.lang.Throwable
129 {
130 _djinni_private_destroy();
131 super.finalize();
132 }
133
134 // DottedPolylineMapObject methods
135
136 @Override
137 public boolean setPolyLine(LocationPolyline polyline)
138 {
139 assert !this.destroyed.get() : "trying to use a destroyed object";
140 return native_setPolyLine(this.nativeRef, polyline);
141 }
142 private native boolean native_setPolyLine(long _nativeRef, LocationPolyline polyline);
143
144 @Override
145 public boolean setColor(float red, float green, float blue, float alpha)
146 {
147 assert !this.destroyed.get() : "trying to use a destroyed object";
148 return native_setColor(this.nativeRef, red, green, blue, alpha);
149 }
150 private native boolean native_setColor(long _nativeRef, float red, float green, float blue, float alpha);
151
152 @Override
153 public boolean setSize(float width, float height)
154 {
155 assert !this.destroyed.get() : "trying to use a destroyed object";
156 return native_setSize(this.nativeRef, width, height);
157 }
158 private native boolean native_setSize(long _nativeRef, float width, float height);
159
160 @Override
161 public boolean setCollisionEnabled(boolean enabled)
162 {
163 assert !this.destroyed.get() : "trying to use a destroyed object";
164 return native_setCollisionEnabled(this.nativeRef, enabled);
165 }
166 private native boolean native_setCollisionEnabled(long _nativeRef, boolean enabled);
167
168 @Override
169 public boolean setPlacement(Placement placement)
170 {
171 assert !this.destroyed.get() : "trying to use a destroyed object";
172 return native_setPlacement(this.nativeRef, placement);
173 }
174 private native boolean native_setPlacement(long _nativeRef, Placement placement);
175
176 @Override
177 public boolean setPlacementMinRatio(float ratio)
178 {
179 assert !this.destroyed.get() : "trying to use a destroyed object";
180 return native_setPlacementMinRatio(this.nativeRef, ratio);
181 }
182 private native boolean native_setPlacementMinRatio(long _nativeRef, float ratio);
183
184 @Override
185 public boolean setPlacementSpacing(float spacing)
186 {
187 assert !this.destroyed.get() : "trying to use a destroyed object";
188 return native_setPlacementSpacing(this.nativeRef, spacing);
189 }
190 private native boolean native_setPlacementSpacing(long _nativeRef, float spacing);
191
192 @Override
193 public boolean setRepeatDistance(float distance)
194 {
195 assert !this.destroyed.get() : "trying to use a destroyed object";
196 return native_setRepeatDistance(this.nativeRef, distance);
197 }
198 private native boolean native_setRepeatDistance(long _nativeRef, float distance);
199
200 @Override
201 public boolean setRepeatGroup(int group)
202 {
203 assert !this.destroyed.get() : "trying to use a destroyed object";
204 return native_setRepeatGroup(this.nativeRef, group);
205 }
206 private native boolean native_setRepeatGroup(long _nativeRef, int group);
207
208 @Override
209 public boolean setPriority(float priority)
210 {
211 assert !this.destroyed.get() : "trying to use a destroyed object";
212 return native_setPriority(this.nativeRef, priority);
213 }
214 private native boolean native_setPriority(long _nativeRef, float priority);
215
216 // MapObject methods
217
218 @Override
219 public int getId()
220 {
221 assert !this.destroyed.get() : "trying to use a destroyed object";
222 return native_getId(this.nativeRef);
223 }
224 private native int native_getId(long _nativeRef);
225
226 @Override
227 public MapObjectType getType()
228 {
229 assert !this.destroyed.get() : "trying to use a destroyed object";
230 return native_getType(this.nativeRef);
231 }
232 private native MapObjectType native_getType(long _nativeRef);
233
234 @Override
235 public byte[] getData()
236 {
237 assert !this.destroyed.get() : "trying to use a destroyed object";
238 return native_getData(this.nativeRef);
239 }
240 private native byte[] native_getData(long _nativeRef);
241
242 @Override
243 public boolean setVisible(boolean visible)
244 {
245 assert !this.destroyed.get() : "trying to use a destroyed object";
246 return native_setVisible(this.nativeRef, visible);
247 }
248 private native boolean native_setVisible(long _nativeRef, boolean visible);
249
250 @Override
251 public boolean setInteractive(boolean interactive)
252 {
253 assert !this.destroyed.get() : "trying to use a destroyed object";
254 return native_setInteractive(this.nativeRef, interactive);
255 }
256 private native boolean native_setInteractive(long _nativeRef, boolean interactive);
257
258 @Override
259 public void setData(byte[] data)
260 {
261 assert !this.destroyed.get() : "trying to use a destroyed object";
262 native_setData(this.nativeRef, data);
263 }
264 private native void native_setData(long _nativeRef, byte[] data);
265
266 @Override
267 public boolean setTitle(String title)
268 {
269 assert !this.destroyed.get() : "trying to use a destroyed object";
270 return native_setTitle(this.nativeRef, title);
271 }
272 private native boolean native_setTitle(long _nativeRef, String title);
273
274 @Override
275 public boolean setAlpha(float alpha)
276 {
277 assert !this.destroyed.get() : "trying to use a destroyed object";
278 return native_setAlpha(this.nativeRef, alpha);
279 }
280 private native boolean native_setAlpha(long _nativeRef, float alpha);
281 }
282}