org.geotools.styling
Class TextSymbolizerImpl

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

public class TextSymbolizerImpl
extends java.lang.Object
implements TextSymbolizer, org.opengis.util.Cloneable

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

Version:
$Id: TextSymbolizerImpl.java,v 1.17 2003/09/06 04:52:31 seangeo Exp $
Author:
Ian Turton, CCG

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.
 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()
          A pointPlacement specifies how a text element should be rendered relative to its geometric point.
 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
 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 setHalo(Halo halo)
          Setter for property halo.
 void setLabel(Expression label)
          Setter for property label.
 void setLabelPlacement(LabelPlacement labelPlacement)
          Setter for property labelPlacement.
 void setPriority(Expression e)
          Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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

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.

getLabelPlacement

public LabelPlacement getLabelPlacement()
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)
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 TextSymbolizer
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
Returns:
The deep copy clone.

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object oth)

setPriority

public void setPriority(Expression e)
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:
e -

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

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


Copyright © GeoTools. All Rights Reserved.