|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.avlist.AVListImpl
gov.nasa.worldwind.WWObjectImpl
gov.nasa.worldwind.util.tree.BasicTreeNode
public class BasicTreeNode
Default implementation of a TreeNode.
| Field Summary | |
|---|---|
protected List<TreeNode> |
children
|
protected String |
description
|
protected boolean |
enabled
|
protected Object |
imageSource
|
protected TreeNode |
parent
|
protected boolean |
selected
|
protected String |
text
|
protected BasicWWTexture |
texture
|
protected String |
treeSelected
Flag to indicate that any part of the sub-tree rooted at this node is selected. |
protected boolean |
visible
|
| Fields inherited from interface gov.nasa.worldwind.util.tree.TreeNode |
|---|
NOT_SELECTED, PARTIALLY_SELECTED, SELECTED |
| Constructor Summary | |
|---|---|
BasicTreeNode(String text)
Create a node with text. |
|
BasicTreeNode(String text,
Object imageSource)
Create a node with text and an icon. |
|
| Method Summary | |
|---|---|
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. |
protected String |
computeTreeSelected()
Determine if any part of the sub-tree rooted at this node is selected. |
Iterable<TreeNode> |
getChildren()
Get the children of this node. |
String |
getDescription()
Get extra text associated with this node. |
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. |
String |
getText()
Get the text of this node. |
BasicWWTexture |
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. |
protected void |
initializeTexture()
Create and initialize the texture from the image source. |
boolean |
isEnabled()
Is the node enabled? |
boolean |
isLeaf()
Is the node a leaf node. |
boolean |
isSelected()
Is the node selected? |
String |
isTreeSelected()
Is any part of the sub-tree rooted at this node selected? |
boolean |
isVisible()
Is the node visible? |
void |
propertyChange(PropertyChangeEvent propertyChangeEvent)
The property change listener for this instance. |
void |
removeAllChildren()
Remove all of the child nodes from this node. |
void |
removeChild(TreeNode child)
Remove a child node. |
void |
setDescription(String description)
Set the node description. |
void |
setEnabled(boolean enabled)
Set the node to enabled or not enabled. |
void |
setImageSource(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. |
| Methods inherited from class gov.nasa.worldwind.WWObjectImpl |
|---|
onMessage |
| Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface gov.nasa.worldwind.avlist.AVList |
|---|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues |
| Methods inherited from interface gov.nasa.worldwind.event.MessageListener |
|---|
onMessage |
| Field Detail |
|---|
protected List<TreeNode> children
protected String description
protected boolean enabled
protected Object imageSource
protected TreeNode parent
protected boolean selected
protected String text
protected BasicWWTexture texture
protected String treeSelected
protected boolean visible
| Constructor Detail |
|---|
public BasicTreeNode(String text)
text - Node text.
public BasicTreeNode(String text,
Object imageSource)
text - Node text.imageSource - Image source for the node icon. May be a String, URL, or BufferedImage.| Method Detail |
|---|
public void addChild(int index,
TreeNode child)
addChild in interface TreeNodeindex - Index at which the new child will be inserted.child - New child.public void addChild(TreeNode child)
addChild in interface TreeNodechild - New child.protected String computeTreeSelected()
TreeNode.SELECTED, TreeNode.NOT_SELECTED, TreeNode.PARTIALLY_SELECTED.public Iterable<TreeNode> getChildren()
getChildren in interface TreeNodeTreeNode.addChild(TreeNode)public String getDescription()
TreeNode
getDescription in interface TreeNodepublic Object getImageSource()
getImageSource in interface TreeNodenull if the node does not have an icon.public TreeNode getParent()
null.
getParent in interface TreeNodenull if this the root node.TreeNode.setParent(TreeNode)public TreePath getPath()
getPath in interface TreeNodepublic String getText()
getText in interface TreeNodepublic BasicWWTexture getTexture()
getTexture in interface TreeNodepublic boolean hasImage()
hasImage in interface TreeNodeprotected void initializeTexture()
public boolean isEnabled()
isEnabled in interface TreeNodeTreeNode.setEnabled(boolean)public boolean isLeaf()
isLeaf in interface TreeNodepublic boolean isSelected()
isSelected in interface TreeNodeTreeNode.setSelected(boolean),
TreeNode.isTreeSelected()public String isTreeSelected()
isTreeSelected in interface TreeNodeTreeNode.SELECTED, TreeNode.NOT_SELECTED, TreeNode.PARTIALLY_SELECTED.public boolean isVisible()
isVisible in interface TreeNodeTreeNode.setVisible(boolean)public void propertyChange(PropertyChangeEvent propertyChangeEvent)
propertyChange in interface PropertyChangeListenerpropertyChange in class WWObjectImplpropertyChangeEvent - the eventpublic void removeAllChildren()
removeAllChildren in interface TreeNodepublic void removeChild(TreeNode child)
removeChild in interface TreeNodechild - Child to remove.public void setDescription(String description)
TreeNode
setDescription in interface TreeNodedescription - New description.public void setEnabled(boolean enabled)
setEnabled in interface TreeNodeenabled - New enabled state.TreeNode.isEnabled()public void setImageSource(Object imageSource)
setImageSource in interface TreeNodeimageSource - New icon source. May be a String, URL, or BufferedImage.public void setParent(TreeNode node)
setParent in interface TreeNodenode - New parent node.TreeNode.getParent()public void setSelected(boolean selected)
setSelected in interface TreeNodeselected - New selection value.TreeNode.isSelected()public void setVisible(boolean visible)
setVisible in interface TreeNodevisible - New visibility setting.TreeNode.isVisible()
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||