org.geotools.styling
Class TextSymbolizerImpl

Object
  extended by TextSymbolizerImpl
All Implemented Interfaces:
Cloneable, Symbolizer, TextSymbolizer, TextSymbolizer2

public class TextSymbolizerImpl
extends Object
implements TextSymbolizer2, Cloneable

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

Author:
Ian Turton, CCG
Module:

Constructor Summary
protected TextSymbolizerImpl()
           
protected TextSymbolizerImpl(FilterFactory factory)
          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(String key, String value)
          adds a parameter value to the options map
 Object clone()
          Creates a deep copy clone.
 boolean equals(Object oth)
           
 String geometryPropertyName()
          This property defines the geometry to be used for styling.
 Expression getFeatureDescription()
          Description is used by text oriented renders such as KML and RSS to specify a feature's description
 Fill getFill()
          Returns the fill to be used to fill the text when rendered.
 Font getFont()
          Font to use when rendering this symbolizer.
 Font[] getFonts()
          Returns a device independent Font object that is to be used to render the label.
 String getGeometryPropertyName()
          Getter for property geometryPropertyName.
 Graphic getGraphic()
          The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.
 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()
 String getOption(String key)
          Find the value of a key in the map (may return null)
 Map<String,String> getOptions()
          return the map of option
 OtherText getOtherText()
          Other text can be used to allow open ended extensions on text oriented output formats
 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.
 Expression getSnippet()
          Abstract is used by text oriented renderers such as KML and RSS to specify an abstract (RSS) or a snippet (KML)
 int hashCode()
           
 void setFeatureDescription(Expression description)
           
 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(String geometryPropertyName)
          Setter for property geometryPropertyName.
 void setGraphic(Graphic graphic)
          The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.
 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 setOtherText(OtherText otherText)
           
 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.
 void setSnippet(Expression abxtract)
           
 String toString()
           
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextSymbolizerImpl

protected TextSymbolizerImpl()

TextSymbolizerImpl

protected TextSymbolizerImpl(FilterFactory factory)
Creates a new instance of DefaultTextSymbolizer

Method Detail

geometryPropertyName

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

getFont

public Font getFont()
Description copied from interface: TextSymbolizer
Font to use when rendering this symbolizer.

Specified by:
getFont in interface TextSymbolizer
Returns:
Font to use when rendering this symbolizer

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 String getGeometryPropertyName()
Getter for property geometryPropertyName.

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

setGeometryPropertyName

public void setGeometryPropertyName(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 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:
AssertionError - DOCUMENT ME!

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

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

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(String key,
                         String value)
Description copied from interface: TextSymbolizer
adds a parameter value to the options map

Specified by:
addToOptions in interface TextSymbolizer

getOption

public String getOption(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

getOptions

public Map<String,String> 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()
Description copied from interface: TextSymbolizer2
The nonstandard-SLD graphic element supports putting little graphical-bits onto labels. Useful for things like interstate road shields or labeled logos

Specified by:
getGraphic in interface TextSymbolizer2
Returns:
- the Graphic object to be rendered under the label text

setGraphic

public void setGraphic(Graphic graphic)
Description copied from interface: TextSymbolizer2
The nonstandard-SLD graphic element supports putting little graphical-bits onto labels. Useful for things like interstate road shields or labeled logos

Specified by:
setGraphic in interface TextSymbolizer2
Parameters:
graphic - - the Graphic object which will be rendered under the label text

toString

public String toString()
Overrides:
toString in class Object

getSnippet

public Expression getSnippet()
Description copied from interface: TextSymbolizer2
Abstract is used by text oriented renderers such as KML and RSS to specify an abstract (RSS) or a snippet (KML)

Specified by:
getSnippet in interface TextSymbolizer2
Returns:

setSnippet

public void setSnippet(Expression abxtract)
Specified by:
setSnippet in interface TextSymbolizer2

getFeatureDescription

public Expression getFeatureDescription()
Description copied from interface: TextSymbolizer2
Description is used by text oriented renders such as KML and RSS to specify a feature's description

Specified by:
getFeatureDescription in interface TextSymbolizer2
Returns:

setFeatureDescription

public void setFeatureDescription(Expression description)
Specified by:
setFeatureDescription in interface TextSymbolizer2

getOtherText

public OtherText getOtherText()
Description copied from interface: TextSymbolizer2
Other text can be used to allow open ended extensions on text oriented output formats

Specified by:
getOtherText in interface TextSymbolizer2
Returns:

setOtherText

public void setOtherText(OtherText otherText)
Specified by:
setOtherText in interface TextSymbolizer2


Copyright © 1996-2009 Geotools. All Rights Reserved.