public abstract class AbstractTextRenderer extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
allText |
protected int |
bottomPadding |
protected float |
drawPosX |
protected float |
drawPosY |
protected int |
height |
protected boolean |
isMaxHeightReached |
protected JasperReportsContext |
jasperReportsContext |
protected int |
leftPadding |
static FontRenderContext |
LINE_BREAK_FONT_RENDER_CONTEXT |
protected float |
lineHeight |
protected int |
rightPadding |
protected int |
segmentIndex |
protected 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 and Description |
---|
AbstractTextRenderer(JasperReportsContext jasperReportsContext,
boolean isMinimizePrinterJobSize,
boolean ignoreMissingFont) |
Modifier and Type | Method and Description |
---|---|
abstract 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;
}
/**
|
int |
getHeight() |
static float |
getLineHeight(boolean isFirstLine,
JRParagraph paragraph,
float maxLeading,
float maxAscent) |
String |
getPlainText() |
JRStyledText |
getStyledText() |
int |
getWidth() |
int |
getX() |
int |
getY() |
void |
initialize(JRPrintText text,
JRStyledText styledText,
int offsetX,
int offsetY) |
void |
render() |
public static final FontRenderContext LINE_BREAK_FONT_RENDER_CONTEXT
protected final JasperReportsContext jasperReportsContext
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 List<net.sf.jasperreports.engine.export.TabSegment> segments
protected int segmentIndex
public AbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont)
public int getX()
public int getY()
public int getWidth()
public int getHeight()
public JRStyledText getStyledText()
public String getPlainText()
public void initialize(JRPrintText text, JRStyledText styledText, int offsetX, int offsetY)
public void render()
public abstract void draw()
public static float getLineHeight(boolean isFirstLine, JRParagraph paragraph, float maxLeading, float maxAscent)
public FontRenderContext getFontRenderContext()
Copyright © 2017. All rights reserved.