org.n52.oxf.layer
Class FeatureLayer

java.lang.Object
  extended by org.n52.oxf.layer.AbstractLayer
      extended by org.n52.oxf.layer.FeatureLayer
All Implemented Interfaces:
EventListener, IContextLayer, IFeatureLayer, IContextSerializableXML, IEventEmitter, IEventListener

public class FeatureLayer
extends AbstractLayer
implements IFeatureLayer

A layer to paint the given features if no requests to services are needed for updates. This class initializes the feature collection on instantiation and just renders these again and again.

Author:
Daniel NĂ¼st

Field Summary
 
Fields inherited from class org.n52.oxf.layer.AbstractLayer
broken, description, eventSupport, hidden, idName, layerVisualization, parameterContainer, renderer, timeStamp, title
 
Constructor Summary
FeatureLayer(String identificationName, String title, String layerSourceTitle, String layerSourceType, IFeatureDataRenderer renderer, IFeaturePicker featurePicker, OXFFeatureCollection collection)
           
 
Method Summary
 void clearSelection()
           
 void eventCaught(OXFEvent event)
          This method gets called when an OXFEvent is caught.
 IBoundingBox getBBox()
           
 OXFFeatureCollection getFeatureCollection()
           
 IFeatureStore getFeatureStore()
           
 String getLayerSourceTitle()
           
 String getLayerSourceType()
           
 IVisualization getLayerVisualization()
           
 FeatureLayerProcessor getProcessor()
           
 IFeatureDataRenderer getRenderer()
           
 Set<OXFFeature> getSelectedFeatures()
           
 String getSrs()
           
 Set<OXFFeature> pickFeature(int x, int y)
          This method returns a Set of all OXFFeatures of this Layer drawn at screen-position (x, y).
 Set<OXFFeature> pickFeature(int llX, int llY, int urX, int urY)
          This method returns a Set of all OXFFeatures of this Layer drawn inside the Screen-BoundingBox specified by the lowerLeft-corner (llX, llY) and the upperRight-corner (urX, urY).
 void serializeToContext(StringBuffer sb)
          serializes the implementing class (downwardly) compatible to the "Web Map Context Documents" Specification (OGC 05-005) of the OGC in version 1.1.0.
 void setFeatureCollection(OXFFeatureCollection featureCollection)
          sets the actual collection of features.
 void setSelectedFeatures(Set<OXFFeature> selectedFeatures)
          this method should be primarly be invoked by the method selectFeatures() of the LayerContext class.
 
Methods inherited from class org.n52.oxf.layer.AbstractLayer
addEventListener, getDescription, getIDName, getParameterContainer, getTimeStamp, getTitle, isBroken, isHidden, refreshParameterContainer, removeEventListener, setBroken, setHidden, setIDName, setLayerVisualization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.n52.oxf.layer.IContextLayer
getDescription, getIDName, getParameterContainer, getTimeStamp, getTitle, isBroken, isHidden, refreshParameterContainer, setHidden
 
Methods inherited from interface org.n52.oxf.util.IEventEmitter
addEventListener, removeEventListener
 

Constructor Detail

FeatureLayer

public FeatureLayer(String identificationName,
                    String title,
                    String layerSourceTitle,
                    String layerSourceType,
                    IFeatureDataRenderer renderer,
                    IFeaturePicker featurePicker,
                    OXFFeatureCollection collection)
Method Detail

getLayerVisualization

public IVisualization getLayerVisualization()
Specified by:
getLayerVisualization in interface IContextLayer
Overrides:
getLayerVisualization in class AbstractLayer

eventCaught

public void eventCaught(OXFEvent event)
                 throws OXFEventException
Description copied from interface: IEventListener
This method gets called when an OXFEvent is caught.

Specified by:
eventCaught in interface IEventListener
Overrides:
eventCaught in class AbstractLayer
Parameters:
event - A OXFEvent object describing the event source and the property that has changed.
Throws:
OXFEventException

getProcessor

public FeatureLayerProcessor getProcessor()
Specified by:
getProcessor in class AbstractLayer
Returns:
an LayerProcessor which can be used to execute the "request - and - render - data"-process in a separate Thread.

clearSelection

public void clearSelection()
Specified by:
clearSelection in interface IFeatureLayer

getFeatureCollection

public OXFFeatureCollection getFeatureCollection()
Specified by:
getFeatureCollection in interface IFeatureLayer
Returns:
the actual collection of features that will be portrayed in this layer. A null value is allowed and indicates that nothing will be drawn.

getFeatureStore

public IFeatureStore getFeatureStore()
Specified by:
getFeatureStore in interface IFeatureLayer
Returns:

getSelectedFeatures

public Set<OXFFeature> getSelectedFeatures()
Specified by:
getSelectedFeatures in interface IFeatureLayer
Returns:
the currently selected Set of features in this Layer.

pickFeature

public Set<OXFFeature> pickFeature(int x,
                                   int y)
Description copied from interface: IFeatureLayer
This method returns a Set of all OXFFeatures of this Layer drawn at screen-position (x, y).

Specified by:
pickFeature in interface IFeatureLayer
Returns:
a List of all OXFFeatures of this Layer drawn at screen-position (x, y).

pickFeature

public Set<OXFFeature> pickFeature(int llX,
                                   int llY,
                                   int urX,
                                   int urY)
Description copied from interface: IFeatureLayer
This method returns a Set of all OXFFeatures of this Layer drawn inside the Screen-BoundingBox specified by the lowerLeft-corner (llX, llY) and the upperRight-corner (urX, urY).

Specified by:
pickFeature in interface IFeatureLayer
Returns:

setFeatureCollection

public void setFeatureCollection(OXFFeatureCollection featureCollection)
Description copied from interface: IFeatureLayer
sets the actual collection of features.

Specified by:
setFeatureCollection in interface IFeatureLayer

setSelectedFeatures

public void setSelectedFeatures(Set<OXFFeature> selectedFeatures)
Description copied from interface: IFeatureLayer
this method should be primarly be invoked by the method selectFeatures() of the LayerContext class. That will clear all current selections.

Specified by:
setSelectedFeatures in interface IFeatureLayer

getBBox

public IBoundingBox getBBox()
Specified by:
getBBox in interface IContextLayer
Returns:
the BBOX associated with this Layer or null if there is none.

getLayerSourceTitle

public String getLayerSourceTitle()
Specified by:
getLayerSourceTitle in interface IContextLayer

getLayerSourceType

public String getLayerSourceType()
Specified by:
getLayerSourceType in interface IContextLayer

getSrs

public String getSrs()
Specified by:
getSrs in interface IContextLayer
Returns:
the SRS associated with this Layer or null if there is none.

serializeToContext

public void serializeToContext(StringBuffer sb)
Description copied from interface: IContextSerializableXML
serializes the implementing class (downwardly) compatible to the "Web Map Context Documents" Specification (OGC 05-005) of the OGC in version 1.1.0.

Specified by:
serializeToContext in interface IContextSerializableXML

getRenderer

public IFeatureDataRenderer getRenderer()
Specified by:
getRenderer in interface IContextLayer
Overrides:
getRenderer in class AbstractLayer


Copyright © 2005 - 2010 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.