Class DrawTextShape

    • Constructor Detail

      • DrawTextShape

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

      • 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