|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectLabelPainter
public class LabelPainter
This class performs the layouting and painting of the single label (leaving the label cache the task to sort labels and locate the best label points)
modules/library/render (gt-render.jar)
Constructor Summary | |
---|---|
LabelPainter(Graphics2D graphics,
boolean outlineRenderingEnabled)
Builds a new painter |
Method Summary | |
---|---|
double |
getAscent()
The full size above the baseline |
Rectangle2D |
getFullLabelBounds()
Get the straight label bounds, taking into account halo, shield and line wrapping |
LabelCacheItem |
getLabel()
Returns the current label item |
Rectangle2D |
getLabelBounds()
Get the straight label bounds, without taking into account halo and shield |
int |
getLineCount()
Number of lines for this label (more than 1 if the label has embedded newlines or if we're auto-wrapping it) |
double |
getLineHeight()
Returns the line height for this label in pixels (for multiline labels, it's the height of the first line) |
double |
getLinePlacementYAnchor()
Vertical centering is not trivial, because visually we want centering on characters such as a,m,e, and not centering on d,g whose center is affected by the full ascent or the full descent. |
int |
getStraightLabelWidth()
Returns the width of the label, as painted in straight form ( |
void |
paintCurvedLabel(LineStringCursor cursor)
Paints a label that follows the line, centered in the current cursor position |
void |
paintStraightLabel(AffineTransform transform)
Paints the label as a non curved one. |
void |
setLabel(LabelCacheItem labelItem)
Sets the current label. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelPainter(Graphics2D graphics, boolean outlineRenderingEnabled)
graphics
- outlineRenderingEnabled
- Method Detail |
---|
public void setLabel(LabelCacheItem labelItem)
labelItem
- public LabelCacheItem getLabel()
public double getLineHeight()
public double getAscent()
public int getStraightLabelWidth()
public int getLineCount()
public Rectangle2D getFullLabelBounds()
public Rectangle2D getLabelBounds()
public void paintStraightLabel(AffineTransform transform) throws Exception
transform
-
Exception
public void paintCurvedLabel(LineStringCursor cursor)
cursor
- public double getLinePlacementYAnchor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |