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 voidaddGroup(LayerPath pathToGroup)voidaddLayer(Layer layer, LayerPath pathToParent)voidaddLayer(LayerNode layerNode, LayerPath pathToParent)booleancontainsPath(LayerPath pathToGroup)protected voidcreateLayer(LayerNode layerNode)protected LayerTreeNodecreatePath(LayerPath path)voidenableGroupSelection(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.voidexpandGroup(java.lang.String groupName)Expands the display of the group so that all layers are visibly listed.voidexpandPath(LayerPath path)LayerfindLayerByTitle(java.lang.String layerTitle, java.lang.String groupTitle)java.lang.StringgetDefaultGroupName()LayerPathgetDefaultGroupPath()Returns a path to the group node of the default layer group, which is the group holding the base layers.LayergetLayerFromPath(LayerPath path)Returns the layer at the end of a specified path.protected LayerTreeModelgetModel()LayerNodegetNode(LayerPath path)protected voidhandleGroupSelection(LayerTreeNode group, LayerList layerList)protected voidhandleLayerSelection(LayerTreeNode treeNode, LayerList layerList)voidinitialize(Controller controller)protected booleaninsertAfterPreviousSibling(LayerTreeNode treeNode, LayerList layerList)protected booleaninsertBeforeSubsequentSibling(LayerTreeNode treeNode, LayerList layerList)booleanisOn()booleanisTwoState()Indicates whether the feature can be either on or off, without any other states.protected voidperformSmartInsertion(LayerTreeNode treeNode, LayerList layerList)voidredraw()voidremoveLayer(Layer layer)voidremoveLayer(LayerPath path)voidremoveLayer(LayerNode layerNode)voidremoveLayers(LayerList layerList)voidscrollToLayer(Layer layer)voidselectLayer(Layer layer, boolean tf)voidtreeNodesChanged(javax.swing.event.TreeModelEvent event)voidtreeNodesInserted(javax.swing.event.TreeModelEvent event)voidtreeNodesRemoved(javax.swing.event.TreeModelEvent event)voidtreeStructureChanged(javax.swing.event.TreeModelEvent event)voidturnOn(boolean tf)protected voidupdateGroupSelection(LayerTreeNode groupNode)protected voidupdateGroupSelections()-
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:
initializein interfaceInitializable- Overrides:
initializein classAbstractFeaturePanel
-
getModel
protected LayerTreeModel getModel()
-
redraw
public void redraw()
- Specified by:
redrawin interfaceLayerManager
-
isTwoState
public boolean isTwoState()
Description copied from interface:FeatureIndicates 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:
isTwoStatein interfaceFeature- Overrides:
isTwoStatein classAbstractFeature- Returns:
- true if the feature has only two states, otherwise off.
-
isOn
public boolean isOn()
- Specified by:
isOnin interfaceFeature- Overrides:
isOnin classAbstractFeature
-
turnOn
public void turnOn(boolean tf)
- Specified by:
turnOnin interfaceFeature- Overrides:
turnOnin classAbstractFeature
-
scrollToLayer
public void scrollToLayer(Layer layer)
- Specified by:
scrollToLayerin interfaceLayerManager
-
expandGroup
public void expandGroup(java.lang.String groupName)
Description copied from interface:LayerManagerExpands the display of the group so that all layers are visibly listed.- Specified by:
expandGroupin interfaceLayerManager- Parameters:
groupName- the name of the group.
-
expandPath
public void expandPath(LayerPath path)
- Specified by:
expandPathin interfaceLayerManager
-
enableGroupSelection
public void enableGroupSelection(LayerPath path, boolean tf)
Description copied from interface:LayerManagerEnables 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:
enableGroupSelectionin 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:
treeNodesChangedin 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:
treeNodesInsertedin interfacejavax.swing.event.TreeModelListener
-
treeNodesRemoved
public void treeNodesRemoved(javax.swing.event.TreeModelEvent event)
- Specified by:
treeNodesRemovedin interfacejavax.swing.event.TreeModelListener
-
treeStructureChanged
public void treeStructureChanged(javax.swing.event.TreeModelEvent event)
- Specified by:
treeStructureChangedin interfacejavax.swing.event.TreeModelListener
-
getDefaultGroupName
public java.lang.String getDefaultGroupName()
-
getDefaultGroupPath
public LayerPath getDefaultGroupPath()
Description copied from interface:LayerManagerReturns a path to the group node of the default layer group, which is the group holding the base layers.- Specified by:
getDefaultGroupPathin interfaceLayerManager- Returns:
- a path to the default group node.
-
addGroup
public void addGroup(LayerPath pathToGroup)
- Specified by:
addGroupin interfaceLayerManager
-
containsPath
public boolean containsPath(LayerPath pathToGroup)
- Specified by:
containsPathin interfaceLayerManager
-
getNode
public LayerNode getNode(LayerPath path)
- Specified by:
getNodein interfaceLayerManager
-
selectLayer
public void selectLayer(Layer layer, boolean tf)
- Specified by:
selectLayerin interfaceLayerManager
-
findLayerByTitle
public Layer findLayerByTitle(java.lang.String layerTitle, java.lang.String groupTitle)
- Specified by:
findLayerByTitlein interfaceLayerManager
-
addLayer
public void addLayer(Layer layer, LayerPath pathToParent)
- Specified by:
addLayerin interfaceLayerManager
-
createPath
protected LayerTreeNode createPath(LayerPath path)
-
removeLayer
public void removeLayer(Layer layer)
- Specified by:
removeLayerin interfaceLayerManager
-
removeLayer
public void removeLayer(LayerNode layerNode)
-
removeLayers
public void removeLayers(LayerList layerList)
- Specified by:
removeLayersin interfaceLayerManager
-
removeLayer
public void removeLayer(LayerPath path)
- Specified by:
removeLayerin interfaceLayerManager
-
getLayerFromPath
public Layer getLayerFromPath(LayerPath path)
Description copied from interface:LayerManagerReturns the layer at the end of a specified path.- Specified by:
getLayerFromPathin 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)
-
-