Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.services.util

Class SwingWorker

com.gentleware.services.util.SwingWorker

public abstract class SwingWorker


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


 Inner Classifier Summary
private static   SwingWorker.ThreadVar
Class to maintain reference to current worker thread under separate synchronization control. 
arrow_up
 

 Attribute Summary
private Exception  _exception
 
private Object  _result
 
arrow_up
 

 Association Summary
private ThreadVar  _threadVar
 
arrow_up
 

 Constructor Summary
public   SwingWorker(String threadName)
Start a thread that will call the construct method and then exit. 
arrow_up
 

 Method Summary
public Object   construct()
Compute the result to be returned by the get method. 
protected void   excepted(Exception e)
Called on the event dispatching thread (not on the worker thread) when the construct method has thrown an exception. 
public void   finished()
Called on the event dispatching thread (not on the worker thread) after the construct method has returned normally. 
public Object   get()
Return the result created by the construct method. 
private Exception   getException()
Get the exception thrown by worker thread, or null if it hasn't been constructed yet, or finished normally  
private Object   getResult()
Get the result produced by the worker thread, or null if it hasn't been constructed yet. 
public Thread   getWorkerThread()
 
public void   interrupt()
A new method that interrupts the worker thread. 
private void   setException(Exception e)
Set the exception thrown by worker thread  
private void   setResult(Object result)
Set the result produced by worker thread  
public void   start()
Start the worker thread. 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 23
gentleware-imported-package-statement-line-number 19
 

 Inner Classifier Detail

SwingWorker.ThreadVar

private static  SwingWorker.ThreadVar

Class to maintain reference to current worker thread under separate synchronization control.  
arrow_up
 Attribute Detail

_exception

private Exception _exception

arrow_up


_result

private Object _result

arrow_up
 Association Detail

_threadVar

private ThreadVar _threadVar

arrow_up
 Constructor Detail

SwingWorker

public com.gentleware.services.util.SwingWorker SwingWorker(String threadName)


Start a thread that will call the construct method and then exit.  
Parameters:
threadName -
Returns:
arrow_up
 Method Detail

construct

public Object construct()


Compute the result to be returned by the get method.  
Returns:
arrow_up


excepted

protected void excepted(Exception e)


Called on the event dispatching thread (not on the worker thread) when the construct method has thrown an exception.  
Parameters:
e -
arrow_up


finished

public void finished()


Called on the event dispatching thread (not on the worker thread) after the construct method has returned normally.  
arrow_up


get

public Object get()


Return the result created by the construct method. Returns null if either the constructing thread or the current thread was interrupted before a result was produced.  
Returns:
the result created by the construct method
arrow_up


getException

private Exception getException()


Get the exception thrown by worker thread, or null if it hasn't been constructed yet, or finished normally  
Returns:
arrow_up


getResult

private Object getResult()


Get the result produced by the worker thread, or null if it hasn't been constructed yet.  
Returns:
arrow_up


getWorkerThread

public Thread getWorkerThread()

Returns:
arrow_up


interrupt

public void interrupt()


A new method that interrupts the worker thread. Call this method to force the worker to stop what it's doing.  
arrow_up


setException

private void setException(Exception e)


Set the exception thrown by worker thread  
Parameters:
e -
arrow_up


setResult

private void setResult(Object result)


Set the result produced by worker thread  
Parameters:
result -
arrow_up


start

public void start()


Start the worker thread.  
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.