Package jadex.base.gui.asynctree
Class AbstractTreeNode
- java.lang.Object
- 
- jadex.base.gui.asynctree.AbstractTreeNode
 
- 
- All Implemented Interfaces:
- ITreeNode
 - Direct Known Subclasses:
- AbstractSwingTreeNode
 
 public abstract class AbstractTreeNode extends java.lang.Object implements ITreeNode Basic node object.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Future<java.util.List<ITreeNode>>childrenfutureThe children future (result of next search).protected booleandirtyFlag to indicate that children were added / removed during ongoing search (->restart search).protected AsyncTreeModelmodelThe tree model.protected ITreeNodeparentThe parent node.protected booleanrecurseFlag to indicate recursive refresh.protected booleansearchingFlag to indicate search in progress.
 - 
Constructor SummaryConstructors Constructor Description AbstractTreeNode(ITreeNode parent, AsyncTreeModel model)Create a node.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddChild(int index, ITreeNode node)Add a child and update the tree.voidaddChild(ITreeNode node)Add a child and update the tree.protected booleancheckChildren(java.util.List oldcs, java.util.List newcs)Check the children for validity.voiddispose()Called when the node is removed or the tree is closed.booleanequals(java.lang.Object obj)Test if two nodes are equal.protected voidexpandChildren(boolean dorecurse, java.util.List<ITreeNode> children)java.util.List<ITreeNode>getCachedChildren()Get the cached children, i.e.ITreeNodegetChild(int index)Get the given child.intgetChildCount()Get the child count.IFuture<java.util.List<ITreeNode>>getChildren()Get the current children, i.e.abstract byte[]getIcon()Get the icon for a node.intgetIndexOfChild(ITreeNode child)Get the index of a child.AsyncTreeModelgetModel()Get the model.ITreeNodegetParent()Get the parent node.abstract java.lang.StringgetTooltipText()Get tooltip text.inthashCode()Generate a has code.booleanhasProperties()True, if the node has properties that can be displayed.booleanisLeaf()Check if the node is a leaf.voidrefresh(boolean recurse)Refresh the node.voidremoveAllChildren()Remove all children.voidremoveChild(ITreeNode node)Remove a child and update the tree.protected abstract voidsearchChildren()Asynchronously search for children.protected voidsetChildren(java.util.List<? extends ITreeNode> newchildren)Set the children.voidsetParent(ITreeNode parent)The dirty to set.
 
- 
- 
- 
Field Detail- 
parentprotected ITreeNode parent The parent node.
 - 
modelprotected final AsyncTreeModel model The tree model.
 - 
searchingprotected boolean searching Flag to indicate search in progress.
 - 
recurseprotected boolean recurse Flag to indicate recursive refresh.
 - 
dirtyprotected boolean dirty Flag to indicate that children were added / removed during ongoing search (->restart search).
 
- 
 - 
Constructor Detail- 
AbstractTreeNodepublic AbstractTreeNode(ITreeNode parent, AsyncTreeModel model) Create a node.
 
- 
 - 
Method Detail- 
disposepublic void dispose() Called when the node is removed or the tree is closed.
 - 
getParentpublic ITreeNode getParent() Get the parent node.
 - 
setParentpublic void setParent(ITreeNode parent) The dirty to set.- Parameters:
- dirty- The dirty to set
 
 - 
getChildCountpublic int getChildCount() Get the child count.- Specified by:
- getChildCountin interface- ITreeNode
 
 - 
getChildpublic ITreeNode getChild(int index) Get the given child.
 - 
getIndexOfChildpublic int getIndexOfChild(ITreeNode child) Get the index of a child.- Specified by:
- getIndexOfChildin interface- ITreeNode
 
 - 
isLeafpublic boolean isLeaf() Check if the node is a leaf.
 - 
refreshpublic void refresh(boolean recurse) Refresh the node.
 - 
getCachedChildrenpublic java.util.List<ITreeNode> getCachedChildren() Get the cached children, i.e. do not start any background processes for updating the children.- Specified by:
- getCachedChildrenin interface- ITreeNode
 
 - 
getChildrenpublic IFuture<java.util.List<ITreeNode>> getChildren() Get the current children, i.e. start a new update process and provide the result as a future.- Specified by:
- getChildrenin interface- ITreeNode
 
 - 
hasPropertiespublic boolean hasProperties() True, if the node has properties that can be displayed.- Specified by:
- hasPropertiesin interface- ITreeNode
 
 - 
getIconpublic abstract byte[] getIcon() Get the icon for a node.
 - 
getTooltipTextpublic abstract java.lang.String getTooltipText() Get tooltip text.- Specified by:
- getTooltipTextin interface- ITreeNode
 
 - 
searchChildrenprotected abstract void searchChildren() Asynchronously search for children. Called once for each node. Should call setChildren() once children are found.
 - 
setChildrenprotected void setChildren(java.util.List<? extends ITreeNode> newchildren) Set the children. No children should be represented as empty list to avoid ongoing search for children.
 - 
expandChildrenprotected void expandChildren(boolean dorecurse, java.util.List<ITreeNode> children)
 - 
checkChildrenprotected boolean checkChildren(java.util.List oldcs, java.util.List newcs)Check the children for validity. I.e. it is not allowed to have two equal children in the list or to alter the ordering of existing children.
 - 
getModelpublic AsyncTreeModel getModel() Get the model.
 - 
addChildpublic void addChild(int index, ITreeNode node)Add a child and update the tree. Must be called from swing thread.
 - 
addChildpublic void addChild(ITreeNode node) Add a child and update the tree.
 - 
removeChildpublic void removeChild(ITreeNode node) Remove a child and update the tree.
 - 
removeAllChildrenpublic void removeAllChildren() Remove all children.
 - 
equalspublic boolean equals(java.lang.Object obj) Test if two nodes are equal.- Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() Generate a has code.- Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-