Package ca.cgjennings.layout
Class LayoutSegment
- java.lang.Object
-
- ca.cgjennings.layout.LayoutSegment
-
public class LayoutSegment extends java.lang.Object
A TextLayout together with the positional information needed to draw it in the position it was placed by a markup renderer. The renderer does this by appending a sequence of segments that represent what it would have drawn if it had been drawing. Note that a line may consist of multiple segments.- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description LayoutSegment(java.awt.font.TextLayout layout, float xOffset, float yOffset, float yBottom, boolean startOfLine, int sourceParagraph)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(java.awt.Graphics2D g)
void
draw(java.awt.Graphics2D g, float dx, float dy)
float
getAscent()
float
getDescent()
int
getSourceParagraphIndex()
float
getXOffset()
float
getYBottom()
float
getYOffset()
boolean
isStartOfLine()
void
translate(double dx, double dy)
-
-
-
Method Detail
-
getAscent
public float getAscent()
-
getDescent
public float getDescent()
-
getXOffset
public float getXOffset()
-
getYOffset
public float getYOffset()
-
getYBottom
public float getYBottom()
-
isStartOfLine
public boolean isStartOfLine()
-
getSourceParagraphIndex
public int getSourceParagraphIndex()
-
draw
public void draw(java.awt.Graphics2D g)
-
draw
public void draw(java.awt.Graphics2D g, float dx, float dy)
-
translate
public void translate(double dx, double dy)
-
-