org.geotools.styling
Class TextSymbolizerImpl

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

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, Johann Sorel (Geomatys)
Module:
modules/library/main (gt-main.jar)

Constructor Summary
protected TextSymbolizerImpl()
           
protected TextSymbolizerImpl(FilterFactory factory)
          Creates a new instance of DefaultTextSymbolizer
protected TextSymbolizerImpl(FilterFactory factory, Description desc, String name, Unit<Length> uom)
           
 
Method Summary
 void accept(StyleVisitor visitor)
           
 Object accept(StyleVisitor visitor, Object data)
          Accept a StyleVisitor to perform an operation on this symbolizer.
 void addFont(Font font)
          Deprecated. 
 void addToOptions(String key, String value)
           
 Object clone()
          Creates a deep copy clone.
 boolean equals(Object oth)
           
 String geometryPropertyName()
          This property defines the geometry to be used for styling.
 DescriptionImpl getDescription()
           
 Expression getFeatureDescription()
          Description is used by text oriented renders such as KML and RSS to specify a feature's description
 FillImpl getFill()
          Returns the fill to be used to fill the text when rendered.
 Font getFont()
           
 Font[] getFonts()
          Deprecated. 
 String getGeometryPropertyName()
          Getter for property geometryPropertyName.
 Graphic getGraphic()
          The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.
 HaloImpl 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.
 String getName()
           
 String getOption(String key)
           
 Map<String,String> getOptions()
           
 OtherText getOtherText()
          Other text can be used to allow open ended extensions on text oriented output formats
 LabelPlacement getPlacement()
          Deprecated. 
 Expression getPriority()
           
 Expression getSnippet()
          Abstract is used by text oriented renderers such as KML and RSS to specify an abstract (RSS) or a snippet (KML)
 Unit<Length> getUnitOfMeasure()
           
 int hashCode()
           
 void setDescription(Description description)
           
 void setFeatureDescription(Expression description)
           
 void setFill(Fill fill)
          Setter for property fill.
 void setFont(Font font)
           
 void setFonts(Font[] fonts)
          Deprecated. 
 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)
          Setter for property labelPlacement.
 void setName(String name)
           
 void setOtherText(OtherText otherText)
           
 void setPlacement(LabelPlacement labelPlacement)
          Deprecated. Use setLabelPlacement
 void setPriority(Expression priority)
           
 void setSnippet(Expression abxtract)
           
 void setUnitOfMeasure(Unit<Length> uom)
           
 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


TextSymbolizerImpl

protected TextSymbolizerImpl(FilterFactory factory,
                             Description desc,
                             String name,
                             Unit<Length> uom)
Method Detail

getName

public String getName()
Specified by:
getName in interface Symbolizer

setName

public void setName(String name)

getDescription

public DescriptionImpl getDescription()
Specified by:
getDescription in interface Symbolizer

setDescription

public void setDescription(Description description)

getUnitOfMeasure

public Unit<Length> getUnitOfMeasure()
Specified by:
getUnitOfMeasure in interface Symbolizer

setUnitOfMeasure

public void setUnitOfMeasure(Unit<Length> uom)

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

Parameters:
fill - New value of property fill.

getFont

public Font getFont()
Specified by:
getFont in interface TextSymbolizer

setFont

public void setFont(Font font)

getFonts

@Deprecated
public Font[] getFonts()
Deprecated. 

Returns a device independent Font object that is to be used to render the label.

Returns:
Device independent Font object to be used to render the label.

addFont

@Deprecated
public void addFont(Font font)
Deprecated. 

Setter for property font.

Parameters:
font - New value of property font.

setFonts

@Deprecated
public void setFonts(Font[] fonts)
Deprecated. 

Sets the list of fonts in the TextSymbolizer to the provided array of Fonts.

Parameters:
fonts - The array of fonts to use in the symbolizer.

getHalo

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

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.

Parameters:
label - New value of property label.

getPlacement

@Deprecated
public LabelPlacement getPlacement()
Deprecated. 

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

Returns:
Value of property labelPlacement.

setPlacement

public void setPlacement(LabelPlacement labelPlacement)
Deprecated. Use setLabelPlacement

Setter for property labelPlacement.

Parameters:
labelPlacement - New value of property labelPlacement.

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.

Parameters:
labelPlacement - New value of property labelPlacement.

getGeometryPropertyName

public String getGeometryPropertyName()
Getter for property geometryPropertyName.

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

setGeometryPropertyName

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

Parameters:
geometryPropertyName - New value of property geometryPropertyName.

accept

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

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

accept

public void accept(StyleVisitor visitor)

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)

getPriority

public Expression getPriority()

addToOptions

public void addToOptions(String key,
                         String value)

getOption

public String getOption(String key)

getOptions

public Map<String,String> getOptions()

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.