69 public abstract void setData(
byte[] data);
78 public abstract boolean setTitle(String title);
89 private static final class CppProxy
extends MapObject
91 private final long nativeRef;
92 private final AtomicBoolean destroyed =
new AtomicBoolean(
false);
94 private CppProxy(
long nativeRef)
96 if (nativeRef == 0)
throw new RuntimeException(
"nativeRef is zero");
97 this.nativeRef = nativeRef;
100 private native
void nativeDestroy(
long nativeRef);
101 public void _djinni_private_destroy()
103 boolean destroyed = this.destroyed.getAndSet(
true);
104 if (!destroyed) nativeDestroy(this.nativeRef);
106 protected void finalize() throws
java.lang.Throwable
108 _djinni_private_destroy();
117 assert !this.destroyed.get() :
"trying to use a destroyed object";
118 return native_getId(this.nativeRef);
120 private native
int native_getId(
long _nativeRef);
125 assert !this.destroyed.get() :
"trying to use a destroyed object";
126 return native_getType(this.nativeRef);
128 private native
MapObjectType native_getType(
long _nativeRef);
131 public byte[] getData()
133 assert !this.destroyed.get() :
"trying to use a destroyed object";
134 return native_getData(this.nativeRef);
136 private native
byte[] native_getData(
long _nativeRef);
139 public boolean setVisible(
boolean visible)
141 assert !this.destroyed.get() :
"trying to use a destroyed object";
142 return native_setVisible(this.nativeRef, visible);
144 private native
boolean native_setVisible(
long _nativeRef,
boolean visible);
147 public boolean setInteractive(
boolean interactive)
149 assert !this.destroyed.get() :
"trying to use a destroyed object";
150 return native_setInteractive(this.nativeRef, interactive);
152 private native
boolean native_setInteractive(
long _nativeRef,
boolean interactive);
155 public void setData(
byte[] data)
157 assert !this.destroyed.get() :
"trying to use a destroyed object";
158 native_setData(this.nativeRef, data);
160 private native
void native_setData(
long _nativeRef,
byte[] data);
163 public boolean setTitle(String title)
165 assert !this.destroyed.get() :
"trying to use a destroyed object";
166 return native_setTitle(this.nativeRef, title);
168 private native
boolean native_setTitle(
long _nativeRef, String title);
171 public boolean setAlpha(
float alpha)
173 assert !this.destroyed.get() :
"trying to use a destroyed object";
174 return native_setAlpha(this.nativeRef, alpha);
176 private native
boolean native_setAlpha(
long _nativeRef,
float alpha);