org.oddjob.arooa.design.designer
Class DesignTreeNode

java.lang.Object
  extended by org.oddjob.arooa.design.designer.DesignTreeNode
All Implemented Interfaces:
TreeNode

public class DesignTreeNode
extends Object
implements TreeNode

This class wraps a DesignComponent allowing it to act as a TreeNode.

See Also:
DesignTreeModel
Author:
Rob Gordon

Constructor Summary
DesignTreeNode(DesignTreeModel model, DesignTreeNode parent, DesignComponent node)
          Constructor.
 
Method Summary
 void build()
          Build the tree.
 Enumeration<DesignTreeNode> children()
           
 void destroy()
           
 boolean getAllowsChildren()
           
 DesignTreeNode getChildAt(int index)
           
 int getChildCount()
           
 DesignComponent getDesignComponent()
           
 Component getDetailView()
           
 int getIndex(TreeNode child)
           
 DesignTreeNode getParent()
           
 boolean isLeaf()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DesignTreeNode

public DesignTreeNode(DesignTreeModel model,
                      DesignTreeNode parent,
                      DesignComponent node)
Constructor.

Parameters:
model - The tree model this node belongs to.
parent - The parent node.
node - The structure node this is modelling.
Method Detail

build

public void build()
Build the tree. This recursive method tracks the component tree structure. It creates and remove child tree nodes as the are added and removed to the component.


getDesignComponent

public DesignComponent getDesignComponent()

children

public Enumeration<DesignTreeNode> children()
Specified by:
children in interface TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode

getChildAt

public DesignTreeNode getChildAt(int index)
Specified by:
getChildAt in interface TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface TreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode

getIndex

public int getIndex(TreeNode child)
Specified by:
getIndex in interface TreeNode

getParent

public DesignTreeNode getParent()
Specified by:
getParent in interface TreeNode

toString

public String toString()
Overrides:
toString in class Object

destroy

public void destroy()

getDetailView

public Component getDetailView()
Returns:
Returns the detailView.