net.sf.jasperreports.engine.export

## Class AwtTextRenderer

- java.lang.Object
- - net.sf.jasperreports.engine.export.AbstractTextRenderer
  - - net.sf.jasperreports.engine.export.AwtTextRenderer

-     public class AwtTextRenderer
      extends AbstractTextRenderer

  Version:
    $Id: AwtTextRenderer.java 5878 2013-01-07 20:23:13Z teodord $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Field Summary

    - ### Fields inherited from class net.sf.jasperreports.engine.export.AbstractTextRenderer

      `allText, bottomPadding, drawPosX, drawPosY, height, isMaxHeightReached, jasperReportsContext, leftPadding, LINE_BREAK_FONT_RENDER_CONTEXT, lineHeight, noBackcolorSelector, rightPadding, segmentIndex, segments, styledText, text, topPadding, verticalAlignOffset, width, x, y`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AwtTextRenderer(boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)` Deprecated. Replaced by `AwtTextRenderer(JasperReportsContext, boolean, boolean)`.
    `AwtTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `draw()`
    `java.awt.font.FontRenderContext` | `getFontRenderContext()` public static float getLineHeight(JRParagraph paragraph, float lineSpacingFactor, int maxFontSize) { float lineHeight = 0; switch(paragraph.getLineSpacing()) { case SINGLE: case ONE_AND_HALF: case DOUBLE: case PROPORTIONAL: { lineHeight = lineSpacingFactor * maxFontSize; break; } case AT_LEAST: { lineHeight = Math.max(lineSpacingFactor * maxFontSize, paragraph.getLineSpacingSize().floatValue()); break; } case FIXED: { lineHeight = paragraph.getLineSpacingSize().floatValue(); break; } default : { throw new JRRuntimeException("Invalid line space type: " + paragraph.getLineSpacing()); } } return lineHeight; } /**
    `static AwtTextRenderer` | `getInstance()` Deprecated. Replaced by `AwtTextRenderer(JasperReportsContext, boolean, boolean)`.
    `void` | `initialize(java.awt.Graphics2D grx, JRPrintText text, int offsetX, int offsetY)`

    - ### Methods inherited from class net.sf.jasperreports.engine.export.AbstractTextRenderer

      `getHeight, getLineHeight, getPlainText, getStyledText, getWidth, getX, getY, initialize, render`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AwtTextRenderer

          public AwtTextRenderer(JasperReportsContext jasperReportsContext,
                         boolean isMinimizePrinterJobSize,
                         boolean ignoreMissingFont)

    - #### AwtTextRenderer

          public AwtTextRenderer(boolean isMinimizePrinterJobSize,
                         boolean ignoreMissingFont)

      Deprecated. Replaced by `AwtTextRenderer(JasperReportsContext, boolean, boolean)`.

  - ### Method Detail

    - #### getInstance

          public static AwtTextRenderer getInstance()

      Deprecated. Replaced by `AwtTextRenderer(JasperReportsContext, boolean, boolean)`.

    - #### initialize

          public void initialize(java.awt.Graphics2D grx,
                        JRPrintText text,
                        int offsetX,
                        int offsetY)

    - #### draw

          public void draw()

      Specified by:
        `draw` in class `AbstractTextRenderer`

    - #### getFontRenderContext

          public java.awt.font.FontRenderContext getFontRenderContext()

      Description copied from class: `AbstractTextRenderer`
      public static float getLineHeight(JRParagraph paragraph, float lineSpacingFactor, int maxFontSize) { float lineHeight = 0; switch(paragraph.getLineSpacing()) { case SINGLE: case ONE_AND_HALF: case DOUBLE: case PROPORTIONAL: { lineHeight = lineSpacingFactor * maxFontSize; break; } case AT_LEAST: { lineHeight = Math.max(lineSpacingFactor * maxFontSize, paragraph.getLineSpacingSize().floatValue()); break; } case FIXED: { lineHeight = paragraph.getLineSpacingSize().floatValue(); break; } default : { throw new JRRuntimeException("Invalid line space type: " + paragraph.getLineSpacing()); } } return lineHeight; } /**
      Overrides:
        `getFontRenderContext` in class `AbstractTextRenderer`

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com