org.argouml.ui.explorer
Class ExplorerTreeModel.ExplorerUpdater

java.lang.Object
  extended byorg.argouml.ui.explorer.ExplorerTreeModel.ExplorerUpdater
All Implemented Interfaces:
Runnable
Enclosing class:
ExplorerTreeModel

class ExplorerTreeModel.ExplorerUpdater
extends Object
implements Runnable

Help class to semi-lazily update nodes in the tree. This class is thread safe.


Field Summary
private  boolean hot
          Is this object currently waiting to be run.
static int MAX_UPDATES_PER_RUN
          The maximum number of nodes to update in one chunk
private  LinkedList pendingUpdates
          The set of nodes pending being updated.
 
Constructor Summary
(package private) ExplorerTreeModel.ExplorerUpdater()
           
 
Method Summary
 void run()
          Call updateChildren for some pending nodes.
private  void schedule()
          Schedule this object to run on AWT-EventQueue-0 at some later time.
 void schedule(ExplorerTreeNode node)
          Schedule updateChildren to be called on node at some later time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pendingUpdates

private LinkedList pendingUpdates
The set of nodes pending being updated.


hot

private boolean hot
Is this object currently waiting to be run.


MAX_UPDATES_PER_RUN

public static final int MAX_UPDATES_PER_RUN
The maximum number of nodes to update in one chunk

See Also:
Constant Field Values
Constructor Detail

ExplorerTreeModel.ExplorerUpdater

ExplorerTreeModel.ExplorerUpdater()
Method Detail

schedule

private void schedule()
Schedule this object to run on AWT-EventQueue-0 at some later time.


schedule

public void schedule(ExplorerTreeNode node)
Schedule updateChildren to be called on node at some later time. Does nothing if there already is a pending update of node.

Parameters:
node - The ExplorerTreeNode to be updated.
Throws:
NullPointerException - If node is null.

run

public void run()
Call updateChildren for some pending nodes. Will call at most MAX_UPDATES_PER_RUN each time. Should there still be pending updates after that then it will reschedule itself.

This method should not be called explicitly, instead schedule should be called and this method will be called automatically.

Specified by:
run in interface Runnable


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook