public class ParagraphRenderer extends BlockRenderer
renderer
object for a Paragraph
object. It will draw the glyphs of the textual content on the DrawContext
.
Modifier and Type | Field and Description |
---|---|
protected List<LineRenderer> |
lines |
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties
Constructor and Description |
---|
ParagraphRenderer(Paragraph modelElement)
Creates a ParagraphRenderer from its corresponding layout object.
|
Modifier and Type | Method and Description |
---|---|
protected AbstractRenderer |
createOverflowRenderer(int layoutResult)
Creates an overflow renderer.
|
protected ParagraphRenderer |
createOverflowRenderer(IRenderer parent) |
protected ParagraphRenderer |
createSplitRenderer(IRenderer parent) |
protected LayoutResult |
directLayout(LayoutContext layoutContext) |
void |
drawChildren(DrawContext drawContext)
Performs the drawing operation for all children of this renderer.
|
|
getDefaultProperty(int property)
Gets the default property from this entity.
|
protected Float |
getFirstYLineRecursively()
Gets the first yLine of the nested children recursively.
|
protected Float |
getLastYLineRecursively() |
List<LineRenderer> |
getLines()
Gets the lines which are the result of the layout(LayoutContext) .
|
MinMaxWidth |
getMinMaxWidth()
Calculates min and max width values for current renderer.
|
IRenderer |
getNextRenderer()
Gets a new instance of this class to be used as a next renderer, after this renderer is used, if layout(LayoutContext) is called more than once.
|
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.
|
void |
move(float dxRight, float dyUp)
Moves the renderer subtree by the specified offset.
|
protected ParagraphRenderer[] |
split() |
String |
toString()
Returns a string representation of the renderer.
|
applyRotationLayout, applyVerticalAlignment, beginRotationIfApplied, createRotationTransformInsideOccupiedArea, createSplitRenderer, draw, endRotationIfApplied, getOccupiedAreaBBox
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, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getInnerAreaBBox, 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, rectangleToPointsList, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
protected List<LineRenderer> lines
public 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.
layout
in interface IRenderer
layout
in class BlockRenderer
layoutContext
- the description of layout area and any other additional information
protected LayoutResult directLayout(LayoutContext layoutContext)
public IRenderer getNextRenderer()
layout(LayoutContext)
is called more than once.
If a renderer overflows to the next area, iText uses this method to create a renderer for the overflow part. So if one wants to extend ParagraphRenderer
, one should override this method: otherwise the default method will be used and thus the default rather than the custom renderer will be created.
publicT1 getDefaultProperty(int property)
getDefaultProperty
in interface IPropertyContainer
getDefaultProperty
in class AbstractRenderer
T1
- the return type associated with the property
property
- the property to be retrieved
null
will be returned
public String toString()
toString
in class AbstractRenderer
String
Object.toString()
public void drawChildren(DrawContext drawContext)
children
of this renderer.
drawChildren
in class AbstractRenderer
drawContext
- the context (canvas, document, etc) of this drawing operation.
public void move(float dxRight, float dyUp)
move
in interface IRenderer
move
in class AbstractRenderer
dxRight
- the x-axis offset in points. Positive value will move the renderer subtree to the right.
dyUp
- the y-axis offset in points. Positive value will move the renderer subtree to the top.
public List<LineRenderer> getLines()
layout(LayoutContext)
.
null
if layout hasn't been called yet
protected Float getFirstYLineRecursively()
AbstractRenderer
getFirstYLineRecursively
in class AbstractRenderer
protected Float getLastYLineRecursively()
getLastYLineRecursively
in class AbstractRenderer
protected ParagraphRenderer createOverflowRenderer(IRenderer parent)
protected ParagraphRenderer createSplitRenderer(IRenderer parent)
protected AbstractRenderer createOverflowRenderer(int layoutResult)
BlockRenderer
createOverflowRenderer
in class BlockRenderer
layoutResult
- the result of content layouting
AbstractRenderer
instance
public MinMaxWidth getMinMaxWidth()
BlockRenderer
getMinMaxWidth
in class BlockRenderer
MinMaxWidth
protected ParagraphRenderer[] split()
Copyright © 1998–2022 iText Group NV. All rights reserved.