org.deegree_impl.clients.wmsclient2.control
Class HighlightingListener

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.HighlightingListener
All Implemented Interfaces:
java.util.EventListener, WebListener

public class HighlightingListener
extends AbstractMapListener

This class is for highlighting polygons via a RPC request event from the client. A new WMS request will be created with SLD. The SLD xml file will be created and saved. The WMS request for highlighting will be set.

------------------------------------------------------------------------

Author:
Katharina Lupp Created on 15.02.2004

Field Summary
private  java.lang.String sldUserStyle
           
 
Fields inherited from class org.deegree_impl.enterprise.control.AbstractListener
 
Constructor Summary
HighlightingListener()
           
 
Method Summary
 void actionPerformed(FormEvent event)
           
private  WMSGetMapRequest createRequest(RPCParameter[] para, ViewContext vc)
          creates the modified WMS Request including the URL for the SLD.
private  java.lang.StringBuffer createSLD(GM_Position[] coords, GM_Envelope env, java.lang.String queryLay, ViewContext vc)
          creates the SLD xml file.
private  GM_Position[] getCoordinates(RPCStruct struct)
          calculates the coordinates of the click event.
private  java.lang.String getQueryLayer(FormEvent event, RPCStruct struct)
          gets the layer to be highlighted.
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  void highlight(java.lang.String queryLayer, WMSGetMapRequest gmr, ViewContext vc)
          sets the request for highlighting.
private  void saveSLD(java.lang.StringBuffer sld, ViewContext vc)
          saves the created SLD file.
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
 

Field Detail

sldUserStyle

private java.lang.String sldUserStyle
Constructor Detail

HighlightingListener

public HighlightingListener()
Method Detail

actionPerformed

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

createRequest

private WMSGetMapRequest createRequest(RPCParameter[] para,
                                       ViewContext vc)
                                throws InconsistentRequestException,
                                       XMLParsingException,
                                       java.net.MalformedURLException
creates the modified WMS Request including the URL for the SLD.

Throws:
InconsistentRequestException
XMLParsingException
java.net.MalformedURLException

getCoordinates

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


getQueryLayer

private java.lang.String getQueryLayer(FormEvent event,
                                       RPCStruct struct)
gets the layer to be highlighted.


highlight

private void highlight(java.lang.String queryLayer,
                       WMSGetMapRequest gmr,
                       ViewContext vc)
                throws WebServiceException,
                       java.io.IOException
sets the request for highlighting.

Throws:
WebServiceException
java.io.IOException

createSLD

private java.lang.StringBuffer createSLD(GM_Position[] coords,
                                         GM_Envelope env,
                                         java.lang.String queryLay,
                                         ViewContext vc)
creates the SLD xml file.


saveSLD

private void saveSLD(java.lang.StringBuffer sld,
                     ViewContext vc)
              throws java.io.IOException
saves the created SLD file.

Throws:
java.io.IOException

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.