Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.gnu.glib.Idle
public final class Idle
extends java.lang.Object
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.
Constructor Summary | |
Method Summary | |
protected void |
|
int |
|
boolean |
|
void |
|
void |
|
void |
|
public 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.
Create a new Idle object.
- Parameters:
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.
public 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.
Create a new Idle object.
- Parameters:
target
- the object whose fire() method gets called after the specified time period elapses.
protected final void finalize() throws Throwable
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.
Do not call this method; it's only purpose is to ensure that the idle is stopped before it is GC'd.
public final 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.
Returns the execution priority for this Idle.
- Returns:
- the priority of this Idle, from 0 (highest priority) to Integer.MAX_VALUE (lowest priority)
public final 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.
Returns whether this idle is running.
- Returns:
- true if this idle is currently running.
public final 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.
Set the execution priority for this Idle.
- Parameters:
priority
- The execution priority of the object, from 0 (highest priority) to Integer.MAX_VALUE (lowest priority).
public final 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.
Start this Idle object; that is, begin executing its fire method at the available execution slot in the mainloop.
public final 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.
Stop this idle object; that is, stop executing its fire method at its specified interval. This method does not need to be called if thefire
method returnedfalse
.