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

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

public class SceneTreeNode
extends Object
implements TreeNode, EventGenerator, EventListener

A SceneTreeNode object allows a Scene object to be represented by a TreeNode component that can be added to a JTree component.

Author:
Mike Murray

Constructor Summary
SceneTreeNode(Scene scene)
          Constructs a new SceneTreeNode object using the specified Scene object.
 
Method Summary
 Enumeration children()
           
 void eventFired(Event event)
          Method called when an event has been fired.
 boolean getAllowsChildren()
           
 TreeNode getChildAt(int index)
           
 int getChildCount()
           
 EventHandler getEventHandler()
          Returns the EventHandler that is being used by this EventGenerator.
 int getIndex(TreeNode node)
           
 TreeNode getParent()
           
 Scene getScene()
          Returns the Scene object stored by this SceneTreeNode object.
 void insert(MutableTreeNode node, int index)
          Does nothing.
 boolean isLeaf()
           
 void remove(int index)
          Removes the Surface object stored by the Scene backing this SceneTreeNode at the specified index and updates the children.
 void remove(MutableTreeNode node)
          Does nothing.
 void removeFromParent()
          Does nothing.
 void setEventHandler(EventHandler handler)
          Sets the EventHandler that is used by this EventGenerator.
 void setParent(MutableTreeNode node)
          Does nothing.
 void setUserObject(Object o)
          Does nothing.
 String toString()
           
 void updateChildren()
          Updates the children of this SceneTreeNode object so that they match the stored Scene object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SceneTreeNode

public SceneTreeNode(Scene scene)
Constructs a new SceneTreeNode object using the specified Scene object.

Method Detail

getScene

public Scene getScene()
Returns the Scene object stored by this SceneTreeNode object.


updateChildren

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


eventFired

public void eventFired(Event event)
Method called when an event has been fired.

Specified by:
eventFired in interface EventListener

children

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

getChildAt

public TreeNode getChildAt(int index)
Specified by:
getChildAt in interface TreeNode
Returns:
The child of this SceneTreeNode object at the specified index.

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface TreeNode
Returns:
The number of children contained by this SceneTreeNode object.

getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode
Returns:
null (A SceneTreeNode is a root node and has no parent).

getIndex

public int getIndex(TreeNode node)
Specified by:
getIndex in interface TreeNode
Returns:
The index of the specified TreeNode object in this SceneTreeNode object's children. If the specified TreeNode object is unmatched -1 will be returned.

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode
Returns:
True (A SceneTreeNode always allows children).

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode
Returns:
False (A SceneTreeNode is never a leaf).

toString

public String toString()
Overrides:
toString in class Object
Returns:
"Scene".

insert

public void insert(MutableTreeNode node,
                   int index)
Does nothing.

Specified by:
insert in interface MutableTreeNode

remove

public void remove(int index)
Removes the Surface object stored by the Scene backing this SceneTreeNode at the specified index and updates the children.

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)
Does nothing.

Specified by:
setUserObject in interface MutableTreeNode

removeFromParent

public void removeFromParent()
Does nothing.

Specified by:
removeFromParent in interface MutableTreeNode

setParent

public void setParent(MutableTreeNode node)
Does nothing.

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