org.geotools.styling
Class TextSymbolizerImpl

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

public class TextSymbolizerImpl
extends AbstractGTComponent
implements TextSymbolizer2, org.opengis.util.Cloneable

Provides a Java representation of an SLD TextSymbolizer that defines how text symbols should be rendered.

Version:
$Id: TextSymbolizerImpl.java 18021 2006-02-14 20:36:18Z jdeolive $
Author:
Ian Turton, CCG

Field Summary
 
Fields inherited from class org.geotools.event.AbstractGTComponent
notification
 
Constructor Summary
protected TextSymbolizerImpl()
          Creates a new instance of DefaultTextSymbolizer
 
Method Summary
 void accept(StyleVisitor visitor)
          Accept a StyleVisitor to perform an operation on this symbolizer.
 void addFont(Font font)
          Setter for property font.
 void addToOptions(java.lang.String key, java.lang.String value)
          adds a parameter value to the options map
 java.lang.Object clone()
          Creates a deep copy clone.
 boolean equals(java.lang.Object oth)
           
 java.lang.String geometryPropertyName()
          This property defines the geometry to be used for styling.
 Fill getFill()
          Returns the fill to be used to fill the text when rendered.
 Font[] getFonts()
          Returns a device independent Font object that is to be used to render the label.
 java.lang.String getGeometryPropertyName()
          Getter for property geometryPropertyName.
 Graphic getGraphic()
           
 Halo getHalo()
          A halo fills an extended area outside the glyphs of a rendered text label to make the label easier to read over a background.
 Expression getLabel()
          Returns the label expression.
 LabelPlacement getLabelPlacement()
          Deprecated. use getPlacement()
 java.lang.String getOption(java.lang.String key)
          Find the value of a key in the map (may return null)
 java.util.Map getOptions()
          return the map of option
 LabelPlacement getPlacement()
          A pointPlacement specifies how a text element should be rendered relative to its geometric point.
 Expression getPriority()
          Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.
 int hashCode()
           
 void setFill(Fill fill)
          Setter for property fill.
 void setFonts(Font[] fonts)
          Sets the list of fonts in the TextSymbolizer to the provided array of Fonts.
 void setGeometryPropertyName(java.lang.String geometryPropertyName)
          Setter for property geometryPropertyName.
 void setGraphic(Graphic graphic)
           
 void setHalo(Halo halo)
          Setter for property halo.
 void setLabel(Expression label)
          Setter for property label.
 void setLabelPlacement(LabelPlacement labelPlacement)
          Deprecated. use setPlacement(LabelPlacement)
 void setPlacement(LabelPlacement labelPlacement)
          Setter for property labelPlacement.
 void setPriority(Expression priority)
          Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.
 
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

TextSymbolizerImpl

protected TextSymbolizerImpl()
Creates a new instance of DefaultTextSymbolizer

Method Detail

geometryPropertyName

public java.lang.String geometryPropertyName()
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 point types can be used. 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.

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.

getFill

public Fill getFill()
Returns the fill to be used to fill the text when rendered.

Specified by:
getFill in interface TextSymbolizer
Returns:
The fill to be used.

setFill

public void setFill(Fill fill)
Setter for property fill.

Specified by:
setFill in interface TextSymbolizer
Parameters:
fill - New value of property fill.

getFonts

public Font[] getFonts()
Returns a device independent Font object that is to be used to render the label.

Specified by:
getFonts in interface TextSymbolizer
Returns:
Device independent Font object to be used to render the label.

addFont

public void addFont(Font font)
Setter for property font.

Parameters:
font - New value of property font.

setFonts

public void setFonts(Font[] fonts)
Sets the list of fonts in the TextSymbolizer to the provided array of Fonts.

Specified by:
setFonts in interface TextSymbolizer
Parameters:
fonts - The array of fonts to use in the symbolizer.

getHalo

