Class AbstractTextRenderer
java.lang.Object
net.sf.jasperreports.engine.export.AbstractTextRenderer
- Direct Known Subclasses:
AbstractPdfTextRenderer,AwtTextRenderer
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected intprotected AttributedStringprotected Stringprotected floatprotected floatprotected final FontUtilprotected intprotected intprotected final booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected final JasperReportsContextprotected booleanprotected intstatic final FontRenderContextprotected floatprotected final JRPropertiesUtilprotected intprotected intprotected List<AbstractTextRenderer.TabSegment> protected JRStyledTextprotected JRPrintTextprotected intprotected floatprotected intprotected intprotected int -
Constructor Summary
ConstructorsConstructorDescriptionAbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont, boolean defaultIndentFirstLine, boolean defaultJustifyLastLine) -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddraw()protected AttributedStringintpublic 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; } /**intintstatic floatgetLineHeight(boolean isFirstLine, JRParagraph paragraph, float maxLeading, float maxAscent) protected StyledTextListWriterintintintgetWidth()intgetX()intgetY()voidinitialize(JRPrintText text, JRStyledText styledText, int offsetX, int offsetY) voidrender()protected voidrenderParagraph(AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText)
-
Field Details
-
LINE_BREAK_FONT_RENDER_CONTEXT
-
jasperReportsContext
-
propUtil
-
fontUtil
-
text
-
styledText
-
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 -
isFirstParagraph
protected boolean isFirstParagraph -
isLastParagraph
protected boolean isLastParagraph -
segments
-
segmentIndex
protected int segmentIndex -
indentFirstLine
protected boolean indentFirstLine -
justifyLastLine
protected boolean justifyLastLine -
htmlListIndent
protected int htmlListIndent -
bulletText
-
bulletChunk
-
ignoreMissingFont
protected final boolean ignoreMissingFont
-
-
Constructor Details
-
AbstractTextRenderer
public AbstractTextRenderer(JasperReportsContext jasperReportsContext, boolean isMinimizePrinterJobSize, boolean ignoreMissingFont, boolean defaultIndentFirstLine, boolean defaultJustifyLastLine)
-
-
Method Details
-
getX
public int getX() -
getY
public int getY() -
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getTopPadding
public int getTopPadding() -
getLeftPadding
public int getLeftPadding() -
getBottomPadding
public int getBottomPadding() -
getRightPadding
public int getRightPadding() -
getStyledText
-
getPlainText
-
initialize
-
render
public void render() -
getListWriter
-
renderParagraph
protected void renderParagraph(AttributedCharacterIterator allParagraphs, int paragraphStart, String paragraphText) -
getAttributedString
-
draw
public abstract void draw() -
getLineHeight
public static float getLineHeight(boolean isFirstLine, JRParagraph paragraph, float maxLeading, float maxAscent) -
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; } /**
-