org.geotools.styling
Interface TextSymbolizer

All Superinterfaces:
GTComponent, Symbolizer
All Known Subinterfaces:
TextSymbolizer2
All Known Implementing Classes:
TextSymbolizerImpl

public interface TextSymbolizer
extends Symbolizer

A symbolizer describes how a feature should appear on a map.

A symbolizer is obtained by specifying one of a small number of different types of symbolizer and then supplying parameters to override its default behaviour.

The text symbolizer describes how to display text labels and the like.

The details of this object are taken from the OGC Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.:


 <xsd:element name="TextSymbolizer" substitutionGroup="sld:Symbolizer">
   <xsd:annotation>
     <xsd:documentation>
       A "TextSymbolizer" is used to render text labels according to
       various graphical parameters.
     </xsd:documentation>
   </xsd:annotation>
   <xsd:complexType>
     <xsd:complexContent>
       <xsd:extension base="sld:SymbolizerType">
         <xsd:sequence>
           <xsd:element ref="sld:Geometry" minOccurs="0"/>
           <xsd:element ref="sld:Label" minOccurs="0"/>
           <xsd:element ref="sld:Font" minOccurs="0"/>
           <xsd:element ref="sld:LabelPlacement" minOccurs="0"/>
           <xsd:element ref="sld:Halo" minOccurs="0"/>
           <xsd:element ref="sld:Fill" minOccurs="0"/>
         </xsd:sequence>
       </xsd:extension>
     </xsd:complexContent>
   </xsd:complexType>
 </xsd:element>
 

Renderers can use this information when displaying styled features, though it must be remembered that not all renderers will be able to fully represent strokes as set out by this interface. For example, opacity may not be supported.

Notes:

$Id: TextSymbolizer.java 18021 2006-02-14 20:36:18Z jdeolive $

Author:
Ian Turton, CCG

Method Summary
 void addToOptions(java.lang.String key, java.lang.String value)
          adds a parameter value to the options map
 Fill getFill()
          Returns the object that indicates how the text will be filled.
 Font[] getFonts()
          Returns a device independent Font object that is to be used to render the label.
 java.lang.String getGeometryPropertyName()
          This property defines the geometry to be used for styling.
 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 expression that will be evaluated to determine what text is displayed.
 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 LabelPlacement specifies how a text element should be rendered relative to its geometric point or line.
 Expression getPriority()
          Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.
 void setFill(Fill fill)
          Sets the object that indicates how the text will be filled.
 void setFonts(Font[] fonts)
          sets a list of device independent Font objects to be used to render the label.
 void setGeometryPropertyName(java.lang.String name)
          This property defines the geometry to be used for styling.
 void setHalo(Halo halo)
          A halo fills an extended area outside the glyphs of a rendered text label to make the label easier to read over a background.
 void setLabel(Expression label)
          Sets the expression that will be evaluated to determine what text is displayed.
 void setLabelPlacement(LabelPlacement labelPlacement)
          Deprecated. use setPlacement(LabelPlacement)
 void setPlacement(LabelPlacement labelPlacement)
          A LabelPlacement specifies how a text element should be rendered relative to its geometric point or line.
 void setPriority(Expression e)
          Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.
 
Methods inherited from interface org.geotools.styling.Symbolizer
accept
 
Methods inherited from interface org.geotools.event.GTComponent
changed, getNote, getParent, removed, setNote
 

Method Detail

getLabel

public Expression getLabel()
Returns the expression that will be evaluated to determine what text is displayed.

Returns:
DOCUMENT ME!

setLabel

public void setLabel(Expression label)
Sets the expression that will be evaluated to determine what text is displayed. See getLabel() for details.

Parameters:
label - DOCUMENT ME!

getFonts

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

Returns:
DOCUMENT ME!

setFonts

public void setFonts(Font[] fonts)
sets a list of device independent Font objects to be used to render the label.

Parameters:
fonts - DOCUMENT ME!

getPlacement

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

Returns:
DOCUMENT ME!
Since:
Geotools 2.2 (GeoAPI 2.0)

getLabelPlacement

public LabelPlacement getLabelPlacement()
Deprecated. use getPlacement()

A LabelPlacement specifies how a text element should be rendered relative to its geometric point or line.

Returns:
DOCUMENT ME!

setLabelPlacement

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

A LabelPlacement specifies how a text element should be rendered relative to its geometric point or line.

Parameters:
labelPlacement - DOCUMENT ME!

setPlacement

public void setPlacement(LabelPlacement labelPlacement)
A LabelPlacement specifies how a text element should be rendered relative to its geometric point or line.

Parameters:
labelPlacement - DOCUMENT ME!

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.

Returns:
DOCUMENT ME!

setHalo

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

Parameters:
halo - DOCUMENT ME!

getFill

public Fill getFill()
Returns the object that indicates how the text will be filled.

Returns:
DOCUMENT ME!

setFill

public void setFill(Fill fill)
Sets the object that indicates how the text will be filled. See getFill() for details.

Parameters:
fill - DOCUMENT ME!

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 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:
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)
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.

Parameters:
name - The name of the attribute in the feature being styled that should be used. If null then the default geometry should be used.

setPriority

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

Parameters:
e -

getPriority

public Expression getPriority()
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

Returns:
DOCUMENT ME!

addToOptions

public void addToOptions(java.lang.String key,
                         java.lang.String value)
adds a parameter value to the options map

Parameters:
key -
value -

getOption

public java.lang.String getOption(java.lang.String key)
Find the value of a key in the map (may return null)

Parameters:
key -
Returns:

getOptions

public java.util.Map getOptions()
return the map of option

Returns:
null - no options set


Copyright © GeoTools. All Rights Reserved.