Package com.itextpdf.layout.renderer
Class MulticolRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.MulticolRenderer
- All Implemented Interfaces:
-
IPropertyContainer,IRenderer
Represents a renderer for columns.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface which used for additional height calculationstatic classDefault implementation ofMulticolRenderer.ColumnHeightCalculatorwhich allows 4 relayouts and performs simple additional height calculation (split the elements which don't fit).static classRepresents result of one iteration of MulticolRenderer layouting It contains split renderers which were lauded on a given height and overflow renderer for which height should be increased, so it can be lauded. -
Field Summary
Fields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties -
Constructor Summary
ConstructorsConstructorDescriptionMulticolRenderer(MulticolContainer modelElement) Creates a DivRenderer from its corresponding layout object. -
Method Summary
Modifier and TypeMethodDescriptionprotected AbstractRenderercreateOverflowRenderer(IRenderer overflowedContentRenderer) Creates an overflow renderer.voiddrawBorder(DrawContext drawContext) Performs the drawing operation for the border of this renderer, if defined by theProperty.BORDER_TOP,Property.BORDER_RIGHT,Property.BORDER_BOTTOMandProperty.BORDER_LEFTvalues in either the layout element or thisIRendereritself.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.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 MulticolRenderer.MulticolLayoutResultlayoutInColumns(LayoutContext layoutContext, Rectangle actualBBox) Layouts multicol in the passed area.final voidsetHeightCalculator(MulticolRenderer.ColumnHeightCalculator heightCalculator) Sets the height calculator to be used by this renderer.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, 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, updateWidth
-
Constructor Details
-
MulticolRenderer
Creates a DivRenderer from its corresponding layout object.- Parameters:
-
modelElement- theMulticolContainerwhich this object should manage
-
-
Method Details
-
setHeightCalculator
Sets the height calculator to be used by this renderer.- Parameters:
-
heightCalculator- the height calculator to be used by this renderer.
-
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
-
getNextRenderer
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.- Returns:
- new renderer instance
-
drawBorder
Performs the drawing operation for the border of this renderer, if defined by theProperty.BORDER_TOP,Property.BORDER_RIGHT,Property.BORDER_BOTTOMandProperty.BORDER_LEFTvalues in either the layout element or thisIRendereritself.- Overrides:
-
drawBorderin classAbstractRenderer - Parameters:
-
drawContext- the context (canvas, document, etc) of this drawing operation.
-
layoutInColumns
protected MulticolRenderer.MulticolLayoutResult layoutInColumns(LayoutContext layoutContext, Rectangle actualBBox) Layouts multicol in the passed area.- Parameters:
-
layoutContext- the layout context -
actualBBox- the area to layout multicol on - Returns:
-
the
MulticolRenderer.MulticolLayoutResultinstance
-
createOverflowRenderer
Creates an overflow renderer.- Parameters:
-
overflowedContentRenderer- an overflowed content renderer - Returns:
-
a new
AbstractRendererinstance
-