org.geotools.map
Class MapLayer

Object
  extended by MapLayer
Direct Known Subclasses:
DefaultMapLayer, FeatureSourceMapLayer, WMSMapLayer

Deprecated. Use an appropriate Layer such as FeatureLayer, GridCoverageLayer or GridReaderLayer

public class MapLayer
extends Object

MapLayer is a clean wrapper around the Layer class used for rendering; primarily used for user interface code.

Please note that not all Layer implementations support Query and/or Style.

Since:
2.0
Author:
Cameron Shorter, Martin Desruisseaux

Field Summary
protected  Layer internal
          Deprecated. This is the internal delegate
 
Constructor Summary
MapLayer(CollectionSource source, Style style, String title)
          Deprecated.  
MapLayer(Collection collection, Style style)
          Deprecated.  
MapLayer(Collection collection, Style style, String title)
          Deprecated.  
MapLayer(FeatureCollection collection, Style style)
          Deprecated. Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter
MapLayer(FeatureCollection collection, Style style, String title)
          Deprecated. Creates a new instance of DefaultMapLayer using a non-emtpy feature collection as a parameter
MapLayer(FeatureSource featureSource, Style style)
          Deprecated. Creates a new instance of DefaultMapLayer
MapLayer(FeatureSource featureSource, Style style, String title)
          Deprecated. Creates a new instance of DefaultMapLayer
MapLayer(GridCoverage2DReader reader, Style style)
          Deprecated. Constructor which adds a new layer and triggers a LayerListEvent.
MapLayer(GridCoverage2DReader reader, Style style, String title)
          Deprecated. Constructor which adds a new layer and trigger a LayerListEvent.
MapLayer(GridCoverage2DReader reader, Style style, String title, GeneralParameterValue[] params)
          Deprecated. Constructor which adds a new layer and trigger a LayerListEvent.
MapLayer(GridCoverage coverage, Style style)
          Deprecated. * Add a new layer and trigger a LayerListEvent.
MapLayer(GridCoverage coverage, Style style, String title)
          Deprecated. * Add a new layer and trigger a LayerListEvent.
MapLayer(Layer layer)
          Deprecated. Wrap up a layer in a DefaultMapLayer; generally used to ensure layer is shown to the world as a feature source even if it happens to be a WMS or something.
 
Method Summary
 void addMapLayerListener(MapLayerListener listener)
          Deprecated. Registers MapLayerListener to receive events.
 boolean equals(Object obj)
          Deprecated. Equals based on internal layer
 ReferencedEnvelope getBounds()
          Deprecated. find out the bounds of the layer
 FeatureSource getFeatureSource()
          Deprecated. Get the feature collection for this layer; if available.
 Query getQuery()
          Deprecated. Returns the definition query (filter) for this layer.
 CollectionSource getSource()
          Deprecated. Get the data source for this layer.
 Style getStyle()
          Deprecated. Get the style for this layer.
 String getTitle()
          Deprecated. Get the title of this layer.
 int hashCode()
          Deprecated. Hashcode based on internal Layer
 boolean isSelected()
          Deprecated. Determine whether this layer is currently selected.
 boolean isVisible()
          Deprecated. Determine whether this layer is visible on a map pane or whether the layer is hidden.
 void removeMapLayerListener(MapLayerListener listener)
          Deprecated. Removes MapLayerListener from the list of listeners.
 void setQuery(Query query)
          Deprecated. Sets a definition query for the layer which acts as a filter for the features that the layer will draw.
 void setSelected(boolean selected)
          Deprecated. Specify whether this layer is selected.
 void setStyle(Style style)
          Deprecated. Sets the style for this layer.
 void setTitle(String title)
          Deprecated. Set the title of this layer.
 void setVisible(boolean visible)
          Deprecated. Specify whether this layer is visible on a map pane or whether the layer is hidden.
 Layer toLayer()
          Deprecated. Access to raw layer object used for rendering.
 String toString()
          Deprecated.  
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

internal

protected Layer internal
Deprecated. 
This is the internal delegate

Constructor Detail

MapLayer

public MapLayer(Layer layer)
Deprecated. 
Wrap up a layer in a DefaultMapLayer; generally used to ensure layer is shown to the world as a feature source even if it happens to be a WMS or something.


MapLayer

public MapLayer(FeatureSource featureSource,
                Style style,
                String title)
Deprecated. 
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:
NullPointerException - DOCUMENT ME!

MapLayer

public MapLayer(CollectionSource source,
                Style style,
                String title)
Deprecated. 

MapLayer

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

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

MapLayer

public MapLayer(FeatureCollection collection,
                Style style,
                String title)
Deprecated. 
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 - Title of map layer

MapLayer

public MapLayer(Collection collection,
                Style style,
                String title)
Deprecated. 

MapLayer

public MapLayer(FeatureCollection collection,
                Style style)
Deprecated. 
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

MapLayer

public MapLayer(Collection collection,
                Style style)
Deprecated. 

MapLayer

public MapLayer(GridCoverage coverage,
                Style style)
         throws TransformException,
                FactoryRegistryException,
                SchemaException
