Loading...
Searching...
No Matches
UserLocationLayer.java
Go to the documentation of this file.
1package com.navigine.idl.java;
2
3import java.util.concurrent.atomic.AtomicBoolean;
4
19public abstract class UserLocationLayer {
33 public abstract void setVisible(boolean visible);
34
48 public abstract boolean isVisible();
49
63 public abstract void setAnchor(android.graphics.PointF anchor);
64
78 public abstract void resetAnchor();
79
93 public abstract boolean anchorEnabled();
94
95 private static final class CppProxy extends UserLocationLayer
96 {
97 private final long nativeRef;
98 private final AtomicBoolean destroyed = new AtomicBoolean(false);
99
100 private CppProxy(long nativeRef)
101 {
102 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
103 this.nativeRef = nativeRef;
104 }
105
106 private native void nativeDestroy(long nativeRef);
107 public void _djinni_private_destroy()
108 {
109 boolean destroyed = this.destroyed.getAndSet(true);
110 if (!destroyed) nativeDestroy(this.nativeRef);
111 }
112 protected void finalize() throws java.lang.Throwable
113 {
114 _djinni_private_destroy();
115 super.finalize();
116 }
117
118 // UserLocationLayer methods
119
120 @Override
121 public void setVisible(boolean visible)
122 {
123 assert !this.destroyed.get() : "trying to use a destroyed object";
124 native_setVisible(this.nativeRef, visible);
125 }
126 private native void native_setVisible(long _nativeRef, boolean visible);
127
128 @Override
129 public boolean isVisible()
130 {
131 assert !this.destroyed.get() : "trying to use a destroyed object";
132 return native_isVisible(this.nativeRef);
133 }
134 private native boolean native_isVisible(long _nativeRef);
135
136 @Override
137 public void setAnchor(android.graphics.PointF anchor)
138 {
139 assert !this.destroyed.get() : "trying to use a destroyed object";
140 native_setAnchor(this.nativeRef, anchor);
141 }
142 private native void native_setAnchor(long _nativeRef, android.graphics.PointF anchor);
143
144 @Override
145 public void resetAnchor()
146 {
147 assert !this.destroyed.get() : "trying to use a destroyed object";
148 native_resetAnchor(this.nativeRef);
149 }
150 private native void native_resetAnchor(long _nativeRef);
151
152 @Override
153 public boolean anchorEnabled()
154 {
155 assert !this.destroyed.get() : "trying to use a destroyed object";
156 return native_anchorEnabled(this.nativeRef);
157 }
158 private native boolean native_anchorEnabled(long _nativeRef);
159 }
160}