Rings
Version 0.3

threeD.ui.tree
Class SurfaceTreeNode

java.lang.Object
  extended bythreeD.ui.tree.SurfaceTreeNode
All Implemented Interfaces:
javax.swing.tree.TreeNode, TreeNode

public class SurfaceTreeNode
extends java.lang.Object
implements TreeNode

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


Constructor Summary
SurfaceTreeNode(SurfaceUI surface, TreeNode parent)
          Constructs a new SurfaceTreeNode object using the specified SurfaceUI object with the specified parent.
 
Method Summary
 java.util.Enumeration children()
          Returns the children of this SurfaceTreeNode object as an Enumeration.
 boolean getAllowsChildren()
          Returns true if this SurfaceTreeNode object allows children.
 javax.swing.tree.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.
 int getIndex(javax.swing.tree.TreeNode node)
          Returns the index of the specified TreeNode object in this SurfaceTreeNode object's children.
 javax.swing.tree.TreeNode getParent()
          Returns the parent of this SurfaceTreeNode object.
 SurfaceUI getSurface()
          Returns the SurfaceUI object stored by this SurfaceTreeNode object.
 boolean isLeaf()
          Returns true if this SurfaceTreeNode object has no children.
 java.lang.String toString()
          Returns the name of the SurfaceUI object represented by this SurfaceTreeNode object.
 void updateChildren()
          Updates the children of this SurfaceTreeNode object so that they match the stored SurfaceUI object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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 java.util.Enumeration children()
Returns the children of this SurfaceTreeNode object as an Enumeration.

Specified by:
children in interface javax.swing.tree.TreeNode

getChildAt

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

Specified by:
getChildAt in interface javax.swing.tree.TreeNode

getChildCount

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

Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getParent

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

Specified by:
getParent in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.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 javax.swing.tree.TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Returns true if this SurfaceTreeNode object allows children.

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Returns true if this SurfaceTreeNode object has no children.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode

toString

public java.lang.String toString()
Returns the name of the SurfaceUI object represented by this SurfaceTreeNode object.


Rings
Version 0.3

Copyright 2003-05 Mike Murray