public Halo getHalo()
A halo fills an extended area outside the glyphs of a rendered text label to make the label easier to read over a background.

Specified by:
getHalo in interface TextSymbolizer
Returns:
DOCUMENT ME!

setHalo

public void setHalo(Halo halo)
Setter for property halo.

Specified by:
setHalo in interface TextSymbolizer
Parameters:
halo - New value of property halo.

getLabel

public Expression getLabel()
Returns the label expression.

Specified by:
getLabel in interface TextSymbolizer
Returns:
Label expression.

setLabel

public void setLabel(Expression label)
Setter for property label.

Specified by:
setLabel in interface TextSymbolizer
Parameters:
label - New value of property label.

getPlacement

public LabelPlacement getPlacement()
A pointPlacement specifies how a text element should be rendered relative to its geometric point.

Specified by:
getPlacement in interface TextSymbolizer
Returns:
Value of property labelPlacement.

setPlacement

public void setPlacement(LabelPlacement labelPlacement)
Setter for property labelPlacement.

Specified by:
setPlacement in interface TextSymbolizer
Parameters:
labelPlacement - New value of property labelPlacement.

getLabelPlacement

public LabelPlacement getLabelPlacement()
Deprecated. use getPlacement()

A pointPlacement specifies how a text element should be rendered relative to its geometric point.

Specified by:
getLabelPlacement in interface TextSymbolizer
Returns:
Value of property labelPlacement.

setLabelPlacement

public void setLabelPlacement(LabelPlacement labelPlacement)
Deprecated. use setPlacement(LabelPlacement)

Setter for property labelPlacement.

Specified by:
setLabelPlacement in interface TextSymbolizer
Parameters:
labelPlacement - New value of property labelPlacement.

getGeometryPropertyName

public java.lang.String getGeometryPropertyName()
Getter for property geometryPropertyName.

Specified by:
getGeometryPropertyName in interface TextSymbolizer
Returns:
Value of property geometryPropertyName.

setGeometryPropertyName

public void setGeometryPropertyName(java.lang.String geometryPropertyName)
Setter for property geometryPropertyName.

Specified by:
setGeometryPropertyName in interface TextSymbolizer
Parameters:
geometryPropertyName - New value of property geometryPropertyName.

accept

public void accept(StyleVisitor visitor)
Accept a StyleVisitor to perform an operation on this symbolizer.

Specified by:
accept in interface Symbolizer
Parameters:
visitor - The StyleVisitor 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.AssertionError - DOCUMENT ME!

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object oth)

setPriority

public void setPriority(Expression priority)
Description copied from interface: TextSymbolizer
Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie. Integer, Long, Double...) Larger = more likely to be rendered

Specified by:
setPriority in interface TextSymbolizer
Parameters:
priority -

getPriority

public Expression getPriority()
Description copied from interface: TextSymbolizer
Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie. Integer, Long, Double...) Larger = more likely to be rendered

Specified by:
getPriority in interface TextSymbolizer
Returns:
DOCUMENT ME!

addToOptions

public void addToOptions(java.lang.String key,
                         java.lang.String value)
Description copied from interface: TextSymbolizer
adds a parameter value to the options map

Specified by:
addToOptions in interface TextSymbolizer
Parameters:
key -
value -

getOption

public java.lang.String getOption(java.lang.String key)
Description copied from interface: TextSymbolizer
Find the value of a key in the map (may return null)

Specified by:
getOption in interface TextSymbolizer
Parameters:
key -
Returns:

getOptions

public java.util.Map getOptions()
Description copied from interface: TextSymbolizer
return the map of option

Specified by:
getOptions in interface TextSymbolizer
Returns:
null - no options set

getGraphic

public Graphic getGraphic()
Specified by:
getGraphic in interface TextSymbolizer2

setGraphic

public void setGraphic(Graphic graphic)
Specified by:
setGraphic in interface TextSymbolizer2


Copyright © GeoTools. All Rights Reserved.