org.geotools.styling
Class PolygonSymbolizerImpl

Object
  extended by PolygonSymbolizerImpl
All Implemented Interfaces:
Cloneable, PolygonSymbolizer, Symbolizer

public class PolygonSymbolizerImpl
extends Object
implements PolygonSymbolizer, Cloneable

Provides a representation of a PolygonSymbolizer in an SLD Document. A PolygonSymbolizer defines how a polygon geometry should be rendered.

Author:
James Macgill, CCG, Johann Sorel (Geomatys)
Module:
modules/library/main (gt-main.jar)

Constructor Summary
protected PolygonSymbolizerImpl()
          Creates a new instance of DefaultPolygonStyler
protected PolygonSymbolizerImpl(Stroke stroke, Fill fill, Displacement disp, Expression offset, Unit<Length> uom, String geom, String name, Description desc)
           
 
Method Summary
 void accept(StyleVisitor visitor)
           
 Object accept(StyleVisitor visitor, Object data)
          Accepts a StyleVisitor to perform some operation on this LineSymbolizer.
 Object clone()
          Creates a deep copy clone.
 boolean equals(Object oth)
          Compares this PolygonSymbolizerImpl with another.
 Description getDescription()
           
 Displacement getDisplacement()
           
 Fill getFill()
          Provides the graphical-symbolization parameter to use to fill the area of the geometry.
 String getGeometryPropertyName()
          This property defines the geometry to be used for styling.
 String getName()
           
 Expression getPerpendicularOffset()
           
 StrokeImpl getStroke()
          Provides the graphical-symbolization parameter to use for the outline of the Polygon.
 Unit<Length> getUnitOfMeasure()
           
 int hashCode()
          Generates a hashcode for the PolygonSymbolizerImpl.
 void setDescription(Description description)
           
 void setDisplacement(Displacement displacement)
           
 void setFill(Fill fill)
          Sets the graphical-symbolization parameter to use to fill the area of the geometry.
 void setGeometryPropertyName(String name)
          Sets the GeometryPropertyName.
 void setName(String name)
           
 void setPerpendicularOffset(Expression offset)
           
 void setStroke(Stroke stroke)
          Sets the graphical-symbolization parameter to use for the outline of the Polygon.
 void setUnitOfMeasure(Unit<Length> uom)
           
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonSymbolizerImpl

protected PolygonSymbolizerImpl()
Creates a new instance of DefaultPolygonStyler


PolygonSymbolizerImpl

protected PolygonSymbolizerImpl(Stroke stroke,
                                Fill fill,
                                Displacement disp,
                                Expression offset,
                                Unit<Length> uom,
                                String geom,
                                String name,
                                Description desc)
Method Detail

getName

public String getName()
Specified by:
getName in interface Symbolizer

setName

public void setName(String name)

getDescription

public Description getDescription()
Specified by:
getDescription in interface Symbolizer

setDescription

public void setDescription(Description description)

getGeometryPropertyName

public String getGeometryPropertyName()
This property defines the geometry to be used for styling.
The property is optional and if it is absent (null) then the "default" geometry property of the feature should be used. Geometry types other than inherently area types can be used. If a line is used then the line string is closed for filling (only) by connecting its end point to its start point. The geometryPropertyName is the name of a geometry property in the Feature being styled. Typically, features only have one geometry so, in general, the need to select one is not required. Note: this moves a little away from the SLD spec which provides an XPath reference to a Geometry object, but does follow it in spirit.

Specified by:
getGeometryPropertyName in interface Symbolizer
Returns:
The name of the attribute in the feature being styled that should be used. If null then the default geometry should be used.

setGeometryPropertyName

public void setGeometryPropertyName(String name)
Sets the GeometryPropertyName.

Parameters:
name - The name of the GeometryProperty.
See Also:
#PolygonSymbolizerImpl.geometryPropertyName()

getUnitOfMeasure

public Unit<Length> getUnitOfMeasure()
Specified by:
getUnitOfMeasure in interface Symbolizer

setUnitOfMeasure

public void setUnitOfMeasure(Unit<Length> uom)

getPerpendicularOffset

public Expression getPerpendicularOffset()
Specified by:
getPerpendicularOffset in interface PolygonSymbolizer

setPerpendicularOffset

public void setPerpendicularOffset(Expression offset)

getDisplacement

public Displacement getDisplacement()
Specified by:
getDisplacement in interface PolygonSymbolizer

setDisplacement

public void setDisplacement(Displacement displacement)

getFill

public Fill getFill()
Provides the graphical-symbolization parameter to use to fill the area of the geometry.

Specified by:
getFill in interface PolygonSymbolizer
Returns:
The Fill style to use when rendering the area.

setFill

public void setFill(Fill fill)
Sets the graphical-symbolization parameter to use to fill the area of the geometry.

Parameters:
fill - The Fill style to use when rendering the area.

getStroke

public StrokeImpl getStroke()
Provides the graphical-symbolization parameter to use for the outline of the Polygon.

Specified by:
getStroke in interface PolygonSymbolizer
Returns:
The Stroke style to use when rendering lines.

setStroke

public void setStroke(Stroke stroke)
Sets the graphical-symbolization parameter to use for the outline of the Polygon.

Parameters:
stroke - The Stroke style to use when rendering lines.

accept

public Object accept(StyleVisitor visitor,
                     Object data)
Accepts a StyleVisitor to perform some operation on this LineSymbolizer.

Specified by:
accept in interface PolygonSymbolizer
Specified by:
accept in interface Symbolizer
Parameters:
visitor - The visitor to accept.

accept

public void accept(StyleVisitor visitor)

clone

public Object clone()
Creates a deep copy clone. TODO: Need to complete the deep copy, currently only shallow copy.

Overrides:
clone in class Object
Returns:
The deep copy clone.
Throws:
RuntimeException - DOCUMENT ME!

hashCode

public int hashCode()
Generates a hashcode for the PolygonSymbolizerImpl.

Overrides:
hashCode in class Object
Returns:
A hashcode.

equals

public boolean equals(Object oth)
Compares this PolygonSymbolizerImpl with another.

Two PolygonSymbolizerImpls are equal if they have the same geometryProperty, fill and stroke.

Overrides:
equals in class Object
Parameters:
oth - the object to compare against.
Returns:
true if oth is equal to this object.


Copyright © 1996-2009 Geotools. All Rights Reserved.