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
16public abstract class UserLocationLayer {
30 public abstract void setVisible(boolean visible);
31
45 public abstract boolean isVisible();
46
60 public abstract void setAnchor(android.graphics.PointF anchor);
61
75 public abstract void resetAnchor();
76
90 public abstract boolean anchorEnabled();
91
92 private static final class CppProxy extends UserLocationLayer
93 {
94 private final long nativeRef;
95 private final AtomicBoolean destroyed = new AtomicBoolean(false);
96
97 private CppProxy(long nativeRef)
98 {
99 if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
100 this.nativeRef = nativeRef;
101 }
102
103 private native void nativeDestroy(long nativeRef);
104 public void _djinni_private_destroy()
105 {
106 boolean destroyed = this.destroyed.getAndSet(true);
107 if (!destroyed) nativeDestroy(this.nativeRef);
108 }
109 protected void finalize() throws java.lang.Throwable
110 {
111 _djinni_private_destroy();
112 super.finalize();
113 }
114
115 // UserLocationLayer methods
116
117 @Override
118 public void setVisible(boolean visible)
119 {
120 assert !this.destroyed.get() : "trying to use a destroyed object";
121 native_setVisible(this.nativeRef, visible);
122 }
123 private native void native_setVisible(long _nativeRef, boolean visible);
124
125 @Override
126 public boolean isVisible()
127 {
128 assert !this.destroyed.get() : "trying to use a destroyed object";
129 return native_isVisible(this.nativeRef);
130 }
131 private native boolean native_isVisible(long _nativeRef);
132
133 @Override
134 public void setAnchor(android.graphics.PointF anchor)
135 {
136 assert !this.destroyed.get() : "trying to use a destroyed object";
137 native_setAnchor(this.nativeRef, anchor);
138 }
139 private native void native_setAnchor(long _nativeRef, android.graphics.PointF anchor);
140
141 @Override
142 public void resetAnchor()
143 {
144 assert !this.destroyed.get() : "trying to use a destroyed object";
145 native_resetAnchor(this.nativeRef);
146 }
147 private native void native_resetAnchor(long _nativeRef);
148
149 @Override
150 public boolean anchorEnabled()
151 {
152 assert !this.destroyed.get() : "trying to use a destroyed object";
153 return native_anchorEnabled(this.nativeRef);
154 }
155 private native boolean native_anchorEnabled(long _nativeRef);
156 }
157}