public class KMLLayerTreeNode extends LayerTreeNode
LayerTreeNode
that represents a KML feature hierarchy defined by a KMLRoot
.KMLFeatureTreeNode
Modifier and Type | Field and Description |
---|---|
protected KMLRoot |
kmlRoot
Indicates the KML feature hierarchy this node represents.
|
DEFAULT_IMAGE, layer
children, description, enabled, imageSource, parent, selected, text, texture, treeSelected, visible
NOT_SELECTED, PARTIALLY_SELECTED, SELECTED
Constructor and Description |
---|
KMLLayerTreeNode(Layer layer,
KMLRoot kmlRoot)
Creates a new
KMLLayerTreeNode from the specified layer and kmlRoot . |
Modifier and Type | Method and Description |
---|---|
protected void |
addChildFeatures()
Adds a new
KMLFeatureTreeNode to this node for each KML feature in the KMLRoot . |
protected void |
addFeatureNode(KMLAbstractFeature feature)
Adds the a new
KMLFeatureTreeNode created with the specified feature to this node. |
void |
expandOpenContainers(Tree tree)
Expands paths in the specified
tree corresponding to open KML container elements. |
protected boolean |
mustExpandNode()
Indicates whether the tree path for this node must expanded.
|
protected void |
refresh()
Refresh the tree model to match the contents of the KML document.
|
void |
setSelected(boolean selected)
Specifies whether this node's layer is enabled for rendering.
|
initialize, isSelected
addChild, addChild, computeTreeSelected, getChildren, getDescription, getImageSource, getParent, getPath, getText, getTexture, hasImage, initializeTexture, isEnabled, isLeaf, isTreeSelected, isVisible, propertyChange, removeAllChildren, removeChild, setDescription, setEnabled, setImageSource, setParent, setVisible
onMessage
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 KMLRoot kmlRoot
public KMLLayerTreeNode(Layer layer, KMLRoot kmlRoot)
KMLLayerTreeNode
from the specified layer
and kmlRoot
. The
node's name is set to the layer's name, and the node's hierarchy is populated from the feature hierarchy of the
KMLRoot
.layer
- the Layer
the kmlRoot
corresponds to.kmlRoot
- the KML feature hierarchy this node represents.java.lang.IllegalArgumentException
- if the layer
is null
, or if kmlRoot
is
null
.protected void addChildFeatures()
KMLFeatureTreeNode
to this node for each KML feature in the KMLRoot
.
If the KMLRoot
's top level feature is a Document
or Folder
, this method
ignores this container and adds its children directly to this node. Creating a node for the container adds an
extra level to the tree node that doesn't provide any meaningful grouping.
This does nothing if the KMLRoot
's top level feature is null
.protected void addFeatureNode(KMLAbstractFeature feature)
KMLFeatureTreeNode
created with the specified feature
to this node.feature
- the KML feature to add.public void expandOpenContainers(Tree tree)
tree
corresponding to open KML container elements. This assumes that
the tree
's model contains this node.
This node's path is expanded if it's top level KML feature is an open KML container, an open KML network link, or
is any other kind of KML feature.
This calls expandOpenContainers
on all children which are instances of
KMLFeatureTreeNode
.tree
- the Tree
who's paths should be expanded.java.lang.IllegalArgumentException
- if the tree
is null.protected boolean mustExpandNode()
KMLRoot
's feature is a KML
container or a KML network link, this returns whether that KML element's open
property is
true
. Otherwise this returns true
true
if the tree path for this node must be expanded, otherwise false
.protected void refresh()
public void setSelected(boolean selected)
setSelected
in interface TreeNode
setSelected
in class LayerTreeNode
selected
- true
to enable the layer, otherwise false
.TreeNode.isSelected()