public abstract class AbstractTextRenderer extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractTextRenderer.TabSegment |
| Modifier and Type | Field and Description |
|---|---|
protected String |
allText |
protected int |
bottomPadding |
protected float |
drawPosX |
protected float |
drawPosY |
protected int |
height |
protected boolean |
ignoreMissingFont |
protected boolean |
indentFirstLine |
protected boolean |
isFirstParagraph |
protected boolean |
isLastParagraph |
protected boolean |
isMaxHeightReached |
protected JasperReportsContext |
jasperReportsContext |
protected boolean |
justifyLastLine |
protected int |
leftPadding |
static FontRenderContext |
LINE_BREAK_FONT_RENDER_CONTEXT |
protected float |
lineHeight |
protected JRPropertiesUtil |
propUtil |
protected int |
rightPadding |
protected int |
segmentIndex |
protected List<AbstractTextRenderer.TabSegment> |
segments |
protected JRStyledText |
styledText |
protected JRPrintText |
text |
protected int |
topPadding |
protected float |
verticalAlignOffset |
protected int |
width |
protected int |
x |
protected int |
y |
| Constructor and Description |
|---|
AbstractTextRenderer(JasperReportsContext jasperReportsContext,
boolean isMinimizePrinterJobSize,
boolean ignoreMissingFont)
Deprecated.
|
AbstractTextRenderer(JasperReportsContext jasperReportsContext,
boolean isMinimizePrinterJobSize,
boolean ignoreMissingFont,
boolean defaultIndentFirstLine,
boolean defaultJustifyLastLine) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
draw() |
protected AttributedString |
getAttributedString() |
int |
getBottomPadding() |
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());
break;
}
case FIXED:
{
lineHeight = paragraph.getLineSpacingSize();
break;
}
default :
{
throw new JRRuntimeException("Invalid line space type: " + paragraph.getLineSpacing());
}
}
return lineHeight;
}
/**
|
int |
getHeight() |
int |
getLeftPadding() |
static float |
getLineHeight(boolean isFirstLine,
JRParagraph paragraph,
float maxLeading,
float maxAscent) |
String |
getPlainText() |
int |
getRightPadding() |
JRStyledText |
getStyledText() |
int |
getTopPadding() |
int |
getWidth() |
int |
getX() |
int |
getY() |
void |
initialize(JRPrintText text,
JRStyledText styledText,
int offsetX,
int offsetY) |
void |
render() |
protected void |
renderParagraph(AttributedCharacterIterator allParagraphs,
int paragraphStart,
String paragraphText) |
public static final FontRenderContext LINE_BREAK_FONT_RENDER_CONTEXT
protected final JasperReportsContext jasperReportsContext
protected final JRPropertiesUtil propUtil
protected JRPrintText text
protected JRStyledText styledText
protected String allText
protected int x
protected int y
protected int width
protected int height
protected int topPadding
protected int leftPadding
protected int bottomPadding
protected int rightPadding
protected float verticalAlignOffset
protected float drawPosY
protected float drawPosX
protected float lineHeight
protected boolean isMaxHeightReached
protected boolean isFirstParagraph
protected boolean isLastParagraph
protected List<AbstractTextRenderer.TabSegment> segments
protected int segmentIndex
protected boolean indentFirstLine
protected boolean justifyLastLine
protected final boolean ignoreMissingFont
public AbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)
AbstractTextRenderer(JasperReportsContext, boolean, boolean, boolean, boolean).public AbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont, boolean defaultIndentFirstLine, boolean defaultJustifyLastLine)
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public int getTopPadding()
public int getLeftPadding()
public int getBottomPadding()
public int getRightPadding()
public JRStyledText getStyledText()
public String getPlainText()
public void initialize(JRPrintText text, JRStyledText styledText, int offsetX, int offsetY)
public void render()
protected void renderParagraph(AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText)
protected AttributedString getAttributedString()
public abstract void draw()
public static float getLineHeight(boolean isFirstLine,
JRParagraph paragraph,
float maxLeading,
float maxAscent)
public FontRenderContext getFontRenderContext()
Copyright © 2020 TIBCO Software Inc.. All rights reserved.