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 SummaryNested Classes Modifier and Type Class Description static classLabelCacheItem.GraphicResize
 - 
Constructor SummaryConstructors Constructor Description LabelCacheItem(String layerId, TextStyle2D textStyle, LiteShape2 shape, String label, TextSymbolizer symbolizer)ConstructLabelCacheItem.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowOverruns()Wheter labels are allowed to go past the start/end of the lineintcompareTo(LabelCacheItem other)booleanequals(Object obj)intgetAutoWrap()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)intgetFontShrinkSizeMin()GeometrygetGeometry()Returns an example geometry from the list of geometries.List<Geometry>getGeoms()The list of geometries this item maintainsdoublegetGoodnessOfFit()int[]getGraphicMargin()TextSymbolizer.GraphicPlacementgetGraphicPlacement()LabelCacheItem.GraphicResizegetGraphicsResize()StringgetLabel()Set<String>getLayerIds()Return a modifiable set of idsdoublegetMaxAngleDelta()Max angle between two subsequence characters in a curved label, in degrees.intgetMaxDisplacement()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)intgetMinGroupDistance()doublegetPriority()intgetRepeat()When enabled, repeats labels every "repeat" pixels (works on lines only atm)intgetSpaceAround()space around - "dont put any label near me by this # of pixels"TextStyle2DgetTextStyle()The textstyle that is used to label the shape.doublegetWordSpacing()inthashCode()booleanisConflictResolutionEnabled()Checks if conflict resolution has been enabled for this labelbooleanisFollowLineEnabled()Enables curved labels on linear featuresbooleanisForceLeftToRightEnabled()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 isbooleanisPartialsEnabled()booleanisTextStrikethrough()booleanisTextUnderlined()booleanlabelAllGroup()When grouping, wheter we should label only the biggest geometry, or the others as wellbooleanremoveGroupOverlaps()voidsetAllowOverruns(boolean allowOverruns)voidsetAutoWrap(int autoWrap)voidsetConflictResolutionEnabled(boolean conflictResolutionEnabled)Sets conflict resolution for this label.voidsetDisplacementAngles(int[] displacementAngles)voidsetFollowLineEnabled(boolean followLineEnabled)voidsetFontShrinkSizeMin(int fontShrinkSize)voidsetForceLeftToRightEnabled(boolean forceLeftToRight)voidsetGoodnessOfFit(double goodnessOfFit)A value between 0 and 1 representing the portion of the label that overlaps with the geometry (atm used only for polygons)voidsetGraphicMargin(int[] graphicMargin)voidsetGraphicPlacement(TextSymbolizer.GraphicPlacement graphicPlacement)voidsetGraphicsResize(LabelCacheItem.GraphicResize graphicsResize)voidsetLabel(String l)voidsetLabelAllGroup(boolean labelAllGroup)voidsetMaxAngleDelta(double maxAngleDelta)voidsetMaxDisplacement(int maxDisplacement)voidsetMinGroupDistance(int minGroupDistance)Minimum cartesian distance between two labels in the same group, in pixelsvoidsetPartialsEnabled(boolean partialsEnabled)voidsetPriority(double d)voidsetRemoveGroupOverlaps(boolean removeGroupOverlaps)voidsetRepeat(int repeat)voidsetSpaceAround(int space)space around - "dont put any label near me by this # of pixels"voidsetTextStrikethrough(boolean textStrikethrough)voidsetTextUnderlined(boolean textUnderlined)voidsetWordSpacing(double wordSpacing)
 
- 
- 
- 
Constructor Detail- 
LabelCacheItempublic LabelCacheItem(String layerId, TextStyle2D textStyle, LiteShape2 shape, String label, TextSymbolizer symbolizer) ConstructLabelCacheItem.
 
- 
 - 
Method Detail- 
getGoodnessOfFitpublic double getGoodnessOfFit() 
 - 
setGoodnessOfFitpublic 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)
 - 
getLabelpublic String getLabel() 
 - 
setLabelpublic void setLabel(String l) 
 - 
getSpaceAroundpublic int getSpaceAround() space around - "dont put any label near me by this # of pixels"
 - 
setSpaceAroundpublic void setSpaceAround(int space) space around - "dont put any label near me by this # of pixels"
 - 
getPrioritypublic double getPriority() 
 - 
