public class AwtTextRenderer extends AbstractTextRenderer
| Modifier and Type | Field and Description |
|---|---|
protected JRStyledTextAttributeSelector |
noBackcolorSelector |
protected JRStyledTextUtil |
styledTextUtil |
allText, bottomPadding, drawPosX, drawPosY, height, isMaxHeightReached, jasperReportsContext, leftPadding, LINE_BREAK_FONT_RENDER_CONTEXT, lineHeight, rightPadding, segmentIndex, segments, styledText, text, topPadding, verticalAlignOffset, width, x, y| Constructor and Description |
|---|
AwtTextRenderer(JasperReportsContext jasperReportsContext,
boolean isMinimizePrinterJobSize,
boolean ignoreMissingFont) |
| Modifier and Type | Method and Description |
|---|---|
void |
draw() |
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;
}
/**
|
void |
initialize(Graphics2D grx,
JRPrintText text,
int offsetX,
int offsetY) |
getHeight, getLineHeight, getPlainText, getStyledText, getWidth, getX, getY, initialize, renderprotected final JRStyledTextAttributeSelector noBackcolorSelector
protected final JRStyledTextUtil styledTextUtil
public AwtTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)
public void initialize(Graphics2D grx, JRPrintText text, int offsetX, int offsetY)
public void draw()
draw in class AbstractTextRendererpublic FontRenderContext getFontRenderContext()
AbstractTextRenderergetFontRenderContext in class AbstractTextRendererCopyright © 2017. All rights reserved.