org.deegree_impl.graphics
Class FeatureLayer_Impl

java.lang.Object
  extended byorg.deegree_impl.graphics.Layer_Impl
      extended byorg.deegree_impl.graphics.FeatureLayer_Impl
All Implemented Interfaces:
FeatureLayer, Layer

class FeatureLayer_Impl
extends Layer_Impl
implements FeatureLayer

A Layer is a collection of Features building a thematic 'unit' waterways or country borders for example. Features can be added or removed from the layer. A Feature can e changed by a modul of the application using the layer because only references to Features are stored within a layer.

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

Version:
$Revision: 1.9 $ $Date: 2004/02/27 07:48:09 $
Author:
Andreas Poth

Field Summary
protected  GM_Envelope boundingbox
           
protected  CoordinateSystem crs
           
protected  CS_CoordinateSystem cs
           
protected  java.util.List eventController
           
protected  FeatureCollection fc
           
 
Constructor Summary
(package private) FeatureLayer_Impl(java.lang.String name)
          creates a layer with EPSG:4326 as default coordinate system
(package private) FeatureLayer_Impl(java.lang.String name, CS_CoordinateSystem crs)
          Creates a new FeatureLayer_Impl object.
(package private) FeatureLayer_Impl(java.lang.String name, CS_CoordinateSystem crs, FeatureCollection fc)
          Creates a new Layer_Impl object.
 
Method Summary
 void addEventController(LayerEventController obj)
          adds an eventcontroller to the MapView that's reponsible for handling events that targets the map.
 void addFeature(Feature feature)
          adds a feature to the layer
 void addFeatureCollection(FeatureCollection featureCollection)
          adds a feature collection to the layer
 Feature[] getAllFeatures()
          returns all features
 GM_Envelope getBoundingBox()
          returns the BoundingBox (Envelope) of Layer.
 CS_CoordinateSystem getCoordinatesSystem()
          returns the coordinate reference system of the MapView
 Feature getFeature(int index)
          returns the feature that matches the submitted index
 Feature getFeatureById(java.lang.String id)
          returns the feature that matches the submitted id
 Feature[] getFeaturesById(java.lang.String[] ids)
          returns the feature that matches the submitted id
 java.lang.String getName()
          returns the name of the layer
 int getSize()
          returns the amount of features within the layer.
private  void init(FeatureCollection feature)
          initializes serveral parameters of the layer and homogenizes the coordinate reference systems of the features
private  void recalculateBoundingbox()
           
 void removeEventController(LayerEventController obj)
           
 void removeFeature(Feature feature)
          removes a display Element from the layer
 void removeFeature(int id)
          removes the display Element from the layer that matches the submitted id
 void setCoordinatesSystem(CS_CoordinateSystem crs)
          sets the coordinate reference system of the MapView.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.graphics.Layer
addEventController, getBoundingBox, getCoordinatesSystem, getName, removeEventController
 

Field Detail

fc

protected FeatureCollection fc

cs

protected CS_CoordinateSystem cs

crs

protected CoordinateSystem crs

boundingbox

protected GM_Envelope boundingbox

eventController

protected java.util.List eventController
Constructor Detail

FeatureLayer_Impl

FeatureLayer_Impl(java.lang.String name)
            throws java.lang.Exception
creates a layer with EPSG:4326 as default coordinate system


FeatureLayer_Impl

FeatureLayer_Impl(java.lang.String name,
                  CS_CoordinateSystem crs)
            throws java.lang.Exception
Creates a new FeatureLayer_Impl object.

Parameters:
name -
crs -
Throws:
java.lang.Exception

FeatureLayer_Impl

FeatureLayer_Impl(java.lang.String name,
                  CS_CoordinateSystem crs,
                  FeatureCollection fc)
            throws java.lang.Exception
Creates a new Layer_Impl object.

Parameters:
name -
crs -
fc -
Throws:
java.lang.Exception
Method Detail

init

private void init(FeatureCollection feature)
           throws java.lang.Exception
initializes serveral parameters of the layer and homogenizes the coordinate reference systems of the features

Throws:
java.lang.Exception

recalculateBoundingbox

private void recalculateBoundingbox()

getFeatureById

public Feature getFeatureById(java.lang.String id)
returns the feature that matches the submitted id

Specified by:
getFeatureById in interface FeatureLayer

getFeaturesById

public Feature[] getFeaturesById(java.lang.String[] ids)
returns the feature that matches the submitted id

Specified by:
getFeaturesById in interface FeatureLayer

getFeature

public Feature getFeature(int index)
returns the feature that matches the submitted index

Specified by:
getFeature in interface FeatureLayer

getAllFeatures

public Feature[] getAllFeatures()
returns all features

Specified by:
getAllFeatures in interface FeatureLayer

addFeature

public void addFeature(Feature feature)
                throws java.lang.Exception
adds a feature to the layer

Specified by:
addFeature in interface FeatureLayer
Throws:
java.lang.Exception

addFeatureCollection

public void addFeatureCollection(FeatureCollection featureCollection)
                          throws java.lang.Exception
adds a feature collection to the layer

Specified by:
addFeatureCollection in interface FeatureLayer
Throws:
java.lang.Exception

removeFeature

public void removeFeature(Feature feature)
                   throws java.lang.Exception
removes a display Element from the layer

Specified by:
removeFeature in interface FeatureLayer
Throws:
java.lang.Exception

removeFeature

public void removeFeature(int id)
                   throws java.lang.Exception
removes the display Element from the layer that matches the submitted id

Specified by:
removeFeature in interface FeatureLayer
Throws:
java.lang.Exception

getSize

public int getSize()
returns the amount of features within the layer.

Specified by:
getSize in interface FeatureLayer

setCoordinatesSystem

public void setCoordinatesSystem(CS_CoordinateSystem crs)
                          throws java.lang.Exception
sets the coordinate reference system of the MapView. If a new crs is set all geometries of GeometryFeatures will be transformed to the new coordinate reference system.

Specified by:
setCoordinatesSystem in interface Layer
Throws:
java.lang.Exception

getName

public java.lang.String getName()
returns the name of the layer

Specified by:
getName in interface Layer

getBoundingBox

public GM_Envelope getBoundingBox()
returns the BoundingBox (Envelope) of Layer. This is the BoundingBox of the layers data. The BoundingBox of the View maybe larger or smaler

Specified by:
getBoundingBox in interface Layer

getCoordinatesSystem

public CS_CoordinateSystem getCoordinatesSystem()
returns the coordinate reference system of the MapView

Specified by:
getCoordinatesSystem in interface Layer

addEventController

public void addEventController(LayerEventController obj)
adds an eventcontroller to the MapView that's reponsible for handling events that targets the map. E.g.: zooming, panning, selecting a feature etc.

Specified by:
addEventController in interface Layer

removeEventController

public void removeEventController(LayerEventController obj)
Specified by:
removeEventController in interface Layer
See Also:
Layer_Impl.addEventController(LayerEventController)