|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.Idle
org.gnome.glib.Idle
.
You should be aware that there is a considerably different API
in the new library: the architecture is completely different
and most notably internals are no longer exposed to public view.
public final class Idle
Idle: an object that executes a Fireable
target object's
fire
method at the next available time. Similar to Swing's
invokeLater functionality.
For example, here's how an application clock might be implemented, where the
application passes in an org.gnu.gtk.Label
object as its pane:
private Idle later = new Idle(100, new Fireable() { public boolean fire() { String dateStr = DateFormat.getDateInstance() .format(new Date()); System.out.println("Invoked later!" + dateStr); return true; // continue firing } }); later.start();
Note: an Idle generates events on the application's GUI event queue. It also should only be used to directly fire short/fast methods. Longer methods need to be executed in a separate thread.
Fireable
,
Timer
Constructor Summary | |
---|---|
Idle(Fireable target)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
|
Idle(int priority,
Fireable target)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
Method Summary | |
---|---|
protected void |
finalize()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
int |
getPriority()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
boolean |
isRunning()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
void |
setPriority(int priority)
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
void |
start()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
void |
stop()
Deprecated. Superceeded by java-gnome 4.0; a method along these lines may well exist in the new bindings, but if it does it likely has a different name or signature due to the shift to an algorithmic mapping of the underlying native libraries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Idle(int priority, Fireable target)
priority
- The execution priority of the object, from 0 (highest priority)
to Integer.MAX_VALUE (lowest priority).target
- the object whose fire() method gets called after the specified
time period elapses.
java.lang.IllegalArgumentException
- if less than zero.public Idle(Fireable target)
target
- the object whose fire() method gets called after the specified
time period elapses.
java.lang.IllegalArgumentException
- if less than zero.Method Detail |
---|
public final int getPriority()
public final void setPriority(int priority)
priority
- The execution priority of the object, from 0 (highest priority)
to Integer.MAX_VALUE (lowest priority).
java.lang.IllegalArgumentException
- if less than zero.public final void start()
public final boolean isRunning()
public final void stop()
fire
method returned false
.
protected final void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |