Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.xerox.VTM.engine
Class SwingWorkerParam  view SwingWorkerParam download SwingWorkerParam.java

java.lang.Object
  extended bycom.xerox.VTM.engine.SwingWorkerParam
All Implemented Interfaces:
java.lang.Runnable

public abstract class SwingWorkerParam
extends java.lang.Object
implements java.lang.Runnable

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/products/jfc/swingdoc-current/threads2.html * Allow parameters for the construct method. * @see com.xerox.VTM.engine.SwingWorker


Nested Class Summary
private static class SwingWorkerParam.ThreadVar
          * Class to maintain reference to current worker thread * under separate synchronization control.
 
Field Summary
private  java.lang.Runnable doFinished
           
private  java.util.Vector param
           
private  java.lang.Thread thread
           
private  SwingWorkerParam.ThreadVar threadVar
           
private  java.lang.Object value
           
 
Constructor Summary
SwingWorkerParam(java.util.Vector constructParameters)
          Start a thread that will call the construct method * and then exit.
 
Method Summary
abstract  java.lang.Object construct(java.util.Vector p)
          * 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()
          A new method that interrupts the worker thread.
 void run()
          This method will be called by whoever wishes to run your class implementing Runnable.
private  void setValue(java.lang.Object x)
          * Set the value produced by worker thread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

private java.lang.Object value

thread

private java.lang.Thread thread

param

private java.util.Vector param

doFinished

private java.lang.Runnable doFinished

threadVar

private SwingWorkerParam.ThreadVar threadVar
Constructor Detail

SwingWorkerParam

public SwingWorkerParam(java.util.Vector constructParameters)
Start a thread that will call the construct method * and then exit. * @param constructParameters parameters the internal thread use * when it calls the construct method.

Method Detail

getValue

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


setValue

private void setValue(java.lang.Object x)
* Set the value produced by worker thread


construct

public abstract java.lang.Object construct(java.util.Vector p)
* Compute the value to be returned by the get method.


finished

public void finished()
Called on the event dispatching thread (not on the worker thread) * after the construct method has returned.


interrupt

public void interrupt()
A new method that interrupts the worker thread. Call this method * to force the worker to abort what it's doing.


get

public java.lang.Object 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. * * @return the value created by the construct method


run

public void run()
Description copied from interface: java.lang.Runnable
This method will be called by whoever wishes to run your class implementing Runnable. Note that there are no restrictions on what you are allowed to do in the run method, except that you cannot throw a checked exception.

Specified by:
run in interface java.lang.Runnable