NASA World Wind

gov.nasa.worldwindx.applications.worldwindow.features
Class WMSPanel

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.WMSPanel
All Implemented Interfaces:
Initializable, WWOPanel, Feature, FeaturePanel, NetworkActivitySignal.NetworkUser, ActionListener, PropertyChangeListener, Serializable, Cloneable, EventListener, Action, TreeModelListener

public class WMSPanel
extends AbstractFeaturePanel
implements TreeModelListener, NetworkActivitySignal.NetworkUser

See Also:
Serialized Form

Field Summary
protected static String FEATURE_TITLE
           
protected static String ICON_PATH
           
protected  JButton infoButton
           
protected  LayerTree layerTree
           
protected  Thread loadingThread
           
protected  JTextField nameField
           
protected  URI serverURI
           
protected  JTextField urlField
           
 
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
WMSPanel(Registry registry)
           
 
Method Summary
 void addItemToComboBox(JComboBox cmb, Object item)
           
protected  void addLayer(WMSCapabilities caps, WMSLayerCapabilities layerCaps, LayerTreeGroupNode groupNode, LayerTreeModel model)
          Recursively adds layers to the layer tree.
 void cancel()
           
 void clearPanel()
          Clears the panel.
 void contactWMSServer(String URLString)
          Contact the specified WMS server to get its capabilities document.
protected  void createComponents(JPanel panel)
           
protected  void createLayer(LayerNode layerNode)
           
protected  void createLayerList(WMSCapabilities caps)
           
protected  LayerNode getLayerManagerGroupNode()
           
protected  String getServerDisplayString(WMSCapabilities caps)
           
protected  String getTabTitle()
           
protected  LayerTreeGroupNode getTopGroup()
           
 String getURLString()
           
protected  void handleGroupSelection(LayerTreeGroupNode groupNode)
           
protected  void handleLayerSelection(LayerNode layerNode)
           
 boolean hasNetworkActivity()
           
 void initialize(Controller controller)
           
protected  JPanel makeTopPanel()
           
protected  JPanel makeTreePanel()
           
protected  void setTabTitle(String title)
           
 void treeNodesChanged(TreeModelEvent event)
          Called when the tree cell check box changes.
 void treeNodesInserted(TreeModelEvent treeModelEvent)
           
 void treeNodesRemoved(TreeModelEvent treeModelEvent)
           
 void treeStructureChanged(TreeModelEvent treeModelEvent)
           
 
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, isOn, isTwoState, propertyChange, register, setMenuAccellerator, turnOn
 
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, isOn, isTwoState, turnOn
 
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
 

Field Detail

FEATURE_TITLE

protected static final String FEATURE_TITLE
See Also:
Constant Field Values

ICON_PATH

protected static final String ICON_PATH
See Also:
Constant Field Values

infoButton

protected JButton infoButton

layerTree

protected LayerTree layerTree

loadingThread

protected Thread loadingThread

nameField

protected JTextField nameField

serverURI

protected URI serverURI

urlField

protected JTextField urlField
Constructor Detail

WMSPanel

public WMSPanel(Registry registry)
Method Detail

addItemToComboBox

public void addItemToComboBox(JComboBox cmb,
                              Object item)

addLayer

protected void addLayer(WMSCapabilities caps,
                        WMSLayerCapabilities layerCaps,
                        LayerTreeGroupNode groupNode,
                        LayerTreeModel model)
Recursively adds layers to the layer tree.

Parameters:
caps - the server's capabilities document.
layerCaps - the DOM description of the layer to retrieve.
groupNode - the display group
model - the layer tree model

cancel

public void cancel()

clearPanel

public void clearPanel()
Clears the panel. Any layers currently in the layer manager are left there.


contactWMSServer

public void contactWMSServer(String URLString)
                      throws URISyntaxException
Contact the specified WMS server to get its capabilities document. Then load the layer tree with its contents.

Parameters:
URLString - a text string containing the server's URL.
Throws:
URISyntaxException - if the URL is invalid.

createComponents

protected void createComponents(JPanel panel)

createLayer

protected void createLayer(LayerNode layerNode)

createLayerList

protected void createLayerList(WMSCapabilities caps)

getLayerManagerGroupNode

protected LayerNode getLayerManagerGroupNode()

getServerDisplayString

protected String getServerDisplayString(WMSCapabilities caps)

getTabTitle

protected String getTabTitle()

getTopGroup

protected LayerTreeGroupNode getTopGroup()

getURLString

public String getURLString()

handleGroupSelection

protected void handleGroupSelection(LayerTreeGroupNode groupNode)

handleLayerSelection

protected void handleLayerSelection(LayerNode layerNode)

hasNetworkActivity

public boolean hasNetworkActivity()
Specified by:
hasNetworkActivity in interface NetworkActivitySignal.NetworkUser

initialize

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

makeTopPanel

protected JPanel makeTopPanel()

makeTreePanel

protected JPanel makeTreePanel()

setTabTitle

protected void setTabTitle(String title)

treeNodesChanged

public void treeNodesChanged(TreeModelEvent event)
Called when the tree cell check box changes. Adds and removes the selected layer in the layer manager.

Specified by:
treeNodesChanged in interface TreeModelListener
Parameters:
event - the description of the change.

treeNodesInserted

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

treeNodesRemoved

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

treeStructureChanged

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

NASA World Wind