de.grogra.util
Class AbstractTreeMapper

java.lang.Object
  extended by de.grogra.util.AbstractTreeMapper
All Implemented Interfaces:
Disposable, java.util.EventListener, javax.swing.event.TreeModelListener
Direct Known Subclasses:
TreeMapper

public abstract class AbstractTreeMapper
extends java.lang.Object
implements javax.swing.event.TreeModelListener, Disposable


Field Summary
protected  java.lang.Object root
           
protected  javax.swing.tree.TreeModel source
           
protected  MutableTreeModel target
           
 
Constructor Summary
AbstractTreeMapper(javax.swing.tree.TreeModel source, java.lang.Object root, MutableTreeModel target, java.util.Comparator comparator)
           
 
Method Summary
protected  void createAndInsert(java.lang.Object sourceNode, java.lang.Object targetParent, int index)
           
protected abstract  java.lang.Object createNode(java.lang.Object sourceNode, java.lang.Object targetParent)
           
 void dispose()
           
protected  void disposeImpl()
           
protected  boolean filter(java.lang.Object node)
           
protected  java.lang.Object getImage(java.lang.Object sourceNode, java.lang.Object targetParent)
           
 javax.swing.tree.TreeModel getSourceTree()
           
 void installListener()
           
protected abstract  boolean isImage(java.lang.Object sourceNode, java.lang.Object targetNode)
           
 void map()
           
protected  void nodeRemoved(java.lang.Object node)
           
 void setFilter(ObjectToBoolean filter)
           
 boolean sourceNodesEqual(java.lang.Object a, java.lang.Object b)
           
protected  void targetChanged(java.lang.Object parent)
           
 void treeNodesChanged(javax.swing.event.TreeModelEvent e)
           
 void treeNodesInserted(javax.swing.event.TreeModelEvent e)
           
 void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
           
 void treeStructureChanged(javax.swing.event.TreeModelEvent e)
           
protected  void update(java.lang.Object sourceNode, javax.swing.tree.TreePath targetPath)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected java.lang.Object root

source

protected final javax.swing.tree.TreeModel source

target

protected final MutableTreeModel target
Constructor Detail

AbstractTreeMapper

public AbstractTreeMapper(javax.swing.tree.TreeModel source,
                          java.lang.Object root,
                          MutableTreeModel target,
                          java.util.Comparator comparator)
Method Detail

createAndInsert

protected void createAndInsert(java.lang.Object sourceNode,
                               java.lang.Object targetParent,
                               int index)

createNode

protected abstract java.lang.Object createNode(java.lang.Object sourceNode,
                                               java.lang.Object targetParent)

dispose

public final void dispose()
Specified by:
dispose in interface Disposable

disposeImpl

protected void disposeImpl()

filter

protected boolean filter(java.lang.Object node)

getImage

protected java.lang.Object getImage(java.lang.Object sourceNode,
                                    java.lang.Object targetParent)

getSourceTree

public javax.swing.tree.TreeModel getSourceTree()

installListener

public void installListener()

isImage

protected abstract boolean isImage(java.lang.Object sourceNode,
                                   java.lang.Object targetNode)

map

public void map()

nodeRemoved

protected void nodeRemoved(java.lang.Object node)

setFilter

public void setFilter(ObjectToBoolean filter)

sourceNodesEqual

public boolean sourceNodesEqual(java.lang.Object a,
                                java.lang.Object b)

targetChanged

protected void targetChanged(java.lang.Object parent)

treeNodesChanged

public void treeNodesChanged(javax.swing.event.TreeModelEvent e)
Specified by:
treeNodesChanged in interface javax.swing.event.TreeModelListener

treeNodesInserted

public void treeNodesInserted(javax.swing.event.TreeModelEvent e)
Specified by:
treeNodesInserted in interface javax.swing.event.TreeModelListener

treeNodesRemoved

public void treeNodesRemoved(javax.swing.event.TreeModelEvent e)
Specified by:
treeNodesRemoved in interface javax.swing.event.TreeModelListener

treeStructureChanged

public void treeStructureChanged(javax.swing.event.TreeModelEvent e)
Specified by:
treeStructureChanged in interface javax.swing.event.TreeModelListener

update

protected void update(java.lang.Object sourceNode,
                      javax.swing.tree.TreePath targetPath)