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 protectedTextSymbolizerImpl()protectedTextSymbolizerImpl(FilterFactory factory)Creates a new instance of DefaultTextSymbolizerprotectedTextSymbolizerImpl(FilterFactory factory, Description desc, String name, Unit<Length> uom)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(StyleVisitor visitor)Objectaccept(TraversingStyleVisitor visitor, Object data)Accept a StyleVisitor to perform an operation on this symbolizer.voidaddFont(Font font)Setter for property font.Objectclone()Creates a deep copy clone.booleanequals(Object obj)List<Font>fonts()Direct access to device independent Fonts used to render the label.ExpressiongetFeatureDescription()Description is used by text oriented renders such as KML and RSS to specify a feature's descriptionFillgetFill()Returns the fill to be used to fill the text when rendered.FontgetFont()Returns the Font to apply on the text.GraphicgetGraphic()The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.HalogetHalo()A halo fills an extended area outside the glyphs of a rendered text label to make the label easier to read over a background.ExpressiongetLabel()Returns the label expression.LabelPlacementgetLabelPlacement()A pointPlacement specifies how a text element should be rendered relative to its geometric point.OtherTextgetOtherText()Other text can be used to allow open ended extensions on text oriented output formatsExpressiongetPriority()Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.ExpressiongetSnippet()Abstract is used by text oriented renderers such as KML and RSS to specify an abstract (RSS) or a snippet (KML)inthashCode()voidsetFeatureDescription(Expression description)voidsetFill(Fill fill)Setter for property fill.voidsetFont(Font font)Set initial font used to render label.voidsetGraphic(Graphic graphic)The nonstandard-SLD graphic element supports putting little graphical-bits onto labels.voidsetHalo(Halo halo)Setter for property halo.voidsetLabel(Expression label)Setter for property label.voidsetLabelPlacement(LabelPlacement labelPlacement)Setter for property labelPlacement.voidsetOtherText(OtherText otherText)voidsetPriority(Expression priority)Priority -- null = use the default labeling priority Expression = an expression that evaluates to a number (ie.voidsetSnippet(Expression abxtract)StringtoString()-
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:
getFillin interfaceTextSymbolizer- Returns:
- The fill to be used.
-
setFill
public void setFill(Fill fill)
Setter for property fill.- Specified by:
setFillin interfaceTextSymbolizer- Parameters:
fill- New value of property fill.
-
fonts
public List<Font> fonts()
Description copied from interface:TextSymbolizerDirect access to device independent Fonts used to render the label. Fonts are used in order of priority given.- Specified by:
fontsin interfaceTextSymbolizer- Returns:
- device independent Font used to render the label.
-
getFont
public Font getFont()
Description copied from interface:TextSymbolizerReturns the Font to apply on the text.- Specified by:
getFontin interfaceTextSymbolizer- Returns:
- Font
-
setFont
public void setFont(Font font)
Description copied from interface:TextSymbolizerSet initial font used to render label. This will replace the initial entry in theTextSymbolizer.fonts()list.- Specified by:
setFontin 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:
getHaloin interfaceTextSymbolizer
-
setHalo
public void setHalo(Halo halo)
Setter for property halo.- Specified by:
setHaloin interfaceTextSymbolizer- Parameters:
halo- New value of property halo.
-
getLabel
public Expression getLabel()
Returns the label expression.- Specified by:
getLabelin interfaceTextSymbolizer- Returns:
- Label expression.
-
setLabel
public void setLabel(Expression label)
Setter for property label.- Specified by:
setLabelin 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:
getLabelPlacementin interfaceTextSymbolizer- Returns:
- Value of property labelPlacement.
-
setLabelPlacement
public void setLabelPlacement(LabelPlacement labelPlacement)
Setter for property labelPlacement.- Specified by:
setLabelPlacementin 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:
acceptin interfaceSymbolizer- Specified by:
acceptin interfaceTextSymbolizer- Parameters:
visitor- The StyleVisitor to accept.- Returns:
- value produced
-
accept
public void accept(StyleVisitor visitor)
- Specified by:
acceptin interfaceSymbolizer
-
clone
public Object clone()
Creates a deep copy clone. TODO: Need to complete the deep copy, currently only shallow copy.- Specified by:
clonein interfaceCloneable- Overrides:
clonein classObject- Returns:
- The deep copy clone.
- See Also:
Object.clone()
-
setPriority
public void setPriority(Expression priority)
Description copied from interface:TextSymbolizerPriority -- 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:
setPriorityin interfaceTextSymbolizer
-
getPriority
public Expression getPriority()
Description copied from interface:TextSymbolizerPriority -- 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:
getPriorityin interfaceTextSymbolizer
-
getGraphic
public Graphic getGraphic()
Description copied from interface:TextSymbolizerThe nonstandard-SLD graphic element supports putting little graphical-bits onto labels. Useful for things like interstate road shields or labeled logos- Specified by:
getGraphicin interfaceTextSymbolizer- Returns:
- - the Graphic object to be rendered under the label text
-
setGraphic
public void setGraphic(Graphic graphic)
Description copied from interface:TextSymbolizerThe nonstandard-SLD graphic element supports putting little graphical-bits onto labels. Useful for things like interstate road shields or labeled logos- Specified by:
setGraphicin interfaceTextSymbolizer- Parameters:
graphic- - the Graphic object which will be rendered under the label text
-
getSnippet
public Expression getSnippet()
Description copied from interface:TextSymbolizerAbstract is used by text oriented renderers such as KML and RSS to specify an abstract (RSS) or a snippet (KML)- Specified by:
getSnippetin interfaceTextSymbolizer
-
setSnippet
public void setSnippet(Expression abxtract)
- Specified by:
setSnippetin interfaceTextSymbolizer
-
getFeatureDescription
public Expression getFeatureDescription()
Description copied from interface:TextSymbolizerDescription is used by text oriented renders such as KML and RSS to specify a feature's description- Specified by:
getFeatureDescriptionin interfaceTextSymbolizer
-
setFeatureDescription
public void setFeatureDescription(Expression description)
- Specified by:
setFeatureDescriptionin interfaceTextSymbolizer
-
getOtherText
public OtherText getOtherText()
Description copied from interface:TextSymbolizerOther text can be used to allow open ended extensions on text oriented output formats- Specified by:
getOtherTextin interfaceTextSymbolizer
-
setOtherText
public void setOtherText(OtherText otherText)
- Specified by:
setOtherTextin interfaceTextSymbolizer
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractSymbolizer
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractSymbolizer
-
-