Package com.itextpdf.layout.renderer
Class RootRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.RootRenderer
- All Implemented Interfaces:
-
IPropertyContainer,IRenderer
- Direct Known Subclasses:
-
CanvasRenderer,DocumentRenderer
-
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidAdds a child to the current renderervoidclose()This method correctly closes theRootRendererinstance.voidflush()Draws (flushes) the content.protected abstract voidflushSingleRenderer(IRenderer resultRenderer) protected voidlayout(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 voidshrinkCurrentAreaAndProcessRenderer(IRenderer renderer, List<IRenderer> resultRenderers, LayoutResult result) protected abstract LayoutAreaupdateCurrentArea(LayoutResult overflowResult) Methods inherited from class com.itextpdf.layout.renderer.AbstractRenderer
addAllProperties, 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, drawChildren, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getMinMaxWidth, 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, retrieveResolvedDeclaredHeight, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, toString, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.itextpdf.layout.renderer.IRenderer
getNextRenderer
-
Field Details
-
immediateFlush
protected boolean immediateFlush -
currentArea
-
waitingDrawingElements
-
-
Constructor Details
-
RootRenderer
public RootRenderer()
-
-
Method Details
-
addChild
Description copied from class:AbstractRendererAdds a child to the current renderer- Specified by:
-
addChildin interfaceIRenderer - Overrides:
-
addChildin classAbstractRenderer - Parameters:
-
renderer- a child to be added
-
flush
public void flush()Draws (flushes) the content. -
close
public void close()This method correctly closes theRootRendererinstance. There might be hanging elements, like in case ofProperty.KEEP_WITH_NEXTis set to true and when no consequent element has been added. This method addresses such situations. -
layout
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. 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
-
getCurrentArea
-
flushSingleRenderer
-
updateCurrentArea
-
shrinkCurrentAreaAndProcessRenderer
protected void shrinkCurrentAreaAndProcessRenderer(IRenderer renderer, List<IRenderer> resultRenderers, LayoutResult result) -
flushWaitingDrawingElements
protected void flushWaitingDrawingElements()
-