Class Worker
- java.lang.Object
-
- org.pushingpixels.substance.internal.contrib.randelshofer.quaqua.util.Worker
-
- All Implemented Interfaces:
Runnable
public abstract class Worker extends Object implements Runnable
This is an abstract class that you subclass to perform GUI-related work in a dedicated event dispatcher.This class is similar to SwingWorker but less complex. Like a SwingWorker it can run using an an internal worker thread but it can also be like a Runnable object.
-
-
Constructor Summary
Constructors Constructor Description Worker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Object
construct()
Compute the value to be returned by theget
method.abstract void
finished(Object value)
Called on the event dispatching thread (not on the worker thread) after theconstruct
method has returned.protected Object
getValue()
Get the value produced by the worker thread, or null if it hasn't been constructed yet.void
run()
Calls #construct on the current thread and invokes #finished on the AWT event dispatcher thread.void
start()
Starts the Worker on an internal worker thread.
-
-
-
Method Detail
-
run
public final void run()
Calls #construct on the current thread and invokes #finished on the AWT event dispatcher thread.
-
construct
public abstract Object construct()
Compute the value to be returned by theget
method.
-
finished
public abstract void finished(Object value)
Called on the event dispatching thread (not on the worker thread) after theconstruct
method has returned.- Parameters:
value
- The return value of the construct method.
-
getValue
protected Object getValue()
Get the value produced by the worker thread, or null if it hasn't been constructed yet.
-
start
public void start()
Starts the Worker on an internal worker thread.
-
-