NASA World Wind

gov.nasa.worldwind.util.tree
Interface Tree

All Superinterfaces:
AVList, EventListener, MessageListener, OrderedRenderable, PropertyChangeListener, Renderable, WWObject
All Known Implementing Classes:
BasicTree, LayerTree

public interface Tree
extends WWObject, OrderedRenderable

A tree of objects, drawn in the World Window, that the user can interact with. How the tree is drawn is determined by the TreeLayout.

See Also:
TreeModel, TreeLayout

Method Summary
 void collapsePath(TreePath path)
          Collapse a path in the tree.
 void expandPath(TreePath path)
          Expand a path in the tree.
 TreeLayout getLayout()
          Get the tree layout.
 TreeModel getModel()
          Get the tree model.
 TreeNode getNode(TreePath path)
          Locate a node in the tree.
 boolean isNodeExpanded(TreeNode node)
          Is a node expanded?
 boolean isPathExpanded(TreePath path)
          Is a path expanded in the tree?
 void makeVisible(TreePath path)
          Make a node in the tree visible in the rendered tree.
 void setLayout(TreeLayout layout)
          Set the tree layout.
 void setModel(TreeModel model)
          Set the tree model.
 void togglePath(TreePath path)
          Expand a collapsed path, or collapse an expanded path.
 
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 java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 
Methods inherited from interface gov.nasa.worldwind.render.OrderedRenderable
getDistanceFromEye, pick
 
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
 

Method Detail

collapsePath

void collapsePath(TreePath path)
Collapse a path in the tree. Has no effect on leaf nodes.

Parameters:
path - Path to collapse.

expandPath

void expandPath(TreePath path)
Expand a path in the tree. Has no effect on leaf nodes.

Parameters:
path - Path to expand.

getLayout

TreeLayout getLayout()
Get the tree layout. The layout determines how the tree will be rendered.

Returns:
The tree layout.
See Also:
setLayout(TreeLayout)

getModel

TreeModel getModel()
Get the tree model. The model determines the contents of the tree.

Returns:
the tree model.
See Also:
setModel(TreeModel)

getNode

TreeNode getNode(TreePath path)
Locate a node in the tree.

Parameters:
path - Path to the node.
Returns:
Node identified by path if it exists in the tree.

isNodeExpanded

boolean isNodeExpanded(TreeNode node)
Is a node expanded?

Parameters:
node - Node to test.
Returns:
true if the node is expanded, false if collapsed. Always returns false for leaf nodes.

isPathExpanded

boolean isPathExpanded(TreePath path)
Is a path expanded in the tree?

Parameters:
path - Path to test.
Returns:
true if the path is expanded, false if collapsed. Always returns false for leaf nodes.

makeVisible

void makeVisible(TreePath path)
Make a node in the tree visible in the rendered tree. For example, scroll the tree viewport so that a path is visible.

Parameters:
path - Path to make visible.

setLayout

void setLayout(TreeLayout layout)
Set the tree layout. The layout determines how the tree will be rendered.

Parameters:
layout - New layout.
See Also:
getLayout()

setModel

void setModel(TreeModel model)
Set the tree model. The model determines the contents of the tree.

Parameters:
model - New tree model.
See Also:
getModel()

togglePath

void togglePath(TreePath path)
Expand a collapsed path, or collapse an expanded path. Has no effect on leaf nodes.

Parameters:
path - Path to operate on. If the node defined by path is expanded, it will be collapsed. If it is collapsed it will be expanded.

NASA World Wind