Package cz.vutbr.fit.layout.impl
Class DefaultTreeNode<T extends GenericTreeNode<T>>
- java.lang.Object
-
- cz.vutbr.fit.layout.impl.DefaultTreeNode<T>
-
- All Implemented Interfaces:
GenericTreeNode<T>
- Direct Known Subclasses:
DefaultLogicalArea
,DefaultTreeContentRect
public class DefaultTreeNode<T extends GenericTreeNode<T>> extends Object implements GenericTreeNode<T>
A generic tree node used as a base for the Box and Area implementation.- Author:
- burgetr
-
-
Constructor Summary
Constructors Constructor Description DefaultTreeNode(Class<T> myType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendChild(T child)
void
appendChildren(List<T> list)
int
getDepth()
T
getChildAt(int index)
int
getChildCount()
List<T>
getChildren()
int
getIndex(T child)
int
getLeafCount()
T
getNextSibling()
T
getParent()
T
getPreviousSibling()
T
getRoot()
void
childrenChanged()
This method is called after some child nodes have been added or removed.void
insertChild(T child, int index)
boolean
isLeaf()
boolean
isRoot()
void
removeAllChildren()
void
removeChild(int index)
void
removeChild(T child)
void
setParent(T parent)
void
setRoot(T root)
-
-
-
Method Detail
-
getParent
public T getParent()
- Specified by:
getParent
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
setParent
public void setParent(T parent)
- Specified by:
setParent
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getRoot
public T getRoot()
- Specified by:
getRoot
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
setRoot
public void setRoot(T root)
- Specified by:
setRoot
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
isRoot
public boolean isRoot()
- Specified by:
isRoot
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getChildren
public List<T> getChildren()
- Specified by:
getChildren
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
isLeaf
public boolean isLeaf()
- Specified by:
isLeaf
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
appendChild
public void appendChild(T child)
- Specified by:
appendChild
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
appendChildren
public void appendChildren(List<T> list)
- Specified by:
appendChildren
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
insertChild
public void insertChild(T child, int index) throws IndexOutOfBoundsException
- Specified by:
insertChild
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
- Throws:
IndexOutOfBoundsException
-
removeAllChildren
public void removeAllChildren()
- Specified by:
removeAllChildren
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
removeChild
public void removeChild(int index) throws IndexOutOfBoundsException
- Specified by:
removeChild
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
- Throws:
IndexOutOfBoundsException
-
removeChild
public void removeChild(T child) throws IllegalArgumentException
- Specified by:
removeChild
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
- Throws:
IllegalArgumentException
-
getChildAt
public T getChildAt(int index) throws IndexOutOfBoundsException
- Specified by:
getChildAt
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
- Throws:
IndexOutOfBoundsException
-
getIndex
public int getIndex(T child)
- Specified by:
getIndex
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getPreviousSibling
public T getPreviousSibling()
- Specified by:
getPreviousSibling
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getNextSibling
public T getNextSibling()
- Specified by:
getNextSibling
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getDepth
public int getDepth()
- Specified by:
getDepth
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
getLeafCount
public int getLeafCount()
- Specified by:
getLeafCount
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
childrenChanged
public void childrenChanged()
This method is called after some child nodes have been added or removed. Subclasses may override this method in order to update their own internal structures.- Specified by:
childrenChanged
in interfaceGenericTreeNode<T extends GenericTreeNode<T>>
-
-