|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.GObject
Base class for all objects that participate in the GLib object system.
Field Summary | |
protected boolean |
eventsInitialized
Event initialization marker. |
Constructor Summary | |
protected |
GObject()
Create an uninitialized instance. |
|
GObject(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,
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). |
boolean |
equals(java.lang.Object other)
Check if two objects refer to the same (native) object. |
void |
freezeNotify()
Stops emission of "notify" signals on object. |
boolean |
getBooleanProperty(java.lang.String name)
Convenience method for retrieving boolean properties. |
protected static java.lang.Object |
getData(Handle handle,
java.lang.String key)
|
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(Handle hndl)
Gets a GObject instance for the given Handle. |
Handle |
getHandle()
Get the raw handle value. |
protected static int |
getIntFromHandle(Handle handle)
Return the int to which the native Handle
holds a pointer. |
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. |
static Handle |
getNullHandle()
Get a native handle that refers to a null pointer. |
Pixbuf |
getPixbufProperty(java.lang.String name)
Convenience method for retrieving Pixbuf properties. |
Value |
getProperty(java.lang.String name)
Get the Value of the given property
(name). |
protected static java.lang.String |
getStringFromHandle(Handle handle)
Return the String to which the native Handle
holds a pointer. |
java.lang.String |
getStringProperty(java.lang.String name)
Convenience method for retrieving String properties. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
hasProperty(java.lang.String name)
Determines if this object supports the given named property. |
protected static java.lang.Object |
instantiateJGObjectFromGType(int type,
Handle handle)
|
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. |
protected GObject |
retrieveGObject(Handle hndl)
Deprecated. This method is deprecated in favor of getGObjectFromHandle(org.gnu.glib.Handle) . |
void |
setBooleanProperty(java.lang.String name,
boolean value)
Convenience method for setting boolean properties. |
protected static void |
setData(Handle handle,
java.lang.String key,
java.lang.Object data)
|
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. |
protected void |
setHandle(Handle hndl)
Sets this object's native handle. |
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)
Convenience method for setting Pixbuf properties. |
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 java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean eventsInitialized
Constructor Detail |
protected GObject()
public GObject(Type type)
public GObject(Handle handle)
handle
- The handle that represents a pointer to a native resource.Method Detail |
public final Handle getHandle()
public boolean equals(java.lang.Object other)
other
- the reference object with which to compare.
public int hashCode()
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)
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.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)
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)
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.
protected void setHandle(Handle hndl)
protected GObject retrieveGObject(Handle hndl)
getGObjectFromHandle(org.gnu.glib.Handle)
.
getGObjectFromHandle(org.gnu.glib.Handle)
public static GObject getGObjectFromHandle(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 Handle getNullHandle()
protected static final java.lang.Object getData(Handle handle, java.lang.String key)
protected static final void setData(Handle handle, java.lang.String key, java.lang.Object data)
protected static final java.lang.Object instantiateJGObjectFromGType(int type, Handle handle)
protected static final int getIntFromHandle(Handle handle)
Handle
holds a pointer. The native Handle is assumed to hold a C
pointer to an int ( gint* ). This method dereferences that
pointer and returns the value to which it points as an integer.
handle
- The native Handle holding a pointer to an int.
protected static final java.lang.String getStringFromHandle(Handle handle)
Handle
holds a pointer. The native Handle is assumed to hold a C
pointer to a String (char* ). This method dereferences that
pointer and returns the value to which it points as a String.
handle
- The native Handle holding a pointer to a String.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |