org.geotools.styling
Class PolygonSymbolizerImpl

java.lang.Object
  extended byorg.geotools.event.AbstractGTComponent
      extended byorg.geotools.styling.PolygonSymbolizerImpl
All Implemented Interfaces:
java.lang.Cloneable, org.opengis.util.Cloneable, GTComponent, PolygonSymbolizer, Symbolizer

public class PolygonSymbolizerImpl
extends AbstractGTComponent
implements PolygonSymbolizer, org.opengis.util.Cloneable

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

Version:
$Id: PolygonSymbolizerImpl.java 17701 2006-01-23 00:00:51Z desruisseaux $
Author:
James Macgill, CCG

Field Summary
 
Fields inherited from class org.geotools.event.AbstractGTComponent
notification
 
Constructor Summary
protected PolygonSymbolizerImpl()
          Creates a new instance of DefaultPolygonStyler
 
Method Summary
 void accept(StyleVisitor visitor)
          Accepts a StyleVisitor to perform some operation on this LineSymbolizer.
 java.lang.Object clone()
          Creates a deep copy clone.
 boolean equals(java.lang.Object oth)
          Compares this PolygonSymbolizerImpl with another.
 Fill getFill()
          Provides the graphical-symbolization parameter to use to fill the area of the geometry.
 java.lang.String getGeometryPropertyName()
          This property defines the geometry to be used for styling.
 Stroke getStroke()
          Provides the graphical-symbolization parameter to use for the outline of the Polygon.
 int hashCode()
          Generates a hashcode for the PolygonSymbolizerImpl.
 void setFill(Fill fill)
          Sets the graphical-symbolization parameter to use to fill the area of the geometry.
 void setGeometryPropertyName(java.lang.String name)
          Sets the GeometryPropertyName.
 void setStroke(Stroke stroke)
          Sets the graphical-symbolization parameter to use for the outline of the Polygon.
 
Methods inherited from class org.geotools.event.AbstractGTComponent
changed, fireChanged, fireChildChanged, getNote, getParent, removed, setNote
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.event.GTComponent
changed, getNote, getParent, removed, setNote
 

Constructor Detail

PolygonSymbolizerImpl

protected PolygonSymbolizerImpl()
Creates a new instance of DefaultPolygonStyler

Method Detail

getGeometryPropertyName

public java.lang.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 PolygonSymbolizer
Returns:
String 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(java.lang.String name)
Sets the GeometryPropertyName.

Specified by:
setGeometryPropertyName in interface PolygonSymbolizer
Parameters:
name - The name of the GeometryProperty.
See Also:
#PolygonSymbolizerImpl.geometryPropertyName()

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.

Specified by:
setFill in interface PolygonSymbolizer
Parameters:
fill - The Fill style to use when rendering the area.

getStroke

public Stroke 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.

Specified by:
setStroke in interface PolygonSymbolizer
Parameters:
stroke - The Stroke style to use when rendering lines.

accept

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

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

clone

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

Specified by:
clone in interface org.opengis.util.Cloneable
Overrides:
clone in class AbstractGTComponent
Returns:
The deep copy clone.
Throws:
java.lang.RuntimeException - DOCUMENT ME!

hashCode

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

Returns:
A hashcode.

equals

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

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

Parameters:
oth - the object to compare against.
Returns:
true if oth is equal to this object.


Copyright © GeoTools. All Rights Reserved.