org.geotools.styling
Class TextSymbolizerImpl

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

public class TextSymbolizerImpl
extends AbstractSymbolizer
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)

Nested Class Summary
 
Nested classes/interfaces inherited from interface TextSymbolizer
TextSymbolizer.PolygonAlignOptions
 
Field Summary
 
Fields inherited from class AbstractSymbolizer
geometry, name, options, unitOfMeasure
 
Fields inherited from interface TextSymbolizer
ALLOW_OVERRUNS_KEY, AUTO_WRAP_KEY, CONFLICT_RESOLUTION_KEY, DEFAULT_ALLOW_OVERRUNS, DEFAULT_AUTO_WRAP, DEFAULT_CONFLICT_RESOLUTION, DEFAULT_FOLLOW_LINE, DEFAULT_FORCE_LEFT_TO_RIGHT, DEFAULT_GOODNESS_OF_FIT, DEFAULT_GROUP, DEFAULT_LABEL_ALL_GROUP, DEFAULT_LABEL_REPEAT, DEFAULT_MAX_ANGLE_DELTA, DEFAULT_MAX_DISPLACEMENT, DEFAULT_MIN_GROUP_DISTANCE, DEFAULT_POLYGONALIGN, DEFAULT_REMOVE_OVERLAPS, DEFAULT_SPACE_AROUND, FOLLOW_LINE_KEY, FORCE_LEFT_TO_RIGHT_KEY, GOODNESS_OF_FIT_KEY, GRAPHIC_MARGIN_KEY, GRAPHIC_RESIZE_KEY, GROUP_KEY, LABEL_ALL_GROUP_KEY, LABEL_REPEAT_KEY, MAX_ANGLE_DELTA_KEY, MAX_DISPLACEMENT_KEY, MIN_GROUP_DISTANCE_KEY, POLYGONALIGN_KEY, SPACE_AROUND_KEY
 
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)
          Adds a parameter value to the options map
 Object clone()
          Creates a deep copy clone.
 boolean equals(Object obj)
           
 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 to use when rendering this symbolizer.
 Font[] getFonts()
          Deprecated. 
 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 getOption(String key)
          Find the value of a key in the map (may return null)
 OtherText getOtherText()
          Other text can be used to allow open ended extensions on text oriented output formats
 LabelPlacement getPlacement()
          Deprecated. 
 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 setFont(Font font)
          Font used when rendering this symbolizer.
 void setFonts(Font[] fonts)
          Deprecated. 
 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 setOtherText(OtherText otherText)
           
 void setPlacement(LabelPlacement labelPlacement)
          Deprecated. Use setLabelPlacement
 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 AbstractSymbolizer
getDescription, getGeometry, getGeometryPropertyName, getName, getOptions, getUnitOfMeasure, hasOption, setDescription, setGeometry, setGeometryPropertyName, setName, setUnitOfMeasure
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface TextSymbolizer
getOptions
 
Methods inherited from interface Symbolizer
getDescription, getGeometry, getGeometryPropertyName, hasOption, setDescription, setGeometry, setGeometryPropertyName, setName, setUnitOfMeasure
 
Methods inherited from interface Symbolizer
getName, getUnitOfMeasure
 

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

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()
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

setFont

public void setFont(Font font)
Description copied from interface: TextSymbolizer
Font used when rendering this symbolizer.


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
Returns:
Halo

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.

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.
Returns:
value produced

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!
See Also:
Object.clone()

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


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


addToOptions

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


getOption

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


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

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractSymbolizer

equals

public boolean equals(Object obj)
Overrides:
equals in class AbstractSymbolizer


Copyright © 1996-2014 Geotools. All Rights Reserved.