javatools.swing.tree
Class AbstractTreeExpansionDispatcher

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--javatools.swing.tree.AbstractTreeExpansionDispatcher
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
MediTreeExpansionDispatcher

public abstract class AbstractTreeExpansionDispatcher
extends java.lang.Thread

It is an "event dispatcher" for tree expansions, i.e. it manages in a separate thread tree expansions. You have only to inherit this method: doDispatchOne: what you have to do when you are expanding a node. Once created your own class, use this sequence of commands: AbstractTreeExpansioDispatcher disp = new YourClass(); disp.setStatusLabelSync(myStatusLabelSync); disp.start(); disp.expand(myTree, mySelectionPath); disp.stopAll();


Field Summary
protected  StatusLabelSync statusSync
          The status label sync to be used to display messages.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
AbstractTreeExpansionDispatcher()
          Creates a new instance of AbstractTreeExpansionDispatcher
 
Method Summary
protected abstract  void doDispatchOne(javax.swing.JTree tree, javax.swing.tree.TreePath path)
          Inherit it to make your own operations.
 void expand(javax.swing.JTree tree, javax.swing.tree.TreePath path)
          Expands a node.
 void run()
          Thread's run method.
 void setStatusLabelSync(StatusLabelSync sync)
          Sets the status label sync to use.
 void stopAll()
          Stops the thread.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statusSync

protected StatusLabelSync statusSync
The status label sync to be used to display messages.

Constructor Detail

AbstractTreeExpansionDispatcher

public AbstractTreeExpansionDispatcher()
Creates a new instance of AbstractTreeExpansionDispatcher

Method Detail

setStatusLabelSync

public void setStatusLabelSync(StatusLabelSync sync)
Sets the status label sync to use.

Parameters:
sync - The sync to use.

run

public void run()
Thread's run method.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopAll

public void stopAll()
Stops the thread.


expand

public void expand(javax.swing.JTree tree,
                   javax.swing.tree.TreePath path)
Expands a node.

Parameters:
tree - The tree that will be expanded.
path - The complete path of the node to be expanded.

doDispatchOne

protected abstract void doDispatchOne(javax.swing.JTree tree,
                                      javax.swing.tree.TreePath path)
Inherit it to make your own operations.

Parameters:
tree - The tree that will be expanded.
path - The complete selection path.