Class LayerManagerPanel
- java.lang.Object
-
- javax.swing.AbstractAction
-
- gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
-
- gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeaturePanel
-
- gov.nasa.worldwindx.applications.worldwindow.features.swinglayermanager.LayerManagerPanel
-
- All Implemented Interfaces:
Initializable
,LayerManager
,WWOPanel
,Feature
,FeaturePanel
,java.awt.event.ActionListener
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,javax.swing.event.TreeModelListener
public class LayerManagerPanel extends AbstractFeaturePanel implements LayerManager, javax.swing.event.TreeModelListener
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeaturePanel
panel
-
Fields inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
controller, featureID
-
-
Constructor Summary
Constructors Constructor Description LayerManagerPanel(Registry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGroup(LayerPath pathToGroup)
void
addLayer(Layer layer, LayerPath pathToParent)
void
addLayer(LayerNode layerNode, LayerPath pathToParent)
boolean
containsPath(LayerPath pathToGroup)
protected void
createLayer(LayerNode layerNode)
protected LayerTreeNode
createPath(LayerPath path)
void
enableGroupSelection(LayerPath path, boolean tf)
Enables or disables the ability to select a group as a whole and therby enable or disable all layers in that group.void
expandGroup(java.lang.String groupName)
Expands the display of the group so that all layers are visibly listed.void
expandPath(LayerPath path)
Layer
findLayerByTitle(java.lang.String layerTitle, java.lang.String groupTitle)
java.lang.String
getDefaultGroupName()
LayerPath
getDefaultGroupPath()
Returns a path to the group node of the default layer group, which is the group holding the base layers.Layer
getLayerFromPath(LayerPath path)
Returns the layer at the end of a specified path.protected LayerTreeModel
getModel()
LayerNode
getNode(LayerPath path)
protected void
handleGroupSelection(LayerTreeNode group, LayerList layerList)
protected void
handleLayerSelection(LayerTreeNode treeNode, LayerList layerList)
void
initialize(Controller controller)
protected boolean
insertAfterPreviousSibling(LayerTreeNode treeNode, LayerList layerList)
protected boolean
insertBeforeSubsequentSibling(LayerTreeNode treeNode, LayerList layerList)
boolean
isOn()
boolean
isTwoState()
Indicates whether the feature can be either on or off, without any other states.protected void
performSmartInsertion(LayerTreeNode treeNode, LayerList layerList)
void
redraw()
void
removeLayer(Layer layer)
void
removeLayer(LayerPath path)
void
removeLayer(LayerNode layerNode)
void
removeLayers(LayerList layerList)
void
scrollToLayer(Layer layer)
void
selectLayer(Layer layer, boolean tf)
void
treeNodesChanged(javax.swing.event.TreeModelEvent event)
void
treeNodesInserted(javax.swing.event.TreeModelEvent event)
void
treeNodesRemoved(javax.swing.event.TreeModelEvent event)
void
treeStructureChanged(javax.swing.event.TreeModelEvent event)
void
turnOn(boolean tf)
protected void
updateGroupSelection(LayerTreeNode groupNode)
protected void
updateGroupSelections()
-
Methods inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeaturePanel
getDialogControls, getJPanel
-
Methods inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
actionPerformed, addToToolBar, doActionPerformed, doPropertyChange, getController, getFeatureID, getName, getStringValue, isInitialized, propertyChange, register, setMenuAccellerator
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Methods inherited from interface gov.nasa.worldwindx.applications.worldwindow.features.Feature
getFeatureID, getName
-
Methods inherited from interface gov.nasa.worldwindx.applications.worldwindow.core.Initializable
isInitialized
-
-
-
-
Constructor Detail
-
LayerManagerPanel
public LayerManagerPanel(Registry registry)
-
-
Method Detail
-
initialize
public void initialize(Controller controller)
- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAbstractFeaturePanel
-
getModel
protected LayerTreeModel getModel()
-
redraw
public void redraw()
- Specified by:
redraw
in interfaceLayerManager
-
isTwoState
public boolean isTwoState()
Description copied from interface:Feature
Indicates whether the feature can be either on or off, without any other states. This is used by the tool bar and menu-bar menus to determine whether the feature's enable/disable button or menu item should be displayed with an indicator that it's either on or off. In the case of a menu the indicator is a check box. In the case of a tool bar button the indicator is a dot above the button.- Specified by:
isTwoState
in interfaceFeature
- Overrides:
isTwoState
in classAbstractFeature
- Returns:
- true if the feature has only two states, otherwise off.
-
isOn
public boolean isOn()
- Specified by:
isOn
in interfaceFeature
- Overrides:
isOn
in classAbstractFeature
-
turnOn
public void turnOn(boolean tf)
- Specified by:
turnOn
in interfaceFeature
- Overrides:
turnOn
in classAbstractFeature
-
scrollToLayer
public void scrollToLayer(Layer layer)
- Specified by:
scrollToLayer
in interfaceLayerManager
-
expandGroup
public void expandGroup(java.lang.String groupName)
Description copied from interface:LayerManager
Expands the display of the group so that all layers are visibly listed.- Specified by:
expandGroup
in interfaceLayerManager
- Parameters:
groupName
- the name of the group.
-
expandPath
public void expandPath(LayerPath path)
- Specified by:
expandPath
in interfaceLayerManager
-
enableGroupSelection
public void enableGroupSelection(LayerPath path, boolean tf)
Description copied from interface:LayerManager
Enables or disables the ability to select a group as a whole and therby enable or disable all layers in that group. For some layer groups, such as the base group, it's not appropriate to turn them all on or all off.- Specified by:
enableGroupSelection
in interfaceLayerManager
- Parameters:
path
- the path to the group.tf
- true if group selection should be allowed, false if group selection should not be allowed.
-
treeNodesChanged
public void treeNodesChanged(javax.swing.event.TreeModelEvent event)
- Specified by:
treeNodesChanged
in interfacejavax.swing.event.TreeModelListener
-
handleLayerSelection
protected void handleLayerSelection(LayerTreeNode treeNode, LayerList layerList)
-
updateGroupSelections
protected void updateGroupSelections()
-
updateGroupSelection
protected void updateGroupSelection(LayerTreeNode groupNode)
-
handleGroupSelection
protected void handleGroupSelection(LayerTreeNode group, LayerList layerList)
-
performSmartInsertion
protected void performSmartInsertion(LayerTreeNode treeNode, LayerList layerList)
-
insertAfterPreviousSibling
protected boolean insertAfterPreviousSibling(LayerTreeNode treeNode, LayerList layerList)
-
insertBeforeSubsequentSibling
protected boolean insertBeforeSubsequentSibling(LayerTreeNode treeNode, LayerList layerList)
-
treeNodesInserted
public void treeNodesInserted(javax.swing.event.TreeModelEvent event)
- Specified by:
treeNodesInserted
in interfacejavax.swing.event.TreeModelListener
-
treeNodesRemoved
public void treeNodesRemoved(javax.swing.event.TreeModelEvent event)
- Specified by:
treeNodesRemoved
in interfacejavax.swing.event.TreeModelListener
-
treeStructureChanged
public void treeStructureChanged(javax.swing.event.TreeModelEvent event)
- Specified by:
treeStructureChanged
in interfacejavax.swing.event.TreeModelListener
-
getDefaultGroupName
public java.lang.String getDefaultGroupName()
-
getDefaultGroupPath
public LayerPath getDefaultGroupPath()
Description copied from interface:LayerManager
Returns a path to the group node of the default layer group, which is the group holding the base layers.- Specified by:
getDefaultGroupPath
in interfaceLayerManager
- Returns:
- a path to the default group node.
-
addGroup
public void addGroup(LayerPath pathToGroup)
- Specified by:
addGroup
in interfaceLayerManager
-
containsPath
public boolean containsPath(LayerPath pathToGroup)
- Specified by:
containsPath
in interfaceLayerManager
-
getNode
public LayerNode getNode(LayerPath path)
- Specified by:
getNode
in interfaceLayerManager
-
selectLayer
public void selectLayer(Layer layer, boolean tf)
- Specified by:
selectLayer
in interfaceLayerManager
-
findLayerByTitle
public Layer findLayerByTitle(java.lang.String layerTitle, java.lang.String groupTitle)
- Specified by:
findLayerByTitle
in interfaceLayerManager
-
addLayer
public void addLayer(Layer layer, LayerPath pathToParent)
- Specified by:
addLayer
in interfaceLayerManager
-
createPath
protected LayerTreeNode createPath(LayerPath path)
-
removeLayer
public void removeLayer(Layer layer)
- Specified by:
removeLayer
in interfaceLayerManager
-
removeLayer
public void removeLayer(LayerNode layerNode)
-
removeLayers
public void removeLayers(LayerList layerList)
- Specified by:
removeLayers
in interfaceLayerManager
-
removeLayer
public void removeLayer(LayerPath path)
- Specified by:
removeLayer
in interfaceLayerManager
-
getLayerFromPath
public Layer getLayerFromPath(LayerPath path)
Description copied from interface:LayerManager
Returns the layer at the end of a specified path.- Specified by:
getLayerFromPath
in interfaceLayerManager
- Parameters:
path
- the path to the layer.- Returns:
- the layer at the end of the path, or null if no layer is there.
-
createLayer
protected void createLayer(LayerNode layerNode)
-
-