Class DrawTextParagraph

java.lang.Object
org.apache.poi.sl.draw.DrawTextParagraph
All Implemented Interfaces:
Drawable

public class DrawTextParagraph extends Object implements Drawable
  • Field Details

    • paragraph

      protected TextParagraph<?,?,?> paragraph
    • lines

      protected List<DrawTextFragment> lines
    • rawText

      protected String rawText
    • bullet

      protected DrawTextFragment bullet
    • autoNbrIdx

      protected int autoNbrIdx
    • maxLineHeight

      protected double maxLineHeight
      the highest line in this paragraph. Used for line spacing.
  • Constructor Details

    • DrawTextParagraph

      public DrawTextParagraph(TextParagraph<?,?,?> paragraph)
  • Method Details

    • setPosition

      public void setPosition(double x, double y)
    • getY

      public double getY()
    • setAutoNumberingIdx

      public void setAutoNumberingIdx(int index)
      Sets the auto numbering index of the handled paragraph
      Parameters:
      index - the auto numbering index
    • draw

      public void draw(Graphics2D graphics)
      Description copied from interface: Drawable
      Draw this shape into the supplied canvas
      Specified by:
      draw in interface Drawable
      Parameters:
      graphics - the graphics to draw into
    • getFirstLineLeading

      public float getFirstLineLeading()
    • getFirstLineHeight

      public float getFirstLineHeight()
    • getLastLineHeight

      public float getLastLineHeight()
    • isEmptyParagraph

      public boolean isEmptyParagraph()
    • applyTransform

      public void applyTransform(Graphics2D graphics)
      Description copied from interface: Drawable
      Apply 2-D transforms before drawing this shape. This includes rotation and flipping.
      Specified by:
      applyTransform in interface Drawable
      Parameters:
      graphics - the graphics whos transform matrix will be modified
    • drawContent

      public void drawContent(Graphics2D graphics)
      Description copied from interface: Drawable
      draw any content within this shape (image, text, etc.).
      Specified by:
      drawContent in interface Drawable
      Parameters:
      graphics - the graphics to draw into
    • breakText

      protected void breakText(Graphics2D graphics)
      break text into lines, each representing a line of text that fits in the wrapping width
      Parameters:
      graphics - The drawing context for computing text-lengths.
    • getBullet

      protected DrawTextFragment getBullet(Graphics2D graphics, AttributedCharacterIterator firstLineAttr)
    • getRenderableText

      protected String getRenderableText(Graphics2D graphics, TextRun tr)
    • getRenderableText

      @Internal public String getRenderableText(TextRun tr)
    • getWrappingWidth

      protected double getWrappingWidth(boolean firstLine, Graphics2D graphics)
      Returns wrapping width to break lines in this paragraph
      Parameters:
      firstLine - whether the first line is breaking
      Returns:
      wrapping width in points
    • getAttributedString

      protected AttributedString getAttributedString(Graphics2D graphics, StringBuilder text)
    • isHSLF

      protected boolean isHSLF()
      Returns:
      true if the HSLF implementation is used