net.sf.jasperreports.engine.export
Class AbstractTextRenderer
java.lang.Object
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)
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 |
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
AbstractTextRenderer
public AbstractTextRenderer(JasperReportsContext jasperReportsContext,
boolean isMinimizePrinterJobSize,
boolean ignoreMissingFont)
AbstractTextRenderer
public AbstractTextRenderer(boolean isMinimizePrinterJobSize,
boolean ignoreMissingFont)
- Deprecated. Replaced by
AbstractTextRenderer(JasperReportsContext, boolean, boolean)
.
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