public interface TreeNode extends WWObject
Tree
. A node must have a string of text. It may also have an icon.TreeModel
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NOT_SELECTED
No nodes in a subtree are selected.
|
static java.lang.String |
PARTIALLY_SELECTED
Some nodes in a subtree are selected, and some are not.
|
static java.lang.String |
SELECTED
All nodes in a subtree are selected.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(int index,
TreeNode child)
Add a child node at a specified position in the list of children.
|
void |
addChild(TreeNode child)
Add a child node.
|
java.lang.Iterable<TreeNode> |
getChildren()
Get the children of this node.
|
java.lang.String |
getDescription()
Get extra text associated with this node.
|
java.lang.Object |
getImageSource()
Get the source of the node icon.
|
TreeNode |
getParent()
Get the node's parent.
|
TreePath |
getPath()
Get the path from the root node to this node.
|
java.lang.String |
getText()
Get the text of this node.
|
WWTexture |
getTexture()
Get the texture loaded for the node's icon.
|
boolean |
hasImage()
Does this node have an icon? This method returns true if an image source has been set.
|
boolean |
isEnabled()
Is the node enabled?
|
boolean |
isLeaf()
Is the node a leaf node.
|
boolean |
isSelected()
Is the node selected?
|
java.lang.String |
isTreeSelected()
Is any part of the sub-tree rooted at this node selected?
|
boolean |
isVisible()
Is the node visible?
|
void |
removeAllChildren()
Remove all of the child nodes from this node.
|
void |
removeChild(TreeNode child)
Remove a child node.
|
void |
setDescription(java.lang.String description)
Set the node description.
|
void |
setEnabled(boolean enabled)
Set the node to enabled or not enabled.
|
void |
setImageSource(java.lang.Object imageSource)
Set the node's icon.
|
void |
setParent(TreeNode node)
Set the parent node.
|
void |
setSelected(boolean selected)
Set the node to selected or not selected.
|
void |
setVisible(boolean visible)
Set the node to visible or not visible.
|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
static final java.lang.String NOT_SELECTED
static final java.lang.String PARTIALLY_SELECTED
static final java.lang.String SELECTED
void addChild(int index, TreeNode child) throws java.lang.IndexOutOfBoundsException
index
- Index at which the new child will be inserted.child
- New child.java.lang.IndexOutOfBoundsException
- if index
is less than zero or greater than the number of children
already in the list.void addChild(TreeNode child)
child
- New child.java.lang.Iterable<TreeNode> getChildren()
addChild(TreeNode)
java.lang.String getDescription()
java.lang.Object getImageSource()
null
if the node does not have an icon.TreeNode getParent()
null
.null
if this the root node.setParent(TreeNode)
TreePath getPath()
java.lang.String getText()
WWTexture getTexture()
boolean hasImage()
boolean isEnabled()
setEnabled(boolean)
boolean isLeaf()
boolean isSelected()
setSelected(boolean)
,
isTreeSelected()
java.lang.String isTreeSelected()
SELECTED
, NOT_SELECTED
, PARTIALLY_SELECTED
.boolean isVisible()
setVisible(boolean)
void removeAllChildren()
void removeChild(TreeNode child)
child
- Child to remove.void setDescription(java.lang.String description)
description
- New description.void setEnabled(boolean enabled)
enabled
- New enabled state.isEnabled()
void setImageSource(java.lang.Object imageSource)
imageSource
- New icon source. May be a String, URL, or BufferedImage.void setParent(TreeNode node)
node
- New parent node.getParent()
void setSelected(boolean selected)
selected
- New selection value.isSelected()
void setVisible(boolean visible)
visible
- New visibility setting.isVisible()