org.deegree_impl.clients.wmsclient2.control
Class HighlightingInfoListener

java.lang.Object
  extended byorg.deegree_impl.enterprise.control.AbstractListener
      extended byorg.deegree_impl.clients.wmsclient2.control.AbstractMapListener
          extended byorg.deegree_impl.clients.wmsclient2.control.HighlightingInfoListener
All Implemented Interfaces:
java.util.EventListener, WebListener

public class HighlightingInfoListener
extends AbstractMapListener

This class is for accessing informations about the highlighted polygons A new WFS GetFeature request will be created and performed

Since:
1.1
Version:
$Revision$, 1.0. $Revision$, $Date$
Author:
Andreas Poth, last edited by: $Author$

Field Summary
 
Fields inherited from class org.deegree_impl.enterprise.control.AbstractListener
 
Constructor Summary
HighlightingInfoListener()
           
 
Method Summary
 void actionPerformed(FormEvent event)
           
private  java.lang.String createRequest(java.lang.String[] queryLayers, GM_Position[] coords, double[] box)
          creates a WFS GetFeature request from the passed layers (feature types) and the coordinates.
private  GM_Position[] getCoordinates(RPCStruct struct)
          calculates the coordinates of the click event.
private  java.lang.String[] getQueryLayers(RPCStruct struct)
          gets the layer to be highlighted.
private  java.net.URL getResponsibleWFS(java.lang.String queryLayer)
          returns the URL of the WFS that is responsible for accessing the data of the passed layer/featuretype
protected  double getScale(WMSGetMapRequest mrm)
          the method returns the scale of the map defined as diagonal size of a pixel at the center of the map.
private  FeatureCollection performGetFeature(java.lang.String request, java.net.URL wfsURL)
          performs a GetFeature request against the responsible WFS
protected  java.util.HashMap toMap(java.lang.String request)
          maps a string representation of a request to a HashMap
 
Methods inherited from class org.deegree_impl.enterprise.control.AbstractListener
getAlternativeNextPage, getNextPage, getRequest, getReturnValue, gotoErrorPage, handle, setAlternativeNextPage, setDefaultAlternativeNextPage, setDefaultNextPage, setNextPage, setReturnValue, toModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HighlightingInfoListener

public HighlightingInfoListener()
Method Detail

actionPerformed

public void actionPerformed(FormEvent event)
Specified by:
actionPerformed in interface WebListener
Overrides:
actionPerformed in class AbstractMapListener
Parameters:
event -

getQueryLayers

private java.lang.String[] getQueryLayers(RPCStruct struct)
gets the layer to be highlighted.


getResponsibleWFS

private java.net.URL getResponsibleWFS(java.lang.String queryLayer)
                                throws ClientException
returns the URL of the WFS that is responsible for accessing the data of the passed layer/featuretype

Parameters:
queryLayer - layer to determine the responsible WFS for data access
Throws:
ClientException

getCoordinates

private GM_Position[] getCoordinates(RPCStruct struct)
calculates the coordinates of the click event.


createRequest

private java.lang.String createRequest(java.lang.String[] queryLayers,
                                       GM_Position[] coords,
                                       double[] box)
creates a WFS GetFeature request from the passed layers (feature types) and the coordinates. The least are used to create the filter conditions.

Parameters:
queryLayers - names of the layers/featuretypes that will be targeted by the request
coords - coordinates to be used as filter conditions (intersect)
box - relevant bounding box

performGetFeature

private FeatureCollection performGetFeature(java.lang.String request,
                                            java.net.URL wfsURL)
                                     throws ClientException
performs a GetFeature request against the responsible WFS

Throws:
ClientException

toMap

protected java.util.HashMap toMap(java.lang.String request)
maps a string representation of a request to a HashMap


getScale

protected double getScale(WMSGetMapRequest mrm)
the method returns the scale of the map defined as diagonal size of a pixel at the center of the map.