net.sf.jasperreports.engine.export
Class AbstractTextRenderer

java.lang.Object
  extended by net.sf.jasperreports.engine.export.AbstractTextRenderer
Direct Known Subclasses:
AbstractPdfTextRenderer, AwtTextRenderer

public abstract class AbstractTextRenderer
extends java.lang.Object

Version:
$Id: AbstractTextRenderer.java 5050 2012-03-12 10:11:26Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)

Field Summary
protected  java.lang.String allText
           
protected  int bottomPadding
           
protected  float drawPosX
           
protected  float drawPosY
           
protected  int height
           
protected  boolean isMaxHeightReached
           
protected  JasperReportsContext jasperReportsContext
           
protected  int leftPadding
           
static java.awt.font.FontRenderContext LINE_BREAK_FONT_RENDER_CONTEXT
           
protected  float lineHeight
           
protected  int rightPadding
           
protected  int segmentIndex
           
protected  java.util.List<net.sf.jasperreports.engine.export.TabSegment> segments
           
protected  JRStyledText styledText
           
protected  JRPrintText text
           
protected  int topPadding
           
protected  float verticalAlignOffset
           
protected  int width
           
protected  int x
           
protected  int y
           
 
Constructor Summary
AbstractTextRenderer(boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)
          Deprecated. Replaced by AbstractTextRenderer(JasperReportsContext, boolean, boolean).
AbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)
           
 
Method Summary
abstract  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; } /**
 int getHeight()
           
static float getLineHeight(boolean isFirstLine, JRParagraph paragraph, float maxLeading, float maxAscent)
           
 java.lang.String getPlainText()
           
 JRStyledText getStyledText()
           
 int getWidth()
           
 int getX()
           
 int getY()
           
 void initialize(JRPrintText text, int offsetX, int offsetY)
           
 void render()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_BREAK_FONT_RENDER_CONTEXT

public static final java.awt.font.FontRenderContext LINE_BREAK_FONT_RENDER_CONTEXT

jasperReportsContext

protected final JasperReportsContext jasperReportsContext

text

protected JRPrintText text

styledText

protected JRStyledText styledText

allText

protected java.lang.String allText

x

protected int x

y

protected int y

width

protected int width

height

protected int height

topPadding

protected int topPadding

leftPadding

protected int leftPadding

bottomPadding

protected int bottomPadding

rightPadding

protected int rightPadding

verticalAlignOffset

protected float verticalAlignOffset

drawPosY

protected float drawPosY

drawPosX

protected float drawPosX

lineHeight

protected float lineHeight

isMaxHeightReached

protected boolean isMaxHeightReached

segments

protected java.util.List<net.sf.jasperreports.engine.export.TabSegment> segments

segmentIndex

protected int segmentIndex
Constructor Detail

AbstractTextRenderer

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

AbstractTextRenderer

public AbstractTextRenderer(boolean isMinimizePrinterJobSize,
                            boolean ignoreMissingFont)
Deprecated. Replaced by AbstractTextRenderer(JasperReportsContext, boolean, boolean).

Method Detail

getX

public int getX()

getY

public int getY()

getWidth

public int getWidth()

getHeight

public int getHeight()

getStyledText

public JRStyledText getStyledText()

getPlainText

public java.lang.String getPlainText()

initialize

public void initialize(JRPrintText text,
                       int offsetX,
                       int offsetY)

render

public void render()

draw

public abstract void draw()

getLineHeight

public static float getLineHeight(boolean isFirstLine,
                                  JRParagraph paragraph,
                                  float maxLeading,
                                  float maxAscent)

getFontRenderContext

public 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; } /**



© 2001-2010 Jaspersoft Corporation www.jaspersoft.com