info.joseluismartin.gui.tree
Class ListTreeNode

java.lang.Object
  extended by info.joseluismartin.gui.tree.ListTreeNode
All Implemented Interfaces:
MutableTreeNode, TreeNode

public class ListTreeNode
extends Object
implements MutableTreeNode

Simple TreeNode implementation that use List to hold chidrens. mainly used for root nodes

Author:
Jose Luis Martin - (jlm@joseluismartin.info)

Constructor Summary
ListTreeNode(String name)
           
 
Method Summary
 void add(TreeNode node)
           
 Enumeration children()
          
 boolean getAllowsChildren()
          
 TreeNode getChildAt(int childIndex)
          
 int getChildCount()
          
 int getIndex(TreeNode node)
          
 List getList()
           
 TreeNode getParent()
          
 void insert(MutableTreeNode child, int index)
           
 boolean isLeaf()
          
 void remove(int index)
           
 void remove(MutableTreeNode node)
           
 void remove(TreeNode node)
           
 void removeFromParent()
           
 void setParent(MutableTreeNode newParent)
           
 void setUserObject(Object object)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListTreeNode

public ListTreeNode(String name)
Method Detail

children

public Enumeration children()

Specified by:
children in interface TreeNode

getAllowsChildren

public boolean getAllowsChildren()

Specified by:
getAllowsChildren in interface TreeNode

getChildAt

public TreeNode getChildAt(int childIndex)

Specified by:
getChildAt in interface TreeNode

getChildCount

public int getChildCount()

Specified by:
getChildCount in interface TreeNode

getIndex

public int getIndex(TreeNode node)

Specified by:
getIndex in interface TreeNode

getParent

public TreeNode getParent()

Specified by:
getParent in interface TreeNode

isLeaf

public boolean isLeaf()

Specified by:
isLeaf in interface TreeNode

add

public void add(TreeNode node)

remove

public void remove(TreeNode node)

toString

public String toString()
Overrides:
toString in class Object

getList

public List getList()
Returns:
children list

insert

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

remove

public void remove(int index)
Specified by:
remove in interface MutableTreeNode

remove

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

removeFromParent

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

setParent

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

setUserObject

public void setUserObject(Object object)
Specified by:
setUserObject in interface MutableTreeNode


Copyright © 2013 JDAL. All Rights Reserved.