|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fife.ui.GUIWorkerThread
This is a helper class that will do non-GUI-related work in a separate, dedicated thread, to keep the GUI responsive while doing CPU-heavy tasks.
This class is a direct ripoff of SwingWorker 3.
| Constructor Summary | |
GUIWorkerThread()
Start a thread that will call the construct method
and then exit. |
|
| Method Summary | |
abstract java.lang.Object |
construct()
Compute the value to be returned by the get method. |
void |
finished()
Called on the event dispatching thread (not on the worker thread) after the construct method has returned. |
java.lang.Object |
get()
Return the value created by the construct method.
|
protected java.lang.Object |
getValue()
Get the value produced by the worker thread, or null if it hasn't been constructed yet. |
void |
interrupt()
Call this method to force the worker to stop what it's doing. |
void |
reset()
"Resets" this class so its start method can be called a
second time. |
void |
start()
Start the worker thread. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GUIWorkerThread()
construct method
and then exit. You need to call the start method on
this newly-created worker thread next.
| Method Detail |
public abstract java.lang.Object construct()
get method. This
method should be overridden to do all the CPU-intensive stuff that
you don't want to do in the event dispatch thread.
public void finished()
construct method has returned.
This method should be overridden to do any work with the value
returned from get to prevent deadlock.
public java.lang.Object get()
construct method.
Returns null if either the constructing thread or the current
thread was interrupted before a value was produced.
Note that this method could cause deadlock if it is called outside
of the finished method.
construct method.protected java.lang.Object getValue()
public void interrupt()
public void reset()
start method can be called a
second time. If this thread completes (either normally or after you
call interrupt on it), you must call this method before
calling start again.
public void start()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||