public class LayerTree extends BasicTree
Renderable
tree of Layer
objects and their content. By
default, a LayerTree
is created with a LayerTreeModel
, and a BasicTreeLayout
that is configured for displaying a layer tree. Callers can
specify the model to use either by specifying one during construction, or by calling BasicTree.setModel(gov.nasa.worldwind.util.tree.TreeModel)
. Once created, callers add layers to the tree
using methods on LayerTreeModel
.LayerTreeModel
,
LayerTreeNode
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_FRAME_IMAGE
The default frame image.
|
protected static java.lang.String |
DEFAULT_FRAME_TITLE
The default frame title: "Layers".
|
protected static Offset |
DEFAULT_OFFSET
The default screen location: 20x140 pixels from the upper left screen corner.
|
expandedNodes, layout, model
Constructor and Description |
---|
LayerTree()
Creates a new
LayerTree with an empty LayerTreeModel and the default screen location. |
LayerTree(LayerTreeModel model)
Creates a new
LayerTree with the specified model and the default screen location. |
LayerTree(LayerTreeModel model,
Offset offset)
Creates a new
LayerTree with the specified model and the specified screen location. |
LayerTree(Offset offset)
Creates a new
LayerTree with an empty LayerTreeModel and the specified screen
location. |
Modifier and Type | Method and Description |
---|---|
protected TreeLayout |
createTreeLayout(Offset offset)
Returns a new
TreeLayout suitable for displaying the layer tree on a WorldWindow . |
protected LayerTreeModel |
createTreeModel()
Returns a new
LayerTreeModel . |
LayerTreeModel |
getModel()
Get the tree model.
|
protected void |
initialize(LayerTreeModel model,
Offset offset)
Initializes this tree with the specified
model and offset . |
collapsePath, expandPath, getDistanceFromEye, getLayout, getNode, isNodeExpanded, isPathExpanded, makeVisible, pick, preRender, render, setLayout, setModel, togglePath
onMessage, propertyChange
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected static final java.lang.String DEFAULT_FRAME_IMAGE
protected static final java.lang.String DEFAULT_FRAME_TITLE
protected static final Offset DEFAULT_OFFSET
public LayerTree()
LayerTree
with an empty LayerTreeModel
and the default screen location.
The tree's upper left corner is placed 20x140 pixels from the upper left screen corner.public LayerTree(LayerTreeModel model)
LayerTree
with the specified model
and the default screen location. The
tree's upper left corner is placed 20x140 pixels from the upper left screen corner.model
- the tree model to use.java.lang.IllegalArgumentException
- if model
is null
.public LayerTree(LayerTreeModel model, Offset offset)
LayerTree
with the specified model
and the specified screen location.model
- the tree model to use.offset
- the screen location of the tree's upper left corner, relative to the screen's upper left corner.java.lang.IllegalArgumentException
- if model
is null
, or if offset
is
null
.public LayerTree(Offset offset)
LayerTree
with an empty LayerTreeModel
and the specified screen
location.offset
- the screen location of the tree's upper left corner, relative to the screen's upper left corner.java.lang.IllegalArgumentException
- if offset
is null
.protected TreeLayout createTreeLayout(Offset offset)
TreeLayout
suitable for displaying the layer tree on a WorldWindow
. If
the offset
is null
this the default value.offset
- the screen location of this tree's upper left corner, or null
to use the default.TreeLayout
.protected LayerTreeModel createTreeModel()
LayerTreeModel
. Called from initialize
when no model is specified.LayerTreeModel
.public LayerTreeModel getModel()
getModel
in interface Tree
getModel
in class BasicTree
Tree.setModel(TreeModel)
protected void initialize(LayerTreeModel model, Offset offset)
model
and offset
. This configures the tree's
model, its layout, and expands the path to the root node. If either parameter is null
this uses a
suitable default.model
- this tree's model to use, or null
to create a new LayerTreeModel
.offset
- the screen location of this tree's upper left corner, or null
to use the default.