JHotDraw 7.0.6

org.jhotdraw.draw.action
Class RunnableWorker

java.lang.Object
  extended by org.jhotdraw.draw.action.RunnableWorker
All Implemented Interfaces:
java.lang.Runnable

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

This is an abstract class that you subclass to perform GUI-related work in a dedicated event dispatcher.

This class is compatible with SwingWorker where it is reasonable to be so. Unlike a SwingWorker it does not use an internal worker thread but has to be dispatched by a dispatcher which handles java.awt.ActiveEvent's.


Constructor Summary
RunnableWorker()
           
 
Method Summary
abstract  java.lang.Object construct()
          Compute the value to be returned by the get method.
 void finished(java.lang.Object value)
          Called on the event dispatching thread (not on the worker thread) after the construct method has returned.
protected  java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunnableWorker

public RunnableWorker()
Method Detail

run

public void run()
Calls #construct on the current thread and invokes #finished on the AWT event dispatcher thread.

Specified by:
run in interface java.lang.Runnable

construct

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


finished

public void finished(java.lang.Object value)
Called on the event dispatching thread (not on the worker thread) after the construct method has returned.


getValue

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


Copyright 1996-2006 © JHotDraw.org