|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
org.wingx.tree.XTreeNode
public abstract class XTreeNode
basic node class
| Nested Class Summary | |
|---|---|
static class |
XTreeNode.InitializationListener
initialise the nodes when they are expanded |
| Field Summary |
|---|
| Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
|---|
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
| Constructor Summary | |
|---|---|
protected |
XTreeNode(Object userObject)
Creates a tree node with no parent, no children, initialized with the specified user object. |
|
XTreeNode(TreeModel treeModel,
Object userObject,
boolean allowsChildren)
construct the node with the tree model, the tree model must always be passed in the constructor, each node knows it's model from the start. |
| Method Summary | |
|---|---|
void |
addNotify(MutableTreeNode newChild)
add the child node, and notify the model if it is a default tree model |
protected abstract void |
doInitialize()
do the initialization |
int |
getDepth()
get the distance of this node from the root node the children of the root node have a depth of 1. |
XTreeNode |
getNodeChildAt(int index)
type cast the child ot an onode |
TreeModel |
getTreeModel()
return the tree model |
void |
initialize()
lazy initialization |
void |
insertNotify(MutableTreeNode newChild,
int index)
insert the child node, and notify the model if it is a default tree model |
boolean |
isExpanded()
return the expanded state. |
boolean |
isInitialized()
|
void |
reinitialize()
reinitialize |
void |
removeAllChildrenNotify()
remove all children |
void |
setExpanded(boolean expanded)
|
void |
setInitialized(boolean initialized)
|
void |
setTreeModel(TreeModel treeModel)
Set the tree model as tree model of current node. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected XTreeNode(Object userObject)
userObject - an Object provided by the user that constitutes
the node's data
public XTreeNode(TreeModel treeModel,
Object userObject,
boolean allowsChildren)
treeModel - | Method Detail |
|---|
public void initialize()
initialize in interface LazyNodeprotected abstract void doInitialize()
public void reinitialize()
public boolean isInitialized()
public void setInitialized(boolean initialized)
public TreeModel getTreeModel()
public void setTreeModel(TreeModel treeModel)
treeModel - The tree model of the whole
tree.public XTreeNode getNodeChildAt(int index)
index -
public int getDepth()
getDepth in class DefaultMutableTreeNodepublic boolean isExpanded()
public void setExpanded(boolean expanded)
expanded - The expanded to set.
public void insertNotify(MutableTreeNode newChild,
int index)
newChild - index - public void removeAllChildrenNotify()
public void addNotify(MutableTreeNode newChild)
newChild - parent - index -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||