Package com.itextpdf.layout.renderer
Class LineRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.LineRenderer
- All Implemented Interfaces:
-
IPropertyContainer,IRenderer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]protected floatprotected floatFields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LineRendererprotected voidapplyLeading(float deltaY) protected intReturns the number of base characters, i.e.booleanprotected LineRendererprotected LineRenderervoiddrawChildren(DrawContext drawContext) Performs the drawing operation for allchildrenof this renderer.protected FloatGets the first yLine of the nested children recursively.protected FloatfloatgetLeadingValue(Leading leading) floatfloatCalculates min and max width values for current renderer.Gets a new instance of this class to be used as a next renderer, after this renderer is used, ifIRenderer.layout(LayoutContext)is called more than once.protected intfloatgetYLine()voidjustify(float width) layout(LayoutContext layoutContext) This method simulates positioning of the renderer, including all of its children, and returns theLayoutResult, representing the layout result, including occupied area, status, i.e.protected intlength()Gets the total lengths of characters in this line.protected FloatRetrieve the resolved height declaration.protected LineRenderer[]split()toString()Returns a string representation of the renderer.protected LineRenderertrimLast()Methods inherited from class com.itextpdf.layout.renderer.AbstractRenderer
addAllProperties, addChild, alignChildHorizontally, allowLastYLineRecursiveExtraction, applyAbsolutePosition, applyAction, applyBorderBox, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyPaddings, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, beginTransformationIfApplied, calculateAbsolutePdfBBox, calculateBBox, calculateShiftToPositionBBoxOfPointsAt, clipBackgroundArea, clipBackgroundArea, clipBorderArea, createXObject, deleteOwnProperty, deleteProperty, draw, drawBackground, drawBorder, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getInnerAreaBBox, getMargins, getMinMaxWidth, getModelElement, getOccupiedArea, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getPaddings, getParent, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, getPropertyAsTransparentColor, getPropertyAsUnitValue, hasAbsoluteUnitValue, hasOwnOrModelProperty, hasOwnProperty, hasProperty, hasRelativeUnitValue, initElementAreas, isAbsolutePosition, isBorderBoxSizing, isFirstOnRootArea, isFixedLayout, isFlushed, isKeepTogether, isNotFittingHeight, isNotFittingLayoutArea, isNotFittingWidth, isOverflowFit, isOverflowProperty, isOverflowProperty, isOverflowProperty, isPositioned, isRelativePosition, isStaticLayout, move, rectangleToPointsList, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
-
Field Details
-
maxAscent
protected float maxAscent -
maxDescent
protected float maxDescent -
levels
protected byte[] levels
-
-
Constructor Details
-
LineRenderer
public LineRenderer()
-
-
Method Details
-
layout
Description copied from interface:IRendererThis method simulates positioning of the renderer, including all of its children, and returns theLayoutResult, representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc.LayoutResultcan be extended to return custom layout results for custom elements, e.g.TextRendererusesTextLayoutResultas its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called beforeIRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.- Parameters:
-
layoutContext- the description of layout area and any other additional information - Returns:
- result of the layout process
-
getMaxAscent
public float getMaxAscent() -
getMaxDescent
public float getMaxDescent() -
getYLine
public float getYLine() -
getLeadingValue
-
drawChildren
Description copied from class:AbstractRendererPerforms the drawing operation for allchildrenof this renderer.- Overrides:
-
drawChildrenin classAbstractRenderer - Parameters:
-
drawContext- the context (canvas, document, etc) of this drawing operation.
-
getNextRenderer
Description copied from interface:IRendererGets a new instance of this class to be used as a next renderer, after this renderer is used, ifIRenderer.layout(LayoutContext)is called more than once.- Returns:
- new renderer instance
-
getFirstYLineRecursively
Description copied from class:AbstractRendererGets the first yLine of the nested children recursively. E.g. for a list, this will be the yLine of the first item (if the first item is indeed a paragraph). NOTE: this method will no go further than the first child.- Overrides:
-
getFirstYLineRecursivelyin classAbstractRenderer - Returns:
- the first yline of the nested children, null if there is no text found
-
getLastYLineRecursively
- Overrides:
-
getLastYLineRecursivelyin classAbstractRenderer
-
justify
public void justify(float width) -
getNumberOfSpaces
protected int getNumberOfSpaces() -
length
protected int length()Gets the total lengths of characters in this line. Other elements (images, tables) are not taken into account.- Returns:
- the total lengths of characters in this line.
-
baseCharactersCount
protected int baseCharactersCount()Returns the number of base characters, i.e. non-mark characters- Returns:
- the number of base non-mark characters
-
toString
Description copied from class:AbstractRendererReturns a string representation of the renderer.- Overrides:
-
toStringin classAbstractRenderer - Returns:
-
a
String - See Also:
-
createSplitRenderer
-
createOverflowRenderer
-
split
-
adjustChildrenYLine
-
applyLeading
protected void applyLeading(float deltaY) -
trimLast
-
containsImage
public boolean containsImage() -
getMinMaxWidth
Description copied from class:AbstractRendererCalculates min and max width values for current renderer.- Overrides:
-
getMinMaxWidthin classAbstractRenderer - Returns:
-
instance of
MinMaxWidth
-
retrieveResolvedDeclaredHeight
Retrieve the resolved height declaration. If it has a relative height declaration,AbstractRenderer.retrieveHeight()is called.- Overrides:
-
retrieveResolvedDeclaredHeightin classAbstractRenderer - Returns:
-
nullif no height declaration is set on the parent, or if its own height declaration cannot be resolved. The float value of the resolved height otherwise
-