Class LayerTreeNode
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.util.tree.BasicTreeNode
-
- gov.nasa.worldwind.util.layertree.LayerTreeNode
-
- All Implemented Interfaces:
AVList
,MessageListener
,TreeNode
,WWObject
,java.beans.PropertyChangeListener
,java.util.EventListener
- Direct Known Subclasses:
KMLLayerTreeNode
public class LayerTreeNode extends BasicTreeNode
ATreeNode
that represents a
.Layer
The node's selection state is synchronized with its
Layer
's enabled state.
returns whether the node'sisSelected()
Layer
is enabled. Calling
specifies both the the node's selection state, and whether itssetSelected(boolean)
Layer
should be enabled for rendering and selection.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
DEFAULT_IMAGE
The layer node's default icon path.protected Layer
layer
Indicates theLayer
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
Constructors Constructor Description LayerTreeNode(Layer layer)
Creates a newLayerTreeNode
from the specifiedlayer
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initialize()
Initializes this node's image source.boolean
isSelected()
Indicates whether this node'sLayer
is enabled for rendering and selection.void
setSelected(boolean selected)
Specifies whether this node'sLayer
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, 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 java.lang.String DEFAULT_IMAGE
The layer node's default icon path.- See Also:
- Constant Field Values
-
layer
protected Layer layer
Indicates theLayer
this node represents. Initialized to a non-null
value during construction.
-
-
Constructor Detail
-
LayerTreeNode
public LayerTreeNode(Layer layer)
Creates a newLayerTreeNode
from the specifiedlayer
. The node's name is set to the layer's name.- Parameters:
layer
- theLayer
this node represents.- Throws:
java.lang.IllegalArgumentException
- if thelayer
isnull
.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes this node's image source.
-
isSelected
public boolean isSelected()
Indicates whether this node'sLayer
is enabled for rendering and selection.- Specified by:
isSelected
in interfaceTreeNode
- Overrides:
isSelected
in classBasicTreeNode
- Returns:
true
if theLayer
is enabled, otherwisefalse
.- See Also:
TreeNode.setSelected(boolean)
,TreeNode.isTreeSelected()
-
setSelected
public void setSelected(boolean selected)
Specifies whether this node'sLayer
is enabled for rendering and selection. This sets both the node's selection state and itsLayer
's enabled state.- Specified by:
setSelected
in interfaceTreeNode
- Overrides:
setSelected
in classBasicTreeNode
- Parameters:
selected
-true
to enable theLayer
, otherwisefalse
.- See Also:
TreeNode.isSelected()
-
-