public abstract class BlockRenderer extends AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties| Modifier | Constructor and Description |
|---|---|
protected |
BlockRenderer(IElement modelElement)
Creates a BlockRenderer from its corresponding layout object.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyRotationLayout(Rectangle layoutBox)
This method rotates content of the renderer and
calculates correct occupied area for the rotated element.
|
protected void |
applyVerticalAlignment()
This method applies vertical alignment for the occupied area
of the renderer and its children renderers.
|
protected void |
beginRotationIfApplied(PdfCanvas canvas)
This method starts rotation for the renderer if rotation angle property is specified.
|
protected AbstractRenderer |
createOverflowRenderer(int layoutResult)
Creates an overflow renderer.
|
protected AffineTransform |
createRotationTransformInsideOccupiedArea()
This method creates
AffineTransform instance that could be used
to rotate content inside the occupied area. |
protected AbstractRenderer |
createSplitRenderer(int layoutResult)
Creates a split renderer.
|
void |
draw(DrawContext drawContext)
Flushes the renderer subtree contents, i.e.
|
protected void |
endRotationIfApplied(PdfCanvas canvas)
This method ends rotation for the renderer if applied.
|
MinMaxWidth |
getMinMaxWidth()
Calculates min and max width values for current renderer.
|
MinMaxWidth |
getMinMaxWidth(Float parentBoxWidth)
Calculates min and max width values for current renderer.
|
Rectangle |
getOccupiedAreaBBox()
Gets the bounding box that contains all content written to the
DrawContext by this IRenderer. |
protected PdfFont |
getResolvedFont(PdfDocument pdfDocument)
Get the font set in properties, if it is not set, then resolves the first
PdfFont from
FontProvider. |
LayoutResult |
layout(LayoutContext layoutContext)
This method simulates positioning of the renderer, including all of its children, and returns
the
LayoutResult, representing the layout result, including occupied area, status, i.e. |
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, drawBackground, drawBorder, drawChildren, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getModelElement, getOccupiedArea, 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, updateWidthclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNextRendererpublic LayoutResult layout(LayoutContext layoutContext)
LayoutResult, representing the layout result, including occupied area, status, i.e.
if there was enough place to fit the renderer subtree, etc.
LayoutResult can be extended to return custom layout results for custom elements, e.g.
TextRenderer uses TextLayoutResult as its result.
This method can be called standalone to learn how much area the renderer subtree needs, or can be called
before IRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.layoutContext - the description of layout area and any other additional informationpublic void draw(DrawContext drawContext)
AbstractRendererPdfDocument etc.draw in interface IRendererdraw in class AbstractRendererdrawContext - contains the PdfDocument to which the renderer subtree if flushed,
the PdfCanvas on which the renderer subtree is drawn and other additional parameters
needed to perform drawingpublic Rectangle getOccupiedAreaBBox()
AbstractRendererDrawContext by this IRenderer.getOccupiedAreaBBox in class AbstractRendererRectangle that surrounds the contentprotected AbstractRenderer createSplitRenderer(int layoutResult)
layoutResult - the result of content layoutingAbstractRenderer instanceprotected AbstractRenderer createOverflowRenderer(int layoutResult)
layoutResult - the result of content layoutingAbstractRenderer instanceprotected void applyVerticalAlignment()
protected void applyRotationLayout(Rectangle layoutBox)
layoutBox - a Rectangleprotected AffineTransform createRotationTransformInsideOccupiedArea()
AffineTransform instance that could be used
to rotate content inside the occupied area. Be aware that it should be used only after
layout rendering is finished and correct occupied area for the rotated element is calculated.AffineTransform that rotates the content and places it inside occupied area.protected void beginRotationIfApplied(PdfCanvas canvas)
canvas - the PdfCanvas to draw onprotected void endRotationIfApplied(PdfCanvas canvas)
canvas - the PdfCanvas to draw onprotected PdfFont getResolvedFont(PdfDocument pdfDocument)
PdfFont from
FontProvider.
If FontProvider is not set, then returns null.pdfDocument - the PdfDocument to get default font from.FontProvider is not set.public MinMaxWidth getMinMaxWidth()
getMinMaxWidth in class AbstractRendererMinMaxWidthpublic MinMaxWidth getMinMaxWidth(Float parentBoxWidth)
getMinMaxWidth in class AbstractRendererparentBoxWidth - max width of the area on which current renderer will be laid outMinMaxWidthCopyright © 1998–2025 Apryse Group NV. All rights reserved.