com.esri.adf.web.data.graphics
Class GraphicsLayer

java.lang.Object
  extended by com.esri.adf.web.data.graphics.GraphicsLayer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GroupGraphicsLayer

public class GraphicsLayer
extends Object
implements Serializable

GraphicLayer is a class that is used for representing a layer of GraphicFeatures.

See Also:
Serialized Form

Constructor Summary
GraphicsLayer()
          Creates and empty instance of GraphicsLayer.
GraphicsLayer(String name, boolean visible, WebRenderer renderer, WebRenderer highlightRenderer, String infoTemplate, List<? extends GraphicFeature> graphicFeatures)
           
 
Method Summary
 void addGraphicFeature(GraphicFeature feature)
          Adds a feature to the layer.
 void drawLayer(WebElementConverter converter, WebExtent extent, WebSpatialReference spatialReference)
          Draws the layer.
 boolean equals(Object gLayer)
           
 String getCalloutTemplate()
          Returns a callout template string.
 List<GraphicFeature> getGraphicsFeatures()
          Returns the list of graphic features in the layer.
 WebRenderer getHighlightRenderer()
          Return layer highlight renderer.
 int getId()
          Returns layer ID
 String getName()
          Returns layer name.
 WebRenderer getRenderer()
          Returns layer renderer.
protected static WebSymbol getSymbol(WebClassBreaksRenderer wcbr, Map<String,String> attributes)
           
protected static WebSymbol getSymbol(WebUniqueValueRenderer wuvr, Map<String,String> attributes)
           
 boolean isVisible()
          Returns true if the layer is visible, false otherwise.
 void removeAllGraphicFeatures()
          Removes all features from the layer.
 void removeGraphicFeature(GraphicFeature feature)
          Removes a feature from the layer.
 void setCalloutTemplate(String calloutTemplate)
          Sets a callout template string.
 void setHighlightRenderer(WebRenderer highlightRenderer)
          Sets layer highlight renderer.
 void setName(String layerName)
          Sets layer name.
 void setRenderer(WebRenderer renderer)
          Sets layer renderer.
 void setVisible(boolean visible)
          Sets the visibility flag.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsLayer

public GraphicsLayer()
Creates and empty instance of GraphicsLayer.


GraphicsLayer

public GraphicsLayer(String name,
                     boolean visible,
                     WebRenderer renderer,
                     WebRenderer highlightRenderer,
                     String infoTemplate,
                     List<? extends GraphicFeature> graphicFeatures)
Method Detail

equals

public boolean equals(Object gLayer)
Overrides:
equals in class Object

isVisible

public boolean isVisible()
Returns true if the layer is visible, false otherwise.

Returns:
the visibility of the layer

setVisible

public void setVisible(boolean visible)
Sets the visibility flag.

Parameters:
visible - visibility flag

getId

public int getId()
Returns layer ID

Returns:
layer ID

getName

public String getName()
Returns layer name.

Returns:
layer name

setName

public void setName(String layerName)
Sets layer name.

Parameters:
layerName - layer name

getRenderer

public WebRenderer getRenderer()
Returns layer renderer.

Returns:
layer renderer

setRenderer

public void setRenderer(WebRenderer renderer)
Sets layer renderer. If the specified renderer is of type WebGroupRenderer while creating TOC Swatches the very first renderer is used for drawing. com.esri.adf.web.data.renderer.WebGroupRenderer#getRenderer(0)

Parameters:
renderer - layer renderer

getHighlightRenderer

public WebRenderer getHighlightRenderer()
Return layer highlight renderer.

Returns:
layer highlight renderer

setHighlightRenderer

public void setHighlightRenderer(WebRenderer highlightRenderer)
Sets layer highlight renderer.

Parameters:
highlightRenderer - layer highlight renderer

getCalloutTemplate

public String getCalloutTemplate()
Returns a callout template string. The template string can be used for formatting callout info.

Returns:
a callout template string.

setCalloutTemplate

public void setCalloutTemplate(String calloutTemplate)
Sets a callout template string. The template string can be used for formatting callout info.

Parameters:
calloutTemplate - a callout template string

addGraphicFeature

public void addGraphicFeature(GraphicFeature feature)
Adds a feature to the layer.

Parameters:
feature - a graphics feature to be added

removeGraphicFeature

public void removeGraphicFeature(GraphicFeature feature)
Removes a feature from the layer.

Parameters:
feature - a graphics feature to be removed

removeAllGraphicFeatures

public void removeAllGraphicFeatures()
Removes all features from the layer.


getGraphicsFeatures

public List<GraphicFeature> getGraphicsFeatures()
Returns the list of graphic features in the layer.

Returns:
the list of graphic features in the layer

getSymbol

protected static WebSymbol getSymbol(WebClassBreaksRenderer wcbr,
                                     Map<String,String> attributes)

getSymbol

protected static WebSymbol getSymbol(WebUniqueValueRenderer wuvr,
                                     Map<String,String> attributes)

drawLayer

public void drawLayer(WebElementConverter converter,
                      WebExtent extent,
                      WebSpatialReference spatialReference)
Draws the layer.

Parameters:
converter - is an input/output parameter that holds the image on which the layer is drawn
extent - spatial extent of the layer
spatialReference - all feature geometries in the layer are projected using this spatial reference before drawing