org.objectweb.jac.aspects.gui
Class AbstractNode

java.lang.Object
  |
  +--javax.swing.tree.DefaultMutableTreeNode
        |
        +--org.objectweb.jac.aspects.gui.AbstractNode
All Implemented Interfaces:
Cloneable, MutableTreeNode, Serializable, TreeNode
Direct Known Subclasses:
ObjectNode, RelationNode, RootNode

public abstract class AbstractNode
extends DefaultMutableTreeNode

This tree node caches the text and the icon to display so that calls to the wrappee are not needed every time tree is painted

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
AbstractNode()
           
AbstractNode(TreeView model, Object object, boolean showRelations)
           
 
Method Summary
 boolean areChildrenUptodate()
          Returns true if the children of this node are to be updated.
 String getIcon()
          Gets the icon of this node (null if none).
 String getText()
          Gets the text of this node (null is none).
 String getToolTip()
           
 boolean isLeaf()
          Returns true if this node is a leaf of the tree that holds it.
 void setChildrenUptodate(boolean value)
          Sets the uptodate state of this node's children.
 void setLeaf(boolean isLeaf)
          Sets this node to be a leaf or not of the tree.
 void setModel(TreeView model)
          Sets the model (abstract tree representation) of this node.
 void setParent(DefaultMutableTreeNode parent)
          Redefines the DefaultMutableTreeNode.setParent in order to unregister the update events.
abstract  void unregisterEvents()
          Unregister from all update events
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractNode

public AbstractNode()

AbstractNode

public AbstractNode(TreeView model,
                    Object object,
                    boolean showRelations)
Method Detail

isLeaf

public boolean isLeaf()
Returns true if this node is a leaf of the tree that holds it.

Specified by:
isLeaf in interface TreeNode
Overrides:
isLeaf in class DefaultMutableTreeNode

setLeaf

public void setLeaf(boolean isLeaf)
Sets this node to be a leaf or not of the tree.

Parameters:
isLeaf - true => leaf
See Also:
isLeaf()

areChildrenUptodate

public boolean areChildrenUptodate()
Returns true if the children of this node are to be updated.


setChildrenUptodate

public void setChildrenUptodate(boolean value)
Sets the uptodate state of this node's children.

Parameters:
value - true => uptodate
See Also:
areChildrenUptodate()

setModel

public void setModel(TreeView model)
Sets the model (abstract tree representation) of this node.


getIcon

public String getIcon()
Gets the icon of this node (null if none).


getText

public String getText()
Gets the text of this node (null is none).


getToolTip

public String getToolTip()

unregisterEvents

public abstract void unregisterEvents()
Unregister from all update events


setParent

public void setParent(DefaultMutableTreeNode parent)
Redefines the DefaultMutableTreeNode.setParent in order to unregister the update events.

Parameters:
parent - the parent node
See Also:
unregisterEvents()