net.sf.j3d.threeD.ui.tree
Class SurfaceTreeNode

java.lang.Object
  extended by net.sf.j3d.threeD.ui.tree.SurfaceTreeNode
All Implemented Interfaces:
MutableTreeNode, TreeNode, EventGenerator

public class SurfaceTreeNode
extends Object
implements TreeNode, EventGenerator

A SurfaceTreeNode object allows SurfaceUI objects to be represented by TreeNode components that can be added to a JTree component.

Author:
Mike Murray

Constructor Summary
SurfaceTreeNode(SurfaceUI surface, TreeNode parent)
          Constructs a new SurfaceTreeNode object using the specified SurfaceUI object with the specified parent.
 
Method Summary
 Enumeration children()
           
 boolean getAllowsChildren()
           
 TreeNode getChildAt(int index)
          Returns the child of this SurfaceTreeNode object at the specified index.
 int getChildCount()
          Returns the number of children contained by this SurfaceTreeNode object.
 EventHandler getEventHandler()
          Returns the EventHandler that is being used by this EventGenerator.
 int getIndex(TreeNode node)
          Returns the index of the specified TreeNode object in this SurfaceTreeNode object's children.
 TreeNode getParent()
          Returns the parent of this SurfaceTreeNode object.
 SurfaceUI getSurface()
          Returns the SurfaceUI object stored by this SurfaceTreeNode object.
 void insert(MutableTreeNode node, int index)
           
 boolean isLeaf()
           
 void remove(int index)
          Does nothing.
 void remove(MutableTreeNode node)
          Does nothing.
 void removeFromParent()
           
 void setEventHandler(EventHandler handler)
          Sets the EventHandler that is used by this EventGenerator.
 void setParent(MutableTreeNode node)
           
 void setUserObject(Object o)
          Sets the name of the SurfaceUI object stored to the specified value, if it is a String.
 String toString()
           
 void updateChildren()
          Updates the children of this SurfaceTreeNode object so that they match the stored SurfaceUI object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SurfaceTreeNode

public SurfaceTreeNode(SurfaceUI surface,
                       TreeNode parent)
Constructs a new SurfaceTreeNode object using the specified SurfaceUI object with the specified parent.

Method Detail

getSurface

public SurfaceUI getSurface()
Returns the SurfaceUI object stored by this SurfaceTreeNode object.


updateChildren

public void updateChildren()
Updates the children of this SurfaceTreeNode object so that they match the stored SurfaceUI object.


children

public Enumeration children()
Specified by:
children in interface TreeNode
Returns:
The children of this SurfaceTreeNode object as an Enumeration.

getChildAt

public TreeNode getChildAt(int index)
Returns the child of this SurfaceTreeNode object at the specified index.

Specified by:
getChildAt in interface TreeNode

getChildCount

public int getChildCount()
Returns the number of children contained by this SurfaceTreeNode object.

Specified by:
getChildCount in interface TreeNode

getParent

public TreeNode getParent()
Returns the parent of this SurfaceTreeNode object.

Specified by:
getParent in interface TreeNode

getIndex

public int getIndex(TreeNode node)
Returns the index of the specified TreeNode object in this SurfaceTreeNode object's children. If the specified TreeNode object is unmatched -1 will be returned.

Specified by:
getIndex in interface TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode
Returns:
True if this SurfaceTreeNode object allows children.

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode
Returns:
True if this SurfaceTreeNode object has no children.

toString

public String toString()
Overrides:
toString in class Object
Returns:
The name of the SurfaceUI object represented by this SurfaceTreeNode object.

insert

public void insert(MutableTreeNode node,
                   int index)
Specified by:
insert in interface MutableTreeNode

remove

public void remove(int index)
Does nothing.

Specified by:
remove in interface MutableTreeNode

remove

public void remove(MutableTreeNode node)
Does nothing.

Specified by:
remove in interface MutableTreeNode

setUserObject

public void setUserObject(Object o)
Sets the name of the SurfaceUI object stored to the specified value, if it is a String.

Specified by:
setUserObject in interface MutableTreeNode

removeFromParent

public void removeFromParent()
Specified by:
removeFromParent in interface MutableTreeNode

setParent

public void setParent(MutableTreeNode node)
Specified by:
setParent in interface MutableTreeNode

setEventHandler

public void setEventHandler(EventHandler handler)
Description copied from interface: EventGenerator
Sets the EventHandler that is used by this EventGenerator.

Specified by:
setEventHandler in interface EventGenerator

getEventHandler

public EventHandler getEventHandler()
Description copied from interface: EventGenerator
Returns the EventHandler that is being used by this EventGenerator.

Specified by:
getEventHandler in interface EventGenerator