com.acarter.composabletree
Interface ComposableTreeNode

All Known Implementing Classes:
CollisionGeometryTreeNode, ControllerTreeNode, DynamicPhysicsNodeTreeNode, GeometryTreeNode, LightStateTreeNode, LightTreeNode, NodeTreeNode, PassNodeStateTreeNode, PassNodeTreeNode, RenderStateTreeNode, SpatialTreeNode, StaticPhysicsNodeTreeNode, TextureStateTreeNode, TextureTreeNode

public interface ComposableTreeNode

Author:
Andrew Carter

Method Summary
 java.lang.Object getChild(java.lang.Object parent, int index)
          Returns the child of the parent given the index.
 int getChildCount(java.lang.Object parent)
          Counts the number of children of this type under this parent.
 int getChildIndex(java.lang.Object parent, java.lang.Object child)
          Returns the index of the child.
 javax.swing.Icon getIcon(java.lang.Object node)
          Returns a icon to be rendered in the tree.
 java.lang.Class<?> getNodeClassType()
          Returns the class type of objects this tree node represents.
 java.lang.String getNodeText(java.lang.Object node, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          Returns a textual representation of this tree node.
 java.lang.String getNodeToolTipText(java.lang.Object node, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          Returns a meaningful tool tip description of this tree node.
 java.lang.Object getParent(java.lang.Object child)
          Returns the parent object of the given child.
 

Method Detail

getChildCount

int getChildCount(java.lang.Object parent)
Counts the number of children of this type under this parent.

Parameters:
parent - the object with the children to count
Returns:
the number of children represented by this tree node type

getChildIndex

int getChildIndex(java.lang.Object parent,
                  java.lang.Object child)
Returns the index of the child.

Parameters:
parent - the parent object
child - the child of the parent
Returns:
index of the child, or -1 if not a child

getChild

java.lang.Object getChild(java.lang.Object parent,
                          int index)
Returns the child of the parent given the index.

Parameters:
parent - parent object
index - Index of the child
Returns:
the child, or null

getParent

java.lang.Object getParent(java.lang.Object child)
Returns the parent object of the given child.

Parameters:
child - the child object of the desired parent.
Returns:
the parent object if possible, or null

getNodeClassType

java.lang.Class<?> getNodeClassType()
Returns the class type of objects this tree node represents.

Returns:
tree node class

getNodeText

java.lang.String getNodeText(java.lang.Object node,
                             boolean selected,
                             boolean expanded,
                             boolean leaf,
                             int row,
                             boolean hasFocus)
Returns a textual representation of this tree node.

Parameters:
node - the Object to convert to text
selected - true if the node is selected
expanded - true if the node is expanded
leaf - true if the node is a leaf node
row - an integer specifying the node's display row, where 0 is the first row in the display
hasFocus - true if the node has the focus
Returns:
the String representation of the node's value

getNodeToolTipText

java.lang.String getNodeToolTipText(java.lang.Object node,
                                    boolean selected,
                                    boolean expanded,
                                    boolean leaf,
                                    int row,
                                    boolean hasFocus)
Returns a meaningful tool tip description of this tree node.

Parameters:
node - the Object to describe
selected - true if the node is selected
expanded - true if the node is expanded
leaf - true if the node is a leaf node
row - an integer specifying the node's display row, where 0 is the first row in the display
hasFocus - true if the node has the focus
Returns:
the String description of the node

getIcon

javax.swing.Icon getIcon(java.lang.Object node)
Returns a icon to be rendered in the tree.

Parameters:
object - the object the icon will represent
Returns:
the icon, or null is no icon is desired