Deprecated. 
* Add a new layer and trigger a LayerListEvent.

Parameters:
coverage - The new layer that has been added.
style -
Throws:
SchemaException
FactoryRegistryException
TransformException

MapLayer

public MapLayer(GridCoverage2DReader reader,
                Style style,
                String title,
                GeneralParameterValue[] params)
         throws TransformException,
                FactoryRegistryException,
                SchemaException
Deprecated. 
Constructor which adds a new layer and trigger a LayerListEvent.

Parameters:
reader - a reader with the new layer that will be added.
style -
title -
params - GeneralParameterValue[] that describe how the AbstractGridCoverage2DReader shall read the images
Throws:
SchemaException
FactoryRegistryException
TransformException

MapLayer

public MapLayer(GridCoverage2DReader reader,
                Style style,
                String title)
Deprecated. 
Constructor which adds a new layer and trigger a LayerListEvent.

Parameters:
reader - a reader with the new layer that will be added.
style -
title -
Throws:
SchemaException
FactoryRegistryException
TransformException

MapLayer

public MapLayer(GridCoverage2DReader reader,
                Style style)
Deprecated. 
Constructor which adds a new layer and triggers a LayerListEvent.

Parameters:
reader - a reader with the new layer that will be added
style -
Throws:
SchemaException
FactoryRegistryException
TransformException

MapLayer

public MapLayer(GridCoverage coverage,
                Style style,
                String title)
         throws TransformException,
                FactoryRegistryException,
                SchemaException
Deprecated. 
* Add a new layer and trigger a LayerListEvent.

Parameters:
coverage - The new layer that has been added.
style -
title -
Throws:
SchemaException
FactoryRegistryException
TransformException
Method Detail

toLayer

public Layer toLayer()
Deprecated. 
Access to raw layer object used for rendering.

Returns:
Layer used for rendering

getFeatureSource

public FeatureSource getFeatureSource()
Deprecated. 
Get the feature collection for this layer; if available.

Returns:
The features for this layer, null if not available.

getSource

public CollectionSource getSource()
Deprecated. 
Get the data source for this layer.

Returns:
Data source for this layer, null if not yet set or if FeatureSource is used

getStyle

public Style getStyle()
Deprecated. 
Get the style for this layer. If style has not been set, then null is returned.

Returns:
The style (SLD).

setStyle

public void setStyle(Style style)
Deprecated. 
Sets the style for this layer. If a style has not been defined a default one is used.

Parameters:
style - The new style

getTitle

public String getTitle()
Deprecated. 
Get the title of this layer. If title has not been defined then an empty string is returned.

Returns:
The title of this layer.

setTitle

public void setTitle(String title)
Deprecated. 
Set the title of this layer. A LayerEvent is fired if the new title is different from the previous one.

Parameters:
title - The title of this layer.

isVisible

public boolean isVisible()
Deprecated. 
Determine whether this layer is visible on a map pane or whether the layer is hidden.

Returns:
true if the layer is visible, or false if the layer is hidden.

setVisible

public void setVisible(boolean visible)
Deprecated. 
Specify whether this layer is visible on a map pane or whether the layer is hidden. A LayerEvent is fired if the visibility changed.

Parameters:
visible - Show the layer if true, or hide the layer if false

isSelected

public boolean isSelected()
Deprecated. 
Determine whether this layer is currently selected.

Returns:
true if the layer is selected, or false otherwise

setSelected

public void setSelected(boolean selected)
Deprecated. 
Specify whether this layer is selected. A LayerEvent iw fired if the selected status is changed.

Parameters:
selected - Set the layer as selected if true or as unselected if false

getQuery

public Query getQuery()
Deprecated. 
Returns the definition query (filter) for this layer. If no definition query has been defined Query.ALL is returned.

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

setQuery

public void setQuery(Query query)
Deprecated. 
Sets a definition query for the layer which acts as a filter for the features that the layer will draw.

A consumer must ensure that this query is used in combination with the bounding box filter generated on each map interaction to limit the number of features returned to those that complains both the definition query and relies inside the area of interest.

IMPORTANT: only include attribute names in the query if you want them to be ALWAYS returned. It is desirable to not include attributes at all but let the renderer decide which attributes are actually needed to perform its required operation.

WARNING: We do not check if your query is suitable for the layer FeatureSource you may accidentally return no features; resulting in an "empty" layer.

Parameters:
query - the full filter for this layer.
Throws:
NullPointerException - if no query is passed on. If you want to reset a definition query, pass it Query.ALL instead of null
See Also:
FeatureLayer.setQuery(org.geotools.data.Query)

getBounds

public ReferencedEnvelope getBounds()
Deprecated. 
find out the bounds of the layer

Returns:
- the layer's bounds

addMapLayerListener

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

Parameters:
listener - The listener to register.

removeMapLayerListener

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

Parameters:
listener - The listener to remove.

hashCode

public int hashCode()
Deprecated. 
Hashcode based on internal Layer

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Deprecated. 
Equals based on internal layer

Overrides:
equals in class Object

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object


Copyright © 1996-2014 Geotools. All Rights Reserved.