ewe.data
Class LiveTreeNode

java.lang.Object
  extended byewe.data.DataObject
      extended byewe.data.LiveObject
          extended byewe.data.LiveTreeNode
All Implemented Interfaces:
Comparable, Copyable, DataUnit, FieldListener, LiveData, MutableTreeNode, TreeNode
Direct Known Subclasses:
ComputerKeyNode, EweFile.EweEntry, FakeFileSystem, FormattedTextMaker.Entry, RegistryKeyNode, TreeConfigNode, TreeControl.ControlTreeNode, ZipEntry

public class LiveTreeNode
extends LiveObject
implements MutableTreeNode


Field Summary
protected  Vector children
          The children of this Node.
protected  TreeNode parent
          The parent of this Node.
 
Constructor Summary
LiveTreeNode()
           
 
Method Summary
 void addChild(MutableTreeNode ch)
          Add a child to this TreeNode at the end of the child list.
 int[] addressOfChild(TreeNode child)
           
static int[] addressOfChild(TreeNode parent, String childPath)
          This tries to find the address of a child given its path from the parent.
static int[] addressOfChild(TreeNode parent, TreeNode child)
           
 boolean canExpand()
          Returns whether this node is expandable.
 boolean collapse()
          Tell it that it can release its children.
 boolean expand()
          Tell it to expand (ie gather its children).
static TreeNode findNamedChild(TreeNode parent, String name)
           
 TreeNode getChild(int index)
          Get the child at the specified index.
 TreeNode getChildAt(int[] address)
           
static TreeNode getChildAt(TreeNode parent, int[] address)
           
 int getChildCount()
          Get the number of children that this object has.
 Iterator getChildren()
          Get an Iterator for the children.
 TreeNode getParent()
          Get the parent of this object.
static TreeNode getParent(TreeNode child, int levels)
           
static TreeNode getSibling(TreeNode child, int change)
           
 int indexOfChild(TreeNode child)
          Return the index of the specified child.
 void insertChild(MutableTreeNode ch, int index)
          Insert a child at the specified index.
 boolean isLeaf()
          Returns whether this is a node or leaf.
static boolean isNamed(TreeNode node, String name)
           
 void removeChild(MutableTreeNode ch)
          Remove a child from this TreeNode.
 void setParent(TreeNode p)
          Set the parent of this TreeNode.
 
Methods inherited from class ewe.data.LiveObject
action, action, addMeToPanel, addObjectToPanel, addToPanel, decode, decoded, decodeFields, enableEditorScrolling, encode, encoded, encodeFields, fieldChanged, fieldChanged, fieldEvent, getEditor, getEditorScroller, getIcon, getName, input, makeNewEditor, runAsApp, textDecode, textEncode
 
Methods inherited from class ewe.data.DataObject
_getSetField, appendAllFields, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getDeclaredFieldValue, getFieldList, getFieldList, getMyFieldList, getNew
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, toString
 
Methods inherited from interface ewe.data.DataUnit
copyFrom, getNew
 
Methods inherited from interface ewe.util.Copyable
getCopy
 
Methods inherited from interface ewe.util.Comparable
compareTo
 

Field Detail

parent

protected TreeNode parent
The parent of this Node.


children

protected Vector children
The children of this Node. This will be NULL until children are added.

Constructor Detail

LiveTreeNode

public LiveTreeNode()
Method Detail

getChild

public TreeNode getChild(int index)
Description copied from interface: TreeNode
Get the child at the specified index.

Specified by:
getChild in interface TreeNode

getChildren

public Iterator getChildren()
Description copied from interface: TreeNode
Get an Iterator for the children.

Specified by:
getChildren in interface TreeNode

getChildCount

public int getChildCount()
Description copied from interface: TreeNode
Get the number of children that this object has.

Specified by:
getChildCount in interface TreeNode

getParent

public TreeNode getParent()
Description copied from interface: TreeNode
Get the parent of this object.

Specified by:
getParent in interface TreeNode

setParent

public void setParent(TreeNode p)
Description copied from interface: MutableTreeNode
Set the parent of this TreeNode.

Specified by:
setParent in interface MutableTreeNode

removeChild

public void removeChild(MutableTreeNode ch)
Description copied from interface: MutableTreeNode
Remove a child from this TreeNode.

Specified by:
removeChild in interface MutableTreeNode

addChild

public void addChild(MutableTreeNode ch)
Description copied from interface: MutableTreeNode
Add a child to this TreeNode at the end of the child list. If the child is already in the child list it will be removed and then added to the end.

Specified by:
addChild in interface MutableTreeNode

insertChild

public void insertChild(MutableTreeNode ch,
                        int index)
Description copied from interface: MutableTreeNode
Insert a child at the specified index. If the index is greater than the number of children, the child will be appended to the child list. If the child is already in the child list it will be removed and then re-inserted at the specified index.

Specified by:
insertChild in interface MutableTreeNode

indexOfChild

public int indexOfChild(TreeNode child)
Description copied from interface: TreeNode
Return the index of the specified child. This will return -1 if the parameter is not a child of this TreeNode.

Specified by:
indexOfChild in interface TreeNode

addressOfChild

public int[] addressOfChild(TreeNode child)

getChildAt

public TreeNode getChildAt(int[] address)

getChildAt

public static TreeNode getChildAt(TreeNode parent,
                                  int[] address)

addressOfChild

public static int[] addressOfChild(TreeNode parent,
                                   TreeNode child)

isNamed

public static boolean isNamed(TreeNode node,
                              String name)

findNamedChild

public static TreeNode findNamedChild(TreeNode parent,
                                      String name)

addressOfChild

public static int[] addressOfChild(TreeNode parent,
                                   String childPath)
This tries to find the address of a child given its path from the parent.


getSibling

public static TreeNode getSibling(TreeNode child,
                                  int change)

getParent

public static TreeNode getParent(TreeNode child,
                                 int levels)

canExpand

public boolean canExpand()
Description copied from interface: TreeNode
Returns whether this node is expandable.

Specified by:
canExpand in interface TreeNode

expand

public boolean expand()
Description copied from interface: TreeNode
Tell it to expand (ie gather its children).

Specified by:
expand in interface TreeNode

isLeaf

public boolean isLeaf()
Description copied from interface: TreeNode
Returns whether this is a node or leaf.

Specified by:
isLeaf in interface TreeNode

collapse

public boolean collapse()
Description copied from interface: TreeNode
Tell it that it can release its children.

Specified by:
collapse in interface TreeNode