org.oddjob.designer.model
Class DesignTreeNode

java.lang.Object
  extended byorg.oddjob.designer.model.DesignTreeNode
All Implemented Interfaces:
StructuralListener, javax.swing.tree.TreeNode

public class DesignTreeNode
extends java.lang.Object
implements javax.swing.tree.TreeNode, StructuralListener

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

Author:
Rob Gordon

Constructor Summary
DesignTreeNode(DesignTreeModel model, DesignTreeNode parent, DesignComponent node)
          Constructor.
 
Method Summary
 void build()
           
 void childAdded(StructuralEvent e)
          Called when a child is added to a Structural object.
 void childRemoved(StructuralEvent e)
          Called when a child is removed from a Strucutral object.
 java.util.Enumeration children()
           
 void destroy()
           
 boolean getAllowsChildren()
           
 javax.swing.tree.TreeNode getChildAt(int index)
           
 int getChildCount()
           
 DesignComponent getDesignComponent()
           
 java.awt.Component getDetailView()
           
 int getIndex(javax.swing.tree.TreeNode child)
           
 javax.swing.tree.TreeNode getParent()
           
 boolean isLeaf()
           
 java.lang.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()

getDesignComponent

public DesignComponent getDesignComponent()

children

public java.util.Enumeration children()
Specified by:
children in interface javax.swing.tree.TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int index)
Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode child)
Specified by:
getIndex in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Specified by:
getParent in interface javax.swing.tree.TreeNode

toString

public java.lang.String toString()

childAdded

public void childAdded(StructuralEvent e)
Description copied from interface: StructuralListener
Called when a child is added to a Structural object.

Specified by:
childAdded in interface StructuralListener
Parameters:
e - The strucural event.

childRemoved

public void childRemoved(StructuralEvent e)
Description copied from interface: StructuralListener
Called when a child is removed from a Strucutral object.

Specified by:
childRemoved in interface StructuralListener
Parameters:
e - The strucutral event.

destroy

public void destroy()

getDetailView

public java.awt.Component getDetailView()
Returns:
Returns the detailView.