IMPLTYPE - Implementation typepublic abstract class AbstractPLText<IMPLTYPE extends AbstractPLText<IMPLTYPE>> extends AbstractPLAlignedElement<IMPLTYPE>
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_ROWS |
static boolean |
DEFAULT_TOP_DOWN |
protected List<TextAndWidthSpec> |
m_aPreparedLines |
protected com.helger.commons.collection.ext.ICommonsList<TextAndWidthSpec> |
m_aPreparedLinesUnmodified |
protected float |
m_fLineHeight |
protected int |
m_nPreparedLineCountUnmodified |
DEFAULT_HORZ_ALIGNMENTDEFAULT_VERT_ALIGNMENTDEFAULT_MAX_SIZE, DEFAULT_MIN_SIZEDEFAULT_MARGINDEFAULT_PADDINGDEFAULT_BORDERDEFAULT_FILL_COLOR| Constructor and Description |
|---|
AbstractPLText(String sText,
FontSpec aFontSpec) |
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.collection.ext.ICommonsList<TextAndWidthSpec> |
getAllPreparedLinesUnmodified() |
PLElementWithSize |
getCopy(float fElementWidth,
List<TextAndWidthSpec> aLines,
boolean bSplittableCopy) |
protected float |
getDisplayHeightOfLines(int nLineCount) |
FontSpec |
getFontSpec() |
int |
getMaxRows() |
int |
getPreparedLineCountUnmodified() |
String |
getText() |
protected String |
getTextToDraw(String sText,
RenderingContext aCtx)
Get the text to draw, in case it is different from the stored text (e.g.
|
boolean |
hasNoText() |
boolean |
hasText() |
boolean |
isTopDown() |
protected void |
onPerform(RenderingContext aCtx)
Abstract method to be implemented by subclasses.
|
protected SizeSpec |
onPrepare(PreparationContext aCtx)
The abstract method that must be implemented by all subclasses.
|
IMPLTYPE |
setBasicDataFrom(AbstractPLText<?> aSource) |
IMPLTYPE |
setMaxRows(int nMaxRows)
Set the maximum number of rows to render.
|
IMPLTYPE |
setTopDown(boolean bTopDown)
Set the rendering direction: top-down or bottom-up.
|
String |
toString() |
getHorzAlign, getVertAlign, setBasicDataFrom, setHorzAlign, setVertAligngetBorder, getFillColor, getMargin, getPadding, setBasicDataFrom, setBorder, setFillColor, setMargin, setPaddinggetMaxSize, getMinSize, getPreparedSize, internalCheckNotPrepared, internalMarkAsNotPrepared, internalMarkAsPrepared, isPrepared, onPerformFillAndBorder, perform, prepare, setMaxSize, setMinSizegetDebugID, getID, setBasicDataFrom, setIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAsSplittable, getDebugID, isSplittabledoPageSetup, getMaxSize, getMinSize, getPreparedSize, isPrepared, perform, prepare, setExactSize, setMaxSize, setMinSizegetFullBottom, getFullLeft, getFullRight, getFullTop, getFullXSum, getFullYSum, getMarginAndBorderBottom, getMarginAndBorderLeft, getMarginAndBorderRight, getMarginAndBorderTop, getMarginAndBorderXSum, getMarginAndBorderYSumgetMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMarginXSum, getMarginYSum, setMargin, setMargin, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTopgetPaddingBottom, getPaddingLeft, getPaddingRight, getPaddingTop, getPaddingXSum, getPaddingYSum, setPadding, setPadding, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTopgetBorderBottomWidth, getBorderLeftWidth, getBorderRightWidth, getBorderTopWidth, getBorderXSumWidth, getBorderYSumWidth, setBorder, setBorder, setBorder, setBorderBottom, setBorderLeft, setBorderRight, setBorderTophasFillColorpublic static final boolean DEFAULT_TOP_DOWN
public static final int DEFAULT_MAX_ROWS
protected int m_nPreparedLineCountUnmodified
protected com.helger.commons.collection.ext.ICommonsList<TextAndWidthSpec> m_aPreparedLinesUnmodified
@CodingStyleguideUnaware protected List<TextAndWidthSpec> m_aPreparedLines
protected float m_fLineHeight
public boolean hasText()
public boolean hasNoText()
@Nonnull @OverridingMethodsMustInvokeSuper public IMPLTYPE setBasicDataFrom(@Nonnull AbstractPLText<?> aSource)
public boolean isTopDown()
true if the text is rendered from top to bottom, or
false if the text is rendered from bottom to top. The
default value is DEFAULT_TOP_DOWN.@Nonnull public IMPLTYPE setTopDown(boolean bTopDown)
bTopDown - true to render top-down, false to render
bottom-up.@CheckForSigned public int getMaxRows()
DEFAULT_MAX_ROWS.@Nonnull public IMPLTYPE setMaxRows(int nMaxRows)
nMaxRows - Maximum number of rows. If ≤ 0 than all lines are rendered.protected SizeSpec onPrepare(@Nonnull PreparationContext aCtx) throws IOException
AbstractPLRenderableObjectonPrepare in class AbstractPLRenderableObject<IMPLTYPE extends AbstractPLText<IMPLTYPE>>aCtx - Preparation context. Never null.null.IOException - on error@Nonnegative public int getPreparedLineCountUnmodified()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<TextAndWidthSpec> getAllPreparedLinesUnmodified()
@Nonnull @OverrideOnDemand protected String getTextToDraw(@Nonnull String sText, @Nonnull RenderingContext aCtx)
PLTextWithPlaceholders)sText - Original text. Never null.aCtx - The current rendering context. Never null.null.protected void onPerform(@Nonnull RenderingContext aCtx) throws IOException
AbstractPLRenderableObjectonPerform in class AbstractPLRenderableObject<IMPLTYPE extends AbstractPLText<IMPLTYPE>>aCtx - Rendering contextIOException - In case of a PDFBox errorprotected final float getDisplayHeightOfLines(@Nonnegative int nLineCount)
@Nonnull public PLElementWithSize getCopy(float fElementWidth, @Nonnull @Nonempty List<TextAndWidthSpec> aLines, boolean bSplittableCopy)
public String toString()
toString in class AbstractPLAlignedElement<IMPLTYPE extends AbstractPLText<IMPLTYPE>>Copyright © 2014–2016 Philip Helger. All rights reserved.