Package org.geotools.styling
Class TextSymbolizerImpl
- Object
-
- AbstractSymbolizer
-
- TextSymbolizerImpl
-
- All Implemented Interfaces:
Cloneable
,Symbolizer
,TextSymbolizer
,Cloneable
public class TextSymbolizerImpl extends AbstractSymbolizer implements TextSymbolizer, 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.DisplacementMode, TextSymbolizer.GraphicPlacement, TextSymbolizer.PolygonAlignOptions
-
-
Field Summary
-
Fields inherited from class AbstractSymbolizer
geometry, name, options, unitOfMeasure
-
Fields inherited from interface TextSymbolizer
ALLOW_OVERRUNS_KEY, AUTO_WRAP_KEY, CHAR_SPACING_KEY, CONFLICT_RESOLUTION_KEY, DEFAULT_ALLOW_OVERRUNS, DEFAULT_AUTO_WRAP, DEFAULT_CHAR_SPACING, DEFAULT_CONFLICT_RESOLUTION, DEFAULT_FOLLOW_LINE, DEFAULT_FONT_SHRINK_SIZE_MIN, DEFAULT_FORCE_LEFT_TO_RIGHT, DEFAULT_GOODNESS_OF_FIT, DEFAULT_GROUP, DEFAULT_KERNING, DEFAULT_LABEL_ALL_GROUP, DEFAULT_LABEL_REPEAT, DEFAULT_MAX_ANGLE_DELTA, DEFAULT_MAX_DISPLACEMENT, DEFAULT_MIN_GROUP_DISTANCE, DEFAULT_PARTIALS, DEFAULT_POLYGONALIGN, DEFAULT_REMOVE_OVERLAPS, DEFAULT_SPACE_AROUND, DEFAULT_STRIKETHROUGH_TEXT, DEFAULT_UNDERLINE_TEXT, DEFAULT_WORD_SPACING, DISPLACEMENT_MODE_KEY, FOLLOW_LINE_KEY, FONT_SHRINK_SIZE_MIN, FORCE_LEFT_TO_RIGHT_KEY, GOODNESS_OF_FIT_KEY, GRAPHIC_MARGIN_KEY, GRAPHIC_PLACEMENT_KEY, GRAPHIC_RESIZE_KEY, GROUP_KEY, KERNING_KEY, LABEL_ALL_GROUP_KEY, LABEL_REPEAT_KEY, MAX_ANGLE_DELTA_KEY, MAX_DISPLACEMENT_KEY, MIN_GROUP_DISTANCE_KEY, PARTIALS_KEY, POLYGONALIGN_KEY, REMOVE_OVERLAPS_KEY, SPACE_AROUND_KEY, STRIKETHROUGH_TEXT_KEY, UNDERLINE_TEXT_KEY, WORD_SPACING_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextSymbolizerImpl()
protected
TextSymbolizerImpl(FilterFactory factory)
Creates a new instance of DefaultTextSymbolizerprotected
TextSymbolizerImpl(FilterFactory factory, Description desc, String name, Unit<Length> uom)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(StyleVisitor visitor)
Object
accept(TraversingStyleVisitor visitor, Object data)
Accept a StyleVisitor to perform an operation on this symbolizer.void
addFont(Font font)
Setter for property font.Object
clone()
Creates a deep copy clone.boolean
equals(Object obj)
List<Font>
fonts()
Direct access to device independent Fonts used to render the label.Expression
getFeatureDescription()
Description is used by text oriented renders such as KML and RSS to specify a feature's descriptionFill
getFill()
Returns the fill to be used to fill the text when rendered.Font
getFont()
Returns the Font to apply on the text.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()
A pointPlacement specifies how a text element should be rendered relative to its geometric point.OtherText
getOtherText()
Other text can be used to allow open ended extensions on text oriented output formatsExpression
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)
Set initial font used to render label.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
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 interface Symbolizer
getDescription, getGeometry, getGeometryPropertyName, getName, getUnitOfMeasure, hasOption, setDescription, setGeometry, setGeometryPropertyName, setName, setUnitOfMeasure
-
Methods inherited from interface TextSymbolizer
getOptions
-
-
-
-
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 Fill getFill()
Returns the fill to be used to fill the text when rendered.- Specified by:
getFill
in interfaceTextSymbolizer
- Returns:
- The fill to be used.
-
setFill
public void setFill(Fill fill)
Setter for property fill.- Specified by:
setFill
in interfaceTextSymbolizer
- Parameters:
fill
- New value of property fill.
-
fonts
public List<Font> fonts()
Description copied from interface:TextSymbolizer
Direct access to device independent Fonts used to render the label. Fonts are used in order of priority given.- Specified by:
fonts
in interfaceTextSymbolizer
- Returns:
- device independent Font used to render the label.
-
getFont
public Font getFont()
Description copied from interface:TextSymbolizer
Returns the Font to apply on the text.- Specified by:
getFont
in interfaceTextSymbolizer
- Returns:
- Font
-
setFont
public void setFont(Font font)
Description copied from interface:TextSymbolizer
Set initial font used to render label. This will replace the initial entry in theTextSymbolizer.fonts()
list.- Specified by:
setFont
in interfaceTextSymbolizer
-
addFont
public void addFont(Font font)
Setter for property font.- Parameters:
font
- New value of property font.
-
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 interfaceTextSymbolizer
-
setHalo
public void setHalo(Halo halo)
Setter for property halo.- Specified by:
setHalo
in interfaceTextSymbolizer
- Parameters:
halo
- New value of property halo.
-
getLabel
public Expression getLabel()
Returns the label expression.- Specified by:
getLabel
in interfaceTextSymbolizer
- Returns:
- Label expression.
-
setLabel
public void setLabel(Expression label)
Setter for property label.- Specified by:
setLabel
in interfaceTextSymbolizer
- 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 interfaceTextSymbolizer
- Returns:
- Value of property labelPlacement.
-
setLabelPlacement
public void setLabelPlacement(LabelPlacement labelPlacement)
Setter for property labelPlacement.- Specified by:
setLabelPlacement
in interfaceTextSymbolizer
- Parameters:
labelPlacement
- New value of property labelPlacement.
-
accept
public Object accept(TraversingStyleVisitor visitor, Object data)
Accept a StyleVisitor to perform an operation on this symbolizer.- Specified by:
accept
in interfaceSymbolizer
- Specified by:
accept
in interfaceTextSymbolizer
- Parameters:
visitor
- The StyleVisitor to accept.- Returns:
- value produced
-
accept
public void accept(StyleVisitor visitor)
- Specified by:
accept
in interfaceSymbolizer
-
clone
public Object clone()
Creates a deep copy clone. TODO: Need to complete the deep copy, currently only shallow copy.- Specified by:
clone
in interfaceCloneable
- Overrides:
clone
in classObject
- Returns:
- The deep copy clone.
- 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- Specified by:
setPriority
in interfaceTextSymbolizer
-
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 interfaceTextSymbolizer
-
getGraphic
public Graphic getGraphic()
Description copied from interface:TextSymbolizer
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 interfaceTextSymbolizer
- Returns:
- - the Graphic object to be rendered under the label text
-
setGraphic
public void setGraphic(Graphic graphic)
Description copied from interface:TextSymbolizer
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 interfaceTextSymbolizer
- Parameters:
graphic
- - the Graphic object which will be rendered under the label text
-
getSnippet
public Expression getSnippet()
Description copied from interface:TextSymbolizer
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 interfaceTextSymbolizer
-
setSnippet
public void setSnippet(Expression abxtract)
- Specified by:
setSnippet
in interfaceTextSymbolizer
-
getFeatureDescription
public Expression getFeatureDescription()
Description copied from interface:TextSymbolizer
Description is used by text oriented renders such as KML and RSS to specify a feature's description- Specified by:
getFeatureDescription
in interfaceTextSymbolizer
-
setFeatureDescription
public void setFeatureDescription(Expression description)
- Specified by:
setFeatureDescription
in interfaceTextSymbolizer
-
getOtherText
public OtherText getOtherText()
Description copied from interface:TextSymbolizer
Other text can be used to allow open ended extensions on text oriented output formats- Specified by:
getOtherText
in interfaceTextSymbolizer
-
setOtherText
public void setOtherText(OtherText otherText)
- Specified by:
setOtherText
in interfaceTextSymbolizer
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractSymbolizer
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classAbstractSymbolizer
-
-