|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.x3d.dom.swing.DOMTreeNode
public class DOMTreeNode
An implementation of the MutableTreeNode that represents a single DOM node within a JTree.
The model is specifically tailored to display DOM objects. The model is configured so that it should always ask if it allows children as some DOM nodes cannot have children. This class does not add event listeners as it assumes that the TreeModel it is a part of will do that for us.
Our basic assumption is that this tree node is dumb. It only looks after its tree node children. If the DOM node it represents changes underneath it then someone needs to tell it that.
| Constructor Summary | |
|---|---|
DOMTreeNode(org.w3c.dom.Node node,
DOMTreeNode parent)
Create an instance of the tree node that represents the given DOM Node. |
|
| Method Summary | |
|---|---|
java.util.Enumeration |
children()
Get the list of children of this node as an enumeration. |
boolean |
getAllowsChildren()
Check to see if this node allows children. |
javax.swing.tree.TreeNode |
getChildAt(int index)
Get the child at the given index position. |
int |
getChildCount()
Get the number of children of this node. |
int |
getIndex(javax.swing.tree.TreeNode node)
Get the index of the given tree node. |
org.w3c.dom.Node |
getNode()
Get the DOM node that this tree node represents. |
javax.swing.tree.TreeNode |
getParent()
Get the parent node of this node. |
java.lang.Object |
getUserData()
Get the user data stored in this object. |
void |
insert(javax.swing.tree.MutableTreeNode child,
int index)
Insert the child at the given position. |
boolean |
isLeaf()
Check to see if this instance is a leaf node |
void |
remove(int index)
Remove the child at the given index position. |
void |
remove(javax.swing.tree.MutableTreeNode child)
Remove the given tree node from the list of children of this node. |
void |
removeFromParent()
Remove this node from it's parent. |
void |
setParent(javax.swing.tree.MutableTreeNode parent)
Set the parent node of this node to the new value. |
void |
setUserObject(java.lang.Object obj)
Add some user data to this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DOMTreeNode(org.w3c.dom.Node node,
DOMTreeNode parent)
node - The DOM node this tree node represents| Method Detail |
|---|
public void insert(javax.swing.tree.MutableTreeNode child,
int index)
insert in interface javax.swing.tree.MutableTreeNodechild - The new child to insertindex - The position to insert the child intopublic void remove(int index)
remove in interface javax.swing.tree.MutableTreeNodepublic void remove(javax.swing.tree.MutableTreeNode child)
remove in interface javax.swing.tree.MutableTreeNodechild - The node to removepublic void removeFromParent()
removeFromParent in interface javax.swing.tree.MutableTreeNodepublic void setParent(javax.swing.tree.MutableTreeNode parent)
setParent in interface javax.swing.tree.MutableTreeNodeparent - The new node to use as a parentpublic void setUserObject(java.lang.Object obj)
setUserObject in interface javax.swing.tree.MutableTreeNodeobj - The data to be storedpublic java.util.Enumeration children()
children in interface javax.swing.tree.TreeNodepublic boolean getAllowsChildren()
getAllowsChildren in interface javax.swing.tree.TreeNodepublic javax.swing.tree.TreeNode getChildAt(int index)
getChildAt in interface javax.swing.tree.TreeNodeindex - The position to check
public int getChildCount()
getChildCount in interface javax.swing.tree.TreeNodepublic int getIndex(javax.swing.tree.TreeNode node)
getIndex in interface javax.swing.tree.TreeNodenode - The node to find the index of
public javax.swing.tree.TreeNode getParent()
getParent in interface javax.swing.tree.TreeNodepublic boolean isLeaf()
isLeaf in interface javax.swing.tree.TreeNodepublic org.w3c.dom.Node getNode()
public java.lang.Object getUserData()
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||