org.geotools.map
Class DefaultMapLayer

java.lang.Object
  extended byorg.geotools.map.DefaultMapLayer
All Implemented Interfaces:
MapLayer

public class DefaultMapLayer
extends java.lang.Object
implements MapLayer

Default implementation of the MapLayer implementation

Author:
wolf

Field Summary
protected  FeatureSource featureSource
          Holds value of property FeatureSource.
protected  javax.swing.event.EventListenerList listenerList
          Utility field used by event firing mechanism.
protected  Query query
          The query to limit the number of rendered features based on its filter
protected  FeatureListener sourceListener
          Listener to forward feature source events as layer events
protected  Style style
          The style to symbolize the features of this layer
protected  java.lang.String title
          Holds value of property title.
protected  boolean visible
          Whether this layer is visible or not.
 
Constructor Summary
DefaultMapLayer(FeatureCollection collection, Style style)
          Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter
DefaultMapLayer(FeatureCollection collection, Style style, java.lang.String title)
          Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter
DefaultMapLayer(FeatureSource featureSource, Style style)
          Creates a new instance of DefaultMapLayer
DefaultMapLayer(FeatureSource featureSource, Style style, java.lang.String title)
          Creates a new instance of DefaultMapLayer
 
Method Summary
 void addMapLayerListener(MapLayerListener listener)
          Registers MapLayerListener to receive events.
 FeatureSource getFeatureSource()
          Getter for property featureSource.
 Query getQuery()
          Returns the definition query established for this layer.
 Style getStyle()
          Getter for property style.
 java.lang.String getTitle()
          Getter for property title.
 boolean isVisible()
          Getter for property visible.
 void removeMapLayerListener(MapLayerListener listener)
          Removes MapLayerListener from the list of listeners.
 void setQuery(Query query)
          Sets a definition query for this layer.
 void setStyle(Style style)
          Setter for property style.
 void setTitle(java.lang.String title)
          Setter for property title.
 void setVisible(boolean visible)
          Setter for property visible.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

featureSource

protected FeatureSource featureSource
Holds value of property FeatureSource.


style

protected Style style
The style to symbolize the features of this layer


query

protected Query query
The query to limit the number of rendered features based on its filter


title

protected java.lang.String title
Holds value of property title.


visible

protected boolean visible
Whether this layer is visible or not.


listenerList

protected javax.swing.event.EventListenerList listenerList
Utility field used by event firing mechanism.


sourceListener

protected FeatureListener sourceListener
Listener to forward feature source events as layer events

Constructor Detail

DefaultMapLayer

public DefaultMapLayer(FeatureSource featureSource,
                       Style style,
                       java.lang.String title)
Creates a new instance of DefaultMapLayer

Parameters:
featureSource - the data source for this layer
style - the style used to represent this layer
title - the layer title
Throws:
java.lang.NullPointerException - DOCUMENT ME!

DefaultMapLayer

public DefaultMapLayer(FeatureSource featureSource,
                       Style style)
Creates a new instance of DefaultMapLayer

Parameters:
featureSource - the data source for this layer
style - the style used to represent this layer

DefaultMapLayer

public DefaultMapLayer(FeatureCollection collection,
                       Style style,
                       java.lang.String title)
Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter

Parameters:
collection - the source feature collection
style - the style used to represent this layer
title - DOCUMENT ME!

DefaultMapLayer

public DefaultMapLayer(FeatureCollection collection,
                       Style style)
Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter

Parameters:
collection - the source feature collection
style - the style used to represent this layer
Method Detail

getFeatureSource

public FeatureSource getFeatureSource()
Getter for property featureSource.

Specified by:
getFeatureSource in interface MapLayer
Returns:
Value of property featureSource.

getStyle

public Style getStyle()
Getter for property style.

Specified by:
getStyle in interface MapLayer
Returns:
Value of property style.

setStyle

public void setStyle(Style style)
Setter for property style.

Specified by:
setStyle in interface MapLayer
Parameters:
style - New value of property style.
Throws:
java.lang.NullPointerException - DOCUMENT ME!

getTitle

public java.lang.String getTitle()
Getter for property title.

Specified by:
getTitle in interface MapLayer
Returns:
Value of property title.

setTitle

public void setTitle(java.lang.String title)
Setter for property title.

Specified by:
setTitle in interface MapLayer
Parameters:
title - New value of property title.
Throws:
java.lang.NullPointerException - DOCUMENT ME!

isVisible

public boolean isVisible()
Getter for property visible.

Specified by:
isVisible in interface MapLayer
Returns:
Value of property visible.

setVisible

public void setVisible(boolean visible)
Setter for property visible.

Specified by:
setVisible in interface MapLayer
Parameters:
visible - New value of property visible.

getQuery

public Query getQuery()
Returns the definition query established for this layer.

Specified by:
getQuery in interface MapLayer
Returns:
the definition query established for this layer. If not set, just returns Query.ALL, if set, returns a copy of the actual query object to avoid external modification
See Also:
MapLayer.getQuery()

setQuery

public void setQuery(Query query)
Sets a definition query for this layer.

If present (other than Query.ALL, a renderer or consumer must use it to limit the number of returned features based on the filter it holds and the value of the maxFeatures attributes, and also can use it as a performance hto limit the number of requested attributes

Specified by:
setQuery in interface MapLayer
Parameters:
query - the full filter for this layer.
Throws:
java.lang.NullPointerException - if no query is passed on. If you want to reset a definition query, pass it Query.ALL instead of null
See Also:
MapLayer.setQuery(org.geotools.data.Query)
Task:
TODO: test that the query filter is siutable for the layer's FeatureSource schema

addMapLayerListener

public void addMapLayerListener(MapLayerListener listener)
Registers MapLayerListener to receive events.

Specified by:
addMapLayerListener in interface MapLayer
Parameters:
listener - The listener to register.

removeMapLayerListener

public void removeMapLayerListener(MapLayerListener listener)
Removes MapLayerListener from the list of listeners.

Specified by:
removeMapLayerListener in interface MapLayer
Parameters:
listener - The listener to remove.

toString

public java.lang.String toString()


Copyright © GeoTools. All Rights Reserved.