setPrioritypublic void setPriority(double d) 
 - 
getTextStylepublic TextStyle2D getTextStyle() The textstyle that is used to label the shape.
 - 
getGeometrypublic Geometry getGeometry() Returns an example geometry from the list of geometries.
 - 
getMaxDisplacementpublic 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)
 - 
setMaxDisplacementpublic void setMaxDisplacement(int maxDisplacement) 
 - 
getDisplacementAnglespublic int[] getDisplacementAngles() defines the actual angle towards which displacement of label will take place (applies only in polygon or point features)
 - 
setDisplacementAnglespublic void setDisplacementAngles(int[] displacementAngles) 
 - 
getRepeatpublic int getRepeat() When enabled, repeats labels every "repeat" pixels (works on lines only atm)
 - 
setRepeatpublic void setRepeat(int repeat) 
 - 
labelAllGrouppublic boolean labelAllGroup() When grouping, wheter we should label only the biggest geometry, or the others as well
 - 
setLabelAllGrouppublic void setLabelAllGroup(boolean labelAllGroup) 
 - 
removeGroupOverlapspublic boolean removeGroupOverlaps() 
 - 
setRemoveGroupOverlapspublic void setRemoveGroupOverlaps(boolean removeGroupOverlaps) 
 - 
allowOverrunspublic boolean allowOverruns() Wheter labels are allowed to go past the start/end of the line
 - 
setAllowOverrunspublic void setAllowOverruns(boolean allowOverruns) 
 - 
getMinGroupDistancepublic int getMinGroupDistance() 
 - 
setMinGroupDistancepublic void setMinGroupDistance(int minGroupDistance) Minimum cartesian distance between two labels in the same group, in pixels
 - 
isFollowLineEnabledpublic boolean isFollowLineEnabled() Enables curved labels on linear features
 - 
setFollowLineEnabledpublic void setFollowLineEnabled(boolean followLineEnabled) 
 - 
getMaxAngleDeltapublic 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.
 - 
setMaxAngleDeltapublic void setMaxAngleDelta(double maxAngleDelta) 
 - 
getAutoWrappublic int getAutoWrap() Automatically wraps long labels when the label width, in pixels, exceeds the autowrap length
 - 
setAutoWrappublic void setAutoWrap(int autoWrap) 
 - 
compareTopublic int compareTo(LabelCacheItem other) - Specified by:
- compareToin interface- Comparable<LabelCacheItem>
 
 - 
isForceLeftToRightEnabledpublic 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
 - 
setForceLeftToRightEnabledpublic void setForceLeftToRightEnabled(boolean forceLeftToRight) 
 - 
isConflictResolutionEnabledpublic boolean isConflictResolutionEnabled() Checks if conflict resolution has been enabled for this label
 - 
setConflictResolutionEnabledpublic 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
 - 
getGraphicsResizepublic LabelCacheItem.GraphicResize getGraphicsResize() 
 - 
setGraphicsResizepublic void setGraphicsResize(LabelCacheItem.GraphicResize graphicsResize) 
 - 
getGraphicMarginpublic int[] getGraphicMargin() 
 - 
setGraphicMarginpublic void setGraphicMargin(int[] graphicMargin) 
 - 
isPartialsEnabledpublic boolean isPartialsEnabled() 
 - 
setPartialsEnabledpublic void setPartialsEnabled(boolean partialsEnabled) 
 - 
isTextUnderlinedpublic boolean isTextUnderlined() 
 - 
setTextUnderlinedpublic void setTextUnderlined(boolean textUnderlined) 
 - 
isTextStrikethroughpublic boolean isTextStrikethrough() 
 - 
setTextStrikethroughpublic void setTextStrikethrough(boolean textStrikethrough) 
 - 
getWordSpacingpublic double getWordSpacing() 
 - 
setWordSpacingpublic void setWordSpacing(double wordSpacing) 
 - 
getFontShrinkSizeMinpublic int getFontShrinkSizeMin() 
 - 
setFontShrinkSizeMinpublic void setFontShrinkSizeMin(int fontShrinkSize) 
 - 
getGraphicPlacementpublic TextSymbolizer.GraphicPlacement getGraphicPlacement() 
 - 
setGraphicPlacementpublic void setGraphicPlacement(TextSymbolizer.GraphicPlacement graphicPlacement) 
 
- 
 
-