Class DrawTextShape

All Implemented Interfaces:
Drawable
Direct Known Subclasses:
DrawAutoShape

public class DrawTextShape extends DrawSimpleShape
  • Constructor Details

    • DrawTextShape

      public DrawTextShape(TextShape<?,?> shape)
  • Method Details

    • 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
      Overrides:
      drawContent in class DrawShape
      Parameters:
      graphics - the graphics to draw into
    • drawParagraphs

      public double drawParagraphs(Graphics2D graphics, double x, double y)
      paint the paragraphs starting from top left (x,y)
      Returns:
      the vertical advance, i.e. the cumulative space occupied by the text
    • getTextHeight

      public double getTextHeight()
      Compute the cumulative height occupied by the text
      Returns:
      the height in points
    • getTextHeight

      public double getTextHeight(Graphics2D oldGraphics)
      Compute the cumulative height occupied by the text
      Parameters:
      oldGraphics - the graphics context, which properties are to be copied, may be null
      Returns:
      the height in points
    • getShape

      protected TextShape<?,? extends TextParagraph<?,?,? extends TextRun>> getShape()
      Overrides:
      getShape in class DrawSimpleShape