Package org.geotools.renderer.label
Class LabelCacheItem
- Object
-
- LabelCacheItem
-
- All Implemented Interfaces:
Comparable<LabelCacheItem>
public class LabelCacheItem extends Object implements Comparable<LabelCacheItem>
The Labelling information that is put in the label cache.- Author:
- jeichar, dblasby, simone giannecchini, Andrea Aime - OpenGeo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LabelCacheItem.GraphicResize
-
Constructor Summary
Constructors Constructor Description LabelCacheItem(String layerId, TextStyle2D textStyle, LiteShape2 shape, String label, TextSymbolizer symbolizer)
ConstructLabelCacheItem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowOverruns()
Wheter labels are allowed to go past the start/end of the lineint
compareTo(LabelCacheItem other)
boolean
equals(Object obj)
int
getAutoWrap()
Automatically wraps long labels when the label width, in pixels, exceeds the autowrap lengthint[]
getDisplacementAngles()
defines the actual angle towards which displacement of label will take place (applies only in polygon or point features)int
getFontShrinkSizeMin()
Geometry
getGeometry()
Returns an example geometry from the list of geometries.List<Geometry>
getGeoms()
The list of geometries this item maintainsdouble
getGoodnessOfFit()
int[]
getGraphicMargin()
TextSymbolizer.GraphicPlacement
getGraphicPlacement()
LabelCacheItem.GraphicResize
getGraphicsResize()
String
getLabel()
Set<String>
getLayerIds()
Return a modifiable set of idsdouble
getMaxAngleDelta()
Max angle between two subsequence characters in a curved label, in degrees.int
getMaxDisplacement()
Max amount of pixels the label will be moved around trying to find a non conflicting location (how and if the moving will be done is geometry type dependent)int
getMinGroupDistance()
double
getPriority()
int
getRepeat()
When enabled, repeats labels every "repeat" pixels (works on lines only atm)int
getSpaceAround()
space around - "dont put any label near me by this # of pixels"TextStyle2D
getTextStyle()
The textstyle that is used to label the shape.double
getWordSpacing()
int
hashCode()
boolean
isConflictResolutionEnabled()
Checks if conflict resolution has been enabled for this labelboolean
isFollowLineEnabled()
Enables curved labels on linear featuresboolean
isForceLeftToRightEnabled()
If enabled, text will be forced to follow a left to right alignement (that makes it readable) no matter what the natural orientation of the line isboolean
isPartialsEnabled()
boolean
isTextStrikethrough()
boolean
isTextUnderlined()
boolean
labelAllGroup()
When grouping, wheter we should label only the biggest geometry, or the others as wellboolean
removeGroupOverlaps()
void
setAllowOverruns(boolean allowOverruns)
void
setAutoWrap(int autoWrap)
void
setConflictResolutionEnabled(boolean conflictResolutionEnabled)
Sets conflict resolution for this label.void
setDisplacementAngles(int[] displacementAngles)
void
setFollowLineEnabled(boolean followLineEnabled)
void
setFontShrinkSizeMin(int fontShrinkSize)
void
setForceLeftToRightEnabled(boolean forceLeftToRight)
void
setGoodnessOfFit(double goodnessOfFit)
A value between 0 and 1 representing the portion of the label that overlaps with the geometry (atm used only for polygons)void
setGraphicMargin(int[] graphicMargin)
void
setGraphicPlacement(TextSymbolizer.GraphicPlacement graphicPlacement)
void
setGraphicsResize(LabelCacheItem.GraphicResize graphicsResize)
void
setLabel(String l)
void
setLabelAllGroup(boolean labelAllGroup)
void
setMaxAngleDelta(double maxAngleDelta)
void
setMaxDisplacement(int maxDisplacement)
void
setMinGroupDistance(int minGroupDistance)
Minimum cartesian distance between two labels in the same group, in pixelsvoid
setPartialsEnabled(boolean partialsEnabled)
void
setPriority(double d)
void
setRemoveGroupOverlaps(boolean removeGroupOverlaps)
void
setRepeat(int repeat)
void
setSpaceAround(int space)
space around - "dont put any label near me by this # of pixels"void
setTextStrikethrough(boolean textStrikethrough)
void
setTextUnderlined(boolean textUnderlined)
void
setWordSpacing(double wordSpacing)
-
-
-
Constructor Detail
-
LabelCacheItem
public LabelCacheItem(String layerId, TextStyle2D textStyle, LiteShape2 shape, String label, TextSymbolizer symbolizer)
ConstructLabelCacheItem
.
-
-
Method Detail
-
getGoodnessOfFit
public double getGoodnessOfFit()
-
setGoodnessOfFit
public void setGoodnessOfFit(double goodnessOfFit)
A value between 0 and 1 representing the portion of the label that overlaps with the geometry (atm used only for polygons)
-
getLabel
public String getLabel()
-
setLabel
public void setLabel(String l)
-
getSpaceAround
public int getSpaceAround()
space around - "dont put any label near me by this # of pixels"
-
setSpaceAround
public void setSpaceAround(int space)
space around - "dont put any label near me by this # of pixels"
-
getPriority
public double getPriority()
-
setPriority
public void setPriority(double d)
-
getTextStyle
public TextStyle2D getTextStyle()
The textstyle that is used to label the shape.
-
getGeometry
public Geometry getGeometry()
Returns an example geometry from the list of geometries.
-
getMaxDisplacement
public int getMaxDisplacement()
Max amount of pixels the label will be moved around trying to find a non conflicting location (how and if the moving will be done is geometry type dependent)
-
setMaxDisplacement
public void setMaxDisplacement(int maxDisplacement)
-
getDisplacementAngles
public int[] getDisplacementAngles()
defines the actual angle towards which displacement of label will take place (applies only in polygon or point features)
-
setDisplacementAngles
public void setDisplacementAngles(int[] displacementAngles)
-
getRepeat
public int getRepeat()
When enabled, repeats labels every "repeat" pixels (works on lines only atm)
-
setRepeat
public void setRepeat(int repeat)
-
labelAllGroup
public boolean labelAllGroup()
When grouping, wheter we should label only the biggest geometry, or the others as well
-
setLabelAllGroup
public void setLabelAllGroup(boolean labelAllGroup)
-
removeGroupOverlaps
public boolean removeGroupOverlaps()
-
setRemoveGroupOverlaps
public void setRemoveGroupOverlaps(boolean removeGroupOverlaps)
-
allowOverruns
public boolean allowOverruns()
Wheter labels are allowed to go past the start/end of the line
-
setAllowOverruns
public void setAllowOverruns(boolean allowOverruns)
-
getMinGroupDistance
public int getMinGroupDistance()
-
setMinGroupDistance
public void setMinGroupDistance(int minGroupDistance)
Minimum cartesian distance between two labels in the same group, in pixels
-
isFollowLineEnabled
public boolean isFollowLineEnabled()
Enables curved labels on linear features
-
setFollowLineEnabled
public void setFollowLineEnabled(boolean followLineEnabled)
-
getMaxAngleDelta
public double getMaxAngleDelta()
Max angle between two subsequence characters in a curved label, in degrees. Good visual results are obtained with an angle of less than 25 degrees.
-
setMaxAngleDelta
public void setMaxAngleDelta(double maxAngleDelta)
-
getAutoWrap
public int getAutoWrap()
Automatically wraps long labels when the label width, in pixels, exceeds the autowrap length
-
setAutoWrap
public void setAutoWrap(int autoWrap)
-
compareTo
public int compareTo(LabelCacheItem other)
- Specified by:
compareTo
in interfaceComparable<LabelCacheItem>
-
isForceLeftToRightEnabled
public boolean isForceLeftToRightEnabled()
If enabled, text will be forced to follow a left to right alignement (that makes it readable) no matter what the natural orientation of the line is
-
setForceLeftToRightEnabled
public void setForceLeftToRightEnabled(boolean forceLeftToRight)
-
isConflictResolutionEnabled
public boolean isConflictResolutionEnabled()
Checks if conflict resolution has been enabled for this label
-
setConflictResolutionEnabled
public void setConflictResolutionEnabled(boolean conflictResolutionEnabled)
Sets conflict resolution for this label. When on, this label outline/bbox will be stored in the conflict resolution map and will prevent every other label to be drawn in the same area
-
getGraphicsResize
public LabelCacheItem.GraphicResize getGraphicsResize()
-
setGraphicsResize
public void setGraphicsResize(LabelCacheItem.GraphicResize graphicsResize)
-
getGraphicMargin
public int[] getGraphicMargin()
-
setGraphicMargin
public void setGraphicMargin(int[] graphicMargin)
-
isPartialsEnabled
public boolean isPartialsEnabled()
-
setPartialsEnabled
public void setPartialsEnabled(boolean partialsEnabled)
-
isTextUnderlined
public boolean isTextUnderlined()
-
setTextUnderlined
public void setTextUnderlined(boolean textUnderlined)
-
isTextStrikethrough
public boolean isTextStrikethrough()
-
setTextStrikethrough
public void setTextStrikethrough(boolean textStrikethrough)
-
getWordSpacing
public double getWordSpacing()
-
setWordSpacing
public void setWordSpacing(double wordSpacing)
-
getFontShrinkSizeMin
public int getFontShrinkSizeMin()
-
setFontShrinkSizeMin
public void setFontShrinkSizeMin(int fontShrinkSize)
-
getGraphicPlacement
public TextSymbolizer.GraphicPlacement getGraphicPlacement()
-
setGraphicPlacement
public void setGraphicPlacement(TextSymbolizer.GraphicPlacement graphicPlacement)
-
-