NASA World Wind

gov.nasa.worldwind.examples.util.layertree
Class LayerTreeNode

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.util.tree.BasicTreeNode
              extended by gov.nasa.worldwind.examples.util.layertree.LayerTreeNode
All Implemented Interfaces:
AVList, MessageListener, TreeNode, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
KMLLayerTreeNode

public class LayerTreeNode
extends BasicTreeNode

A TreeNode that represents a Layer.

The node's selection state is synchronized with its Layer's enabled state. isSelected() returns whether the node's Layer is enabled. Calling setSelected(boolean) specifies both the the node's selection state, and whether its Layer should be enabled for rendering and selection.


Field Summary
protected static String DEFAULT_IMAGE
          The layer node's default icon path.
protected  Layer layer
          Indicates the Layer this node represents.
 
Fields inherited from class gov.nasa.worldwind.util.tree.BasicTreeNode
children, description, enabled, imageSource, parent, selected, text, texture, treeSelected, visible
 
Fields inherited from interface gov.nasa.worldwind.util.tree.TreeNode
NOT_SELECTED, PARTIALLY_SELECTED, SELECTED
 
Constructor Summary
LayerTreeNode(Layer layer)
          Creates a new LayerTreeNode from the specified layer.
 
Method Summary
protected  void initialize()
          Initializes this node's image source.
 boolean isSelected()
          Indicates whether this node's Layer is enabled for rendering and selection.
 void setSelected(boolean selected)
          Specifies whether this node's Layer is enabled for rendering and selection.
 
Methods inherited from class gov.nasa.worldwind.util.tree.BasicTreeNode
addChild, addChild, computeTreeSelected, getChildren, getDescription, getImageSource, getParent, getPath, getText, getTexture, hasImage, initializeTexture, isEnabled, isLeaf, isTreeSelected, isVisible, propertyChange, removeAllChildren, removeChild, setDescription, setEnabled, setImageSource, setParent, setVisible
 
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

DEFAULT_IMAGE

protected static final String DEFAULT_IMAGE
The layer node's default icon path.

See Also:
Constant Field Values

layer

protected Layer layer
Indicates the Layer this node represents. Initialized to a non-null value during construction.

Constructor Detail

LayerTreeNode

public LayerTreeNode(Layer layer)
Creates a new LayerTreeNode from the specified layer. The node's name is set to the layer's name.

Parameters:
layer - the Layer this node represents.
Throws:
IllegalArgumentException - if the layer is null.
Method Detail

initialize

protected void initialize()
Initializes this node's image source.


isSelected

public boolean isSelected()
Indicates whether this node's Layer is enabled for rendering and selection.

Specified by:
isSelected in interface TreeNode
Overrides:
isSelected in class BasicTreeNode
Returns:
true if the Layer is enabled, otherwise false.
See Also:
TreeNode.setSelected(boolean), TreeNode.isTreeSelected()

setSelected

public void setSelected(boolean selected)
Specifies whether this node's Layer is enabled for rendering and selection. This sets both the node's selection state and its Layer's enabled state.

Specified by:
setSelected in interface TreeNode
Overrides:
setSelected in class BasicTreeNode
Parameters:
selected - true to enable the Layer, otherwise false.
See Also:
TreeNode.isSelected()

NASA World Wind