Package org.geotools.styling
Class TextSymbolizerImpl
Object
AbstractSymbolizer
TextSymbolizerImpl
- All Implemented Interfaces:
Cloneable
,Symbolizer
,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
ConstructorsModifierConstructorDescriptionprotected
protected
TextSymbolizerImpl
(FilterFactory factory) Creates a new instance of DefaultTextSymbolizerprotected
TextSymbolizerImpl
(FilterFactory factory, Description desc, String name, Unit<Length> uom) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(StyleVisitor visitor) accept
(TraversingStyleVisitor visitor, Object data) Accept a StyleVisitor to perform an operation on this symbolizer.void
Setter for property font.clone()
Creates a deep copy clone.boolean
fonts()
Direct access to device independent Fonts used to render the label.Description is used by text oriented renders such as KML and RSS to specify a feature's descriptiongetFill()
Returns the fill to be used to fill the text when rendered.getFont()
Returns the Font to apply on the text.The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.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.getLabel()
Returns the label expression.A pointPlacement specifies how a text element should be rendered relative to its geometric point.Other text can be used to allow open ended extensions on text oriented output formatsPriority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.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
Setter for property fill.void
Set initial font used to render label.void
setGraphic
(Graphic graphic) The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.void
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) 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 Details
-
TextSymbolizerImpl
protected TextSymbolizerImpl() -
TextSymbolizerImpl
Creates a new instance of DefaultTextSymbolizer -
TextSymbolizerImpl
protected TextSymbolizerImpl(FilterFactory factory, Description desc, String name, Unit<Length> uom)
-
-
Method Details
-
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
Setter for property fill.- Specified by:
setFill
in interfaceTextSymbolizer
- Parameters:
fill
- New value of property fill.
-
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
Description copied from interface:TextSymbolizer
Returns the Font to apply on the text.- Specified by:
getFont
in interfaceTextSymbolizer
- Returns:
- Font
-
setFont
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
Setter for property font.- Parameters:
font
- New value of property font.
-
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
Setter for property halo.- Specified by:
setHalo
in interfaceTextSymbolizer
- Parameters:
halo
- New value of property halo.
-
getLabel
Returns the label expression.- Specified by:
getLabel
in interfaceTextSymbolizer
- Returns:
- Label expression.
-
setLabel
Setter for property label.- Specified by:
setLabel
in interfaceTextSymbolizer
- Parameters:
label
- New value of property label.
-
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
Setter for property labelPlacement.- Specified by:
setLabelPlacement
in interfaceTextSymbolizer
- Parameters:
labelPlacement
- New value of property labelPlacement.
-
accept
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
- Specified by:
accept
in interfaceSymbolizer
-
clone
Creates a deep copy clone. TODO: Need to complete the deep copy, currently only shallow copy. -
setPriority
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
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
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
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
-
toString
-
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
- Specified by:
setSnippet
in interfaceTextSymbolizer
-
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
- Specified by:
setFeatureDescription
in interfaceTextSymbolizer
-
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
- Specified by:
setOtherText
in interfaceTextSymbolizer
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractSymbolizer
-
equals
- Overrides:
equals
in classAbstractSymbolizer
-