Class 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)  
    • Constructor Detail

      • LayoutSegment

        public LayoutSegment​(java.awt.font.TextLayout layout,
                             float xOffset,
                             float yOffset,
                             float yBottom,
                             boolean startOfLine,
                             int sourceParagraph)
    • 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)