Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

guiUtilities.SwingWorker Class Reference

This is the 3rd version of SwingWorker (also known as SwingWorker 3), an abstract class that you subclass to perform GUI-related work in a dedicated thread. More...

Collaboration diagram for guiUtilities.SwingWorker:

Collaboration graph
[legend]
List of all members.

Public Member Functions

abstract 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.

void interrupt ()
 A new method that interrupts the worker thread.

Object get ()
 Return the value created by the construct method.

 SwingWorker ()
 Start a thread that will call the construct method and then exit.

void start ()
 Start the worker thread.


Protected Member Functions

synchronized Object getValue ()
 Get the value produced by the worker thread, or null if it hasn't been constructed yet.


Private Member Functions

synchronized void setValue (Object x)
 Set the value produced by worker thread.


Private Attributes

Object value
ThreadVar threadVar

Detailed Description

This is the 3rd version of SwingWorker (also known as SwingWorker 3), an abstract class that you subclass to perform GUI-related work in a dedicated thread.

For instructions on and examples of using this class, see:

http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

Note that the API changed slightly in the 3rd version: You must now invoke start() on the SwingWorker after creating it.

Definition at line 16 of file SwingWorker.java.


Member Function Documentation

Object guiUtilities.SwingWorker.get  ) 
 

Return the value created by the construct method.

Returns null if either the constructing thread or the current thread was interrupted before a value was produced.

Returns:
the value created by the construct method

Definition at line 78 of file SwingWorker.java.

References guiUtilities.SwingWorker.ThreadVar.get(), and guiUtilities.SwingWorker.getValue().

Here is the call graph for this function:

void guiUtilities.SwingWorker.interrupt  ) 
 

A new method that interrupts the worker thread.

Call this method to force the worker to stop what it's doing.

Definition at line 63 of file SwingWorker.java.

References guiUtilities.SwingWorker.ThreadVar.clear(), and guiUtilities.SwingWorker.ThreadVar.get().

Here is the call graph for this function:


The documentation for this class was generated from the following file:
Generated on Thu Jul 15 09:56:29 2004 for SCT DAQ/DCS Software - Java by doxygen 1.3.5