com.jaxfront.core.ui
Class TreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.jaxfront.core.ui.TreeNode
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class TreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements java.beans.PropertyChangeListener

A tree node representation to use with a Swing Tree Model to visualize a single JAXFront Type as a tree entry.

Version:
1.60
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
TreeNode(java.lang.Object userObject)
           
TreeNode(TreeModel model, Type type)
          Creates a TreeNode based on a type.
 
Method Summary
 java.util.List getChildren()
           
 java.lang.String getHelpText()
           
 javax.swing.Icon getIcon()
          Returns the icon of this tree node.
 int getPosition(TreeNode node)
          Calculates and returns the position of the current node in the tree
 java.lang.String getToolTip()
          Returns the tooltip for this tree node.
 Type getType()
          Returns the JAXFront type belonging to this node.
 java.lang.String getVisualName()
          Returns the visual tree name.
 java.lang.String getXPath()
           
 boolean isCheckBoxSelected()
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Refreshs the visual name and the icon.
 void release()
           
 void releaseNode()
           
 void setIcon(javax.swing.ImageIcon icon)
          Sets an icon for this tree node.
 void setIsCheckBoxSelected(boolean isSelected)
           
 void setModel(TreeModel model)
          Sets the tree model for this node
 void setType(Type type)
           
 boolean showCheckBox()
           
 
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, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, 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, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(java.lang.Object userObject)

TreeNode

public TreeNode(TreeModel model,
                Type type)
Creates a TreeNode based on a type.

Parameters:
type - building a tree node based on this type
Method Detail

setType

public void setType(Type type)

getXPath

public java.lang.String getXPath()

getIcon

public javax.swing.Icon getIcon()
Returns the icon of this tree node.


getPosition

public int getPosition(TreeNode node)
Calculates and returns the position of the current node in the tree

Parameters:
node - the current node for which its tree position needs to be calculated

getType

public Type getType()
Returns the JAXFront type belonging to this node.


getVisualName

public java.lang.String getVisualName()
Returns the visual tree name.


getToolTip

public java.lang.String getToolTip()
Returns the tooltip for this tree node.


getHelpText

public java.lang.String getHelpText()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Refreshs the visual name and the icon.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

setIcon

public void setIcon(javax.swing.ImageIcon icon)
Sets an icon for this tree node.

Parameters:
icon - a tree node icon

setModel

public void setModel(TreeModel model)
Sets the tree model for this node

Parameters:
model - hodling tree model

releaseNode

public void releaseNode()

release

public void release()

setIsCheckBoxSelected

public void setIsCheckBoxSelected(boolean isSelected)

isCheckBoxSelected

public boolean isCheckBoxSelected()

showCheckBox

public boolean showCheckBox()

getChildren

public java.util.List getChildren()