es.prodevelop.gvsig.mobile.gui.dialog
Class WMSDialog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byes.prodevelop.gvsig.mobile.gui.dialog.WMSDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable

public class WMSDialog
extends java.awt.Window
implements java.awt.event.MouseListener, java.awt.event.ItemListener

This dialog is used to add a WMS layer to the view. When the user selectes or adds a new URL to the combo, a request is sent to find out the server capabilities, then the other components of the dialog are refreshed. The available layers are presented in a tree-like structure.

Author:
jldominguez
See Also:
WMSLayerListItem, WMSLayerDescription, Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WMSDialog(MainWindow p, boolean repaint)
          Constructor
 
Method Summary
 java.lang.String getCommaSeparatedSelectedInfoableLayerNames(java.lang.String sel)
           
 java.lang.String getCommaSeparatedSelectedInfoableLayers(java.lang.String sel)
           
 java.lang.String getCommaSeparatedSelectedLayers()
           
 java.awt.geom.Rectangle2D getFullExtent(java.lang.String name, java.lang.String srs, java.awt.geom.Rectangle2D def)
          This method is called after the dialog is closed.
 java.lang.String getImageFormat()
          This method is called after the dialog is closed.
 java.util.ArrayList getInfoFormats()
          This method is called after the dialog is closed.
 java.lang.String getServerUrl()
          This method is called after the dialog is closed.
 java.lang.String getSrs()
          This method is called after the dialog is closed.
 void itemStateChanged(java.awt.event.ItemEvent e)
          This event triggers a query to the server, to find out the server capabilities.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void updateCheckboxes()
          This method updates the layer checkboxes after one of them has been checked/unchecked.
 
Methods inherited from class java.awt.Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getAccessibleContext, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WMSDialog

public WMSDialog(MainWindow p,
                 boolean repaint)
Constructor

Parameters:
p - parent (main) window
repaint - whether the map has necessarily to be repainted after adding the new WMS layer. When the WMS layer is added from the TOC, we dont need a refresh.
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
This event triggers a query to the server, to find out the server capabilities. The rest of the components are then updated, or a message error shows.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener

getServerUrl

public java.lang.String getServerUrl()
This method is called after the dialog is closed.

Returns:
the url of the server selected by the user.

getSrs

public java.lang.String getSrs()
This method is called after the dialog is closed.

Returns:
the SRS selected by the user.

getImageFormat

public java.lang.String getImageFormat()
This method is called after the dialog is closed.

Returns:
the format of the images to be requested.

getInfoFormats

public java.util.ArrayList getInfoFormats()
This method is called after the dialog is closed.

Returns:
the format in which the info by point will be received (not selectable by teh user. It's decided by the application after receiving available formats.)

getFullExtent

public java.awt.geom.Rectangle2D getFullExtent(java.lang.String name,
                                               java.lang.String srs,
                                               java.awt.geom.Rectangle2D def)
This method is called after the dialog is closed. Gets the full extent of the layer to be added. This not fully functional. The dialog simply keeps a unique extent for each SRS, regardless of the layers. TODO Keep the extent of each layer for each SRS.

Parameters:
name - layer name
srs - SRS that will be used in the requests
def - default extent to be returned if no data is available
Returns:
the full extent of the layer

updateCheckboxes

public void updateCheckboxes()
This method updates the layer checkboxes after one of them has been checked/unchecked. It has to be public because its called by another component.

See Also:
WMSLayerListItem

getCommaSeparatedSelectedLayers

public java.lang.String getCommaSeparatedSelectedLayers()

getCommaSeparatedSelectedInfoableLayers

public java.lang.String getCommaSeparatedSelectedInfoableLayers(java.lang.String sel)

getCommaSeparatedSelectedInfoableLayerNames

public java.lang.String getCommaSeparatedSelectedInfoableLayerNames(java.lang.String sel)