net.sourceforge.helpgui.page
Class PageRoot

java.lang.Object
  extended by net.sourceforge.helpgui.page.PageRoot
All Implemented Interfaces:
javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class PageRoot
extends java.lang.Object
implements javax.swing.tree.MutableTreeNode

Root node for the tree

Author:
Alexandre THOMAS

Field Summary
protected  PageList pages
           
protected  javax.swing.tree.MutableTreeNode parentNode
           
protected  java.lang.Object userObject
           
 
Constructor Summary
PageRoot()
          Constructor.
 
Method Summary
 void add(Page page)
          Adds a page to this project (in the root of the project).
 java.util.Enumeration children()
          Returns the children of the receiver as an Enumeration.
 boolean getAllowsChildren()
          Returns true if the receiver allows children.
 javax.swing.tree.TreeNode getChildAt(int iChildIndex)
          Returns the child TreeNode at index childIndex.
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 Page getFirstChild()
           
 int getIndex(javax.swing.tree.TreeNode node)
          Returns the index of node in the receivers children.
 javax.swing.tree.TreeNode getParent()
          Returns the parent TreeNode of the receiver.
 void insert(javax.swing.tree.MutableTreeNode child, int index)
          Adds child to the receiver at index.
 boolean isLeaf()
          Returns true if the receiver is a leaf.
 void remove(int index)
          Removes the child at index from the receiver.
 void remove(javax.swing.tree.MutableTreeNode node)
          Removes node from the receiver.
 void removeFromParent()
          Removes the receiver from its parent.
 void setParent(javax.swing.tree.MutableTreeNode newParent)
          Sets the parent of the receiver to newParent.
 void setUserObject(java.lang.Object object)
          Resets the user object of the receiver to object.
 java.lang.String toString()
          Convert the Page into String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pages

protected PageList pages

parentNode

protected javax.swing.tree.MutableTreeNode parentNode

userObject

protected java.lang.Object userObject
Constructor Detail

PageRoot

public PageRoot()
Constructor.

Method Detail

add

public void add(Page page)
Adds a page to this project (in the root of the project).


toString

public java.lang.String toString()
Convert the Page into String.

Overrides:
toString in class java.lang.Object

insert

public void insert(javax.swing.tree.MutableTreeNode child,
                   int index)
Adds child to the receiver at index.

Specified by:
insert in interface javax.swing.tree.MutableTreeNode

remove

public void remove(int index)
Removes the child at index from the receiver.

Specified by:
remove in interface javax.swing.tree.MutableTreeNode

remove

public void remove(javax.swing.tree.MutableTreeNode node)
Removes node from the receiver.

Specified by:
remove in interface javax.swing.tree.MutableTreeNode

removeFromParent

public void removeFromParent()
Removes the receiver from its parent.

Specified by:
removeFromParent in interface javax.swing.tree.MutableTreeNode

setParent

public void setParent(javax.swing.tree.MutableTreeNode newParent)
Sets the parent of the receiver to newParent.

Specified by:
setParent in interface javax.swing.tree.MutableTreeNode

setUserObject

public void setUserObject(java.lang.Object object)
Resets the user object of the receiver to object.

Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode

getChildAt

public javax.swing.tree.TreeNode getChildAt(int iChildIndex)
Returns the child TreeNode at index childIndex.

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

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.

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

getParent

public javax.swing.tree.TreeNode getParent()
Returns the parent TreeNode of the receiver.

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

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Returns the index of node in the receivers children.

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

isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf.

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

getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children.

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

children

public java.util.Enumeration children()
Returns the children of the receiver as an Enumeration.

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

getFirstChild

public Page getFirstChild()