NASA World Wind

gov.nasa.worldwindx.applications.worldwindow.features.swinglayermanager
Class LayerManagerPanel

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
          extended by gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeaturePanel
              extended by gov.nasa.worldwindx.applications.worldwindow.features.swinglayermanager.LayerManagerPanel
All Implemented Interfaces:
Initializable, LayerManager, WWOPanel, Feature, FeaturePanel, ActionListener, PropertyChangeListener, Serializable, Cloneable, EventListener, Action, TreeModelListener

public class LayerManagerPanel
extends AbstractFeaturePanel
implements LayerManager, 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
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
LayerManagerPanel(Registry registry)
           
 
Method Summary
 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(String groupName)
          Expands the display of the group so that all layers are visibly listed.
 void expandPath(LayerPath path)
           
 Layer findLayerByTitle(String layerTitle, String groupTitle)
           
 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(LayerNode layerNode)
           
 void removeLayer(LayerPath path)
           
 void removeLayers(LayerList layerList)
           
 void scrollToLayer(Layer layer)
           
 void selectLayer(Layer layer, boolean tf)
           
 void treeNodesChanged(TreeModelEvent event)
           
 void treeNodesInserted(TreeModelEvent event)
           
 void treeNodesRemoved(TreeModelEvent event)
           
 void treeStructureChanged(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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

LayerManagerPanel

public LayerManagerPanel(Registry registry)
Method Detail

addGroup

public void addGroup(LayerPath pathToGroup)
Specified by:
addGroup in interface LayerManager

addLayer

public void addLayer(Layer layer,
                     LayerPath pathToParent)
Specified by:
addLayer in interface LayerManager

addLayer

public void addLayer(LayerNode layerNode,
                     LayerPath pathToParent)

containsPath

public boolean containsPath(LayerPath pathToGroup)
Specified by:
containsPath in interface LayerManager

createLayer

protected void createLayer(LayerNode layerNode)

createPath

protected LayerTreeNode createPath(LayerPath path)

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 interface LayerManager
Parameters:
path - the path to the group.
tf - true if group selection should be allowed, false if group selection should not be allowed.

expandGroup

public void expandGroup(String groupName)
Description copied from interface: LayerManager
Expands the display of the group so that all layers are visibly listed.

Specified by:
expandGroup in interface LayerManager
Parameters:
groupName - the name of the group.

expandPath

public void expandPath(LayerPath path)
Specified by:
expandPath in interface LayerManager

findLayerByTitle

public Layer findLayerByTitle(String layerTitle,
                              String groupTitle)
Specified by:
findLayerByTitle in interface LayerManager

getDefaultGroupName

public 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 interface LayerManager
Returns:
a path to the default group node.

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 interface LayerManager
Parameters:
path - the path to the layer.
Returns:
the layer at the end of the path, or null if no layer is there.

getModel

protected LayerTreeModel getModel()

getNode

public LayerNode getNode(LayerPath path)
Specified by:
getNode in interface LayerManager

handleGroupSelection

protected void handleGroupSelection(LayerTreeNode group,
                                    LayerList layerList)

handleLayerSelection

protected void handleLayerSelection(LayerTreeNode treeNode,
                                    LayerList layerList)

initialize

public void initialize(Controller controller)
Specified by:
initialize in interface Initializable
Overrides:
initialize in class AbstractFeaturePanel

insertAfterPreviousSibling

protected boolean insertAfterPreviousSibling(LayerTreeNode treeNode,
                                             LayerList layerList)

insertBeforeSubsequentSibling

protected boolean insertBeforeSubsequentSibling(LayerTreeNode treeNode,
                                                LayerList layerList)

isOn

public boolean isOn()
Specified by:
isOn in interface Feature
Overrides:
isOn in class AbstractFeature

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 interface Feature
Overrides:
isTwoState in class AbstractFeature
Returns:
true if the feature has only two states, otherwise off.

performSmartInsertion

protected void performSmartInsertion(LayerTreeNode treeNode,
                                     LayerList layerList)

redraw

public void redraw()
Specified by:
redraw in interface LayerManager

removeLayer

public void removeLayer(Layer layer)
Specified by:
removeLayer in interface LayerManager

removeLayer

public void removeLayer(LayerNode layerNode)

removeLayer

public void removeLayer(LayerPath path)
Specified by:
removeLayer in interface LayerManager

removeLayers

public void removeLayers(LayerList layerList)
Specified by:
removeLayers in interface LayerManager

scrollToLayer

public void scrollToLayer(Layer layer)
Specified by:
scrollToLayer in interface LayerManager

selectLayer

public void selectLayer(Layer layer,
                        boolean tf)
Specified by:
selectLayer in interface LayerManager

treeNodesChanged

public void treeNodesChanged(TreeModelEvent event)
Specified by:
treeNodesChanged in interface TreeModelListener

treeNodesInserted

public void treeNodesInserted(TreeModelEvent event)
Specified by:
treeNodesInserted in interface TreeModelListener

treeNodesRemoved

public void treeNodesRemoved(TreeModelEvent event)
Specified by:
treeNodesRemoved in interface TreeModelListener

treeStructureChanged

public void treeStructureChanged(TreeModelEvent event)
Specified by:
treeStructureChanged in interface TreeModelListener

turnOn

public void turnOn(boolean tf)
Specified by:
turnOn in interface Feature
Overrides:
turnOn in class AbstractFeature

updateGroupSelection

protected void updateGroupSelection(LayerTreeNode groupNode)

updateGroupSelections

protected void updateGroupSelections()

NASA World Wind