|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.Struct
org.gnu.glib.GObject
public class GObject
Base class for all objects that participate in the GLib object system.
Constructor Summary | |
---|---|
GObject(org.gnu.glib.Handle handle)
Create a new GObject with a handle to a native resource returned from a call to the native libraries. |
|
GObject(Type type)
Create a new GObject of the given type. |
Method Summary | |
---|---|
int |
addEventHandler(java.lang.String name,
java.lang.Object cbrecv)
Connect an event to a callback method that has the same name as the event. |
int |
addEventHandler(java.lang.String name,
java.lang.Object cbrecv,
java.lang.Object data)
Connect a event to a callback method that has the same name as the event. |
int |
addEventHandler(java.lang.String name,
java.lang.String func,
java.lang.Class cbrecv)
Connect a event to a static callback method "func" in Class "cbrecv". |
int |
addEventHandler(java.lang.String name,
java.lang.String func,
java.lang.Class cbrecv,
java.lang.Object data)
Connect a event to a static callback method "func" in Class "cbrecv". |
int |
addEventHandler(java.lang.String name,
java.lang.String func,
java.lang.Object cbrecv)
Connect a event to a callback method "func" in object "cbrecv". |
int |
addEventHandler(java.lang.String name,
java.lang.String func,
java.lang.Object cbrecv,
boolean shouldCopyIfBoxed)
Connect a event to a callback method "func" in object "cbrecv". |
int |
addEventHandler(java.lang.String name,
java.lang.String func,
java.lang.Object cbrecv,
java.lang.Object data)
Connect a event to a callback method "func" in object "cbrecv". |
void |
addListener(PropertyNotificationListener listen)
Add a listener that will be activated when a property is updated updated ("notify" signal). |
static void |
collect()
|
void |
freezeNotify()
Stops emission of "notify" signals on object. |
boolean |
getBooleanProperty(java.lang.String name)
Convenience method for retrieving boolean properties. |
java.lang.Object |
getData(java.lang.String key)
Gets the Java Object associated with the given key from this object's object association table. |
double |
getDoubleProperty(java.lang.String name)
Convenience method for retrieving double properties. |
java.lang.Class |
getEventListenerClass(java.lang.String signal)
|
EventType |
getEventType(java.lang.String signal)
|
float |
getFloatProperty(java.lang.String name)
Convenience method for retrieving float properties. |
static GObject |
getGObjectFromHandle(org.gnu.glib.Handle hndl)
Gets a GObject instance for the given Handle. |
int |
getIntProperty(java.lang.String name)
Convenience method for retrieving int properties. |
java.lang.Object |
getJavaObjectProperty(java.lang.String name)
Convenience method for retrieving Object properties. |
long |
getLongProperty(java.lang.String name)
Convenience method for retrieving long properties. |
Pixbuf |
getPixbufProperty(java.lang.String name)
Deprecated. As of libgtk-java 2.8.5, this method has been deprecated in favour of getJavaObjectProperty(String) . Future
major version releases will have this method removed. Please
use with caution. |
Value |
getProperty(java.lang.String name)
Get the Value of the given property (name). |
java.lang.String |
getStringProperty(java.lang.String name)
Convenience method for retrieving String properties. |
boolean |
hasProperty(java.lang.String name)
Determines if this object supports the given named property. |
void |
notify(java.lang.String property_name)
Emits a "notify" signal for the given property. |
void |
removeEventHandler(int handler)
Disconnect a event from its' callback method. |
void |
removeListener(PropertyNotificationListener listen)
Remove the given listener from those activated when a property is updated. |
void |
setBooleanProperty(java.lang.String name,
boolean value)
Convenience method for setting boolean properties. |
void |
setData(java.lang.String key,
java.lang.Object data)
Sets an association from a String to a Java Object to be stored in the GTK object's table of associations. |
void |
setDoubleProperty(java.lang.String name,
double value)
Convenience method for setting double properties. |
void |
setFloatProperty(java.lang.String name,
float value)
Convenience method for setting float properties. |
void |
setIntProperty(java.lang.String name,
int value)
Convenience method for setting int properties. |
void |
setJavaObjectProperty(java.lang.String name,
java.lang.Object value)
Convenience method for setting Object properties. |
void |
setLongProperty(java.lang.String name,
long value)
Convenience method for setting long properties. |
void |
setPixbufProperty(java.lang.String name,
Pixbuf value)
Deprecated. As of libgtk-java 2.8.5, this method has been deprecated in favour of setJavaObjectProperty(String, Object) .
Future major version releases will have this method removed.
Please use with caution. |
void |
setProperty(java.lang.String name,
Value val)
Set the given property (name) with the given Value on this object. |
void |
setStringProperty(java.lang.String name,
java.lang.String value)
Convenience method for setting String properties. |
void |
thawNotify()
Reverts the effect of a previous call to freezeNotify . |
Methods inherited from class org.gnu.glib.Struct |
---|
equals, getHandle, getNullHandle, hashCode |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GObject(Type type)
public GObject(org.gnu.glib.Handle handle)
handle
- The handle that represents a pointer to a native resource.Method Detail |
---|
public int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Object cbrecv)
name
- The name of the event to map.func
- The name of the callback method.cbrecv
- The name of the object that is to recieve the event.
public int addEventHandler(java.lang.String name, java.lang.Object cbrecv)
name
- The name of the event to map.cbrecv
- The name of the object that is to recieve the event.
public int addEventHandler(java.lang.String name, java.lang.Object cbrecv, java.lang.Object data)
name
- The name of the event to map.cbrecv
- The name of the object that is to recieve the event.data
- User defined data that will be passed to the callback.
public int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Object cbrecv, boolean shouldCopyIfBoxed)
name
- The name of the event to map.func
- The name of the callback method.cbrecv
- The name of the object that is to recieve the event.shouldCopyIfBoxed
- Should copy the incoming object associated with the signal.
Only for type Boxed.
public int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Object cbrecv, java.lang.Object data)
name
- The name of the event to map.func
- The name of the callback method.cbrecv
- The name of the object that is to recieve the event.data
- User defined data that will be passed to the callback.
public int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Class cbrecv)
name
- The name of the event to map.func
- The name of the static callback method.cbrecv
- The name of the class that is to recieve the event.
public int addEventHandler(java.lang.String name, java.lang.String func, java.lang.Class cbrecv, java.lang.Object data)
name
- The name of the event to map.func
- The name of the static callback method.cbrecv
- The name of the class that is to recieve the event.data
- User defined data that will be passed to the callback.
public void removeEventHandler(int handler)
handler
- The handler id of the event. This is the value returned from a
call to addEventHandler().public java.lang.Object getData(java.lang.String key)
key
- The association key.
setData(String,Object)
public void setData(java.lang.String key, java.lang.Object data)
key
- The association key.data
- The Java Object to associate with the given key.getData(String)
public java.lang.Class getEventListenerClass(java.lang.String signal)
public EventType getEventType(java.lang.String signal)
public void setProperty(java.lang.String name, Value val)
Value
on this object. If there is a GTK property with this
name, the GTK property will be set. Otherwise, a Java-side property will
be set.
NOTE: Prefer using one of the convenience methods over using this method directly.
name
- The name of the property to set.val
- The value to set in the property.public void setIntProperty(java.lang.String name, int value)
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setStringProperty(java.lang.String name, java.lang.String value)
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setBooleanProperty(java.lang.String name, boolean value)
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setFloatProperty(java.lang.String name, float value)
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setLongProperty(java.lang.String name, long value)
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setDoubleProperty(java.lang.String name, double value)
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setPixbufProperty(java.lang.String name, Pixbuf value)
setJavaObjectProperty(String, Object)
.
Future major version releases will have this method removed.
Please use with caution.
name
- The name of the property to set.value
- The value to set in the property.setProperty( String, Value )
public void setJavaObjectProperty(java.lang.String name, java.lang.Object value)
name
- The name of the property to set.value
- The value to set in the property.public Value getProperty(java.lang.String name)
Value
of the given property (name).
If there is a GTK property with this name, the GTK property will be
retrived. Otherwise, a Java-side property will be returned.
NOTE: Prefer using one of the convenience methods over using this method directly.
name
- The name of the property to retrieve.
public int getIntProperty(java.lang.String name)
name
- The name of the property to retrieve.
public java.lang.String getStringProperty(java.lang.String name)
name
- The name of the property to retrieve.
public boolean getBooleanProperty(java.lang.String name)
name
- The name of the property to retrieve.
public float getFloatProperty(java.lang.String name)
name
- The name of the property to retrieve.
public long getLongProperty(java.lang.String name)
name
- The name of the property to retrieve.
public double getDoubleProperty(java.lang.String name)
name
- The name of the property to retrieve.
public Pixbuf getPixbufProperty(java.lang.String name)
getJavaObjectProperty(String)
. Future
major version releases will have this method removed. Please
use with caution.
name
- The name of the property to retrieve.
public java.lang.Object getJavaObjectProperty(java.lang.String name)
name
- The name of the property to retrieve.
public boolean hasProperty(java.lang.String name)
name
- The property to verify.
public void addListener(PropertyNotificationListener listen)
public void removeListener(PropertyNotificationListener listen)
public void freezeNotify()
thawNotify()
is called.
This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.
public void notify(java.lang.String property_name)
property_name
- The name of a property installed on the class of this object.public void thawNotify()
freezeNotify
. This
causes all queued "notify" signals on object to be emitted.
public static GObject getGObjectFromHandle(org.gnu.glib.Handle hndl)
// Get a Handle from somewhere (typically as a parameter to a method // used as a callback and invoked from the C JNI side). SomeGtkClass finalobj = null; GObject obj = GObject.getGObjectFromHandle(handle); if (obj == null) { finalobj = new SomeGtkClass(handle); } else { finalobj = (SomeGtkClass) obj; }NOTE: This is for internal use only and should never need to be used in application code.
public static final void collect()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |