Package com.itextpdf.layout.renderer
Class AbstractRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
- All Implemented Interfaces:
-
IPropertyContainer,IRenderer
- Direct Known Subclasses:
-
BlockRenderer,ImageRenderer,LineRenderer,MulticolRenderer,RootRenderer,TableRenderer,TabRenderer,TextRenderer
Defines the most common properties and behavior that are shared by most
IRenderer implementations. All default Renderers are subclasses of this default implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final floatThe maximum difference betweenRectanglecoordinates to consider rectangles equalprotected booleanprotected static final floatThe infinity value which is used while layoutingprotected booleanprotected IPropertyContainerprotected LayoutAreastatic final floatprotected IRenderer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a renderer.protectedAbstractRenderer(IElement modelElement) Creates a renderer for the specified layout element.protectedAbstractRenderer(AbstractRenderer other) Creates a new renderer based on an instance of another renderer. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAllProperties(Map<Integer, Object> properties) voidAdds a child to the current rendererprotected voidalignChildHorizontally(IRenderer childRenderer, Rectangle currentArea) protected booleanprotected voidapplyAbsolutePosition(Rectangle parentRect) protected voidapplyAction(PdfDocument document) applyBorderBox(Rectangle rect, boolean reverse) Applies the border box of the renderer on the given rectangle If the border of a certain side is null, the side will remain as it was.protected RectangleapplyBorderBox(Rectangle rect, Border[] borders, boolean reverse) Applies the given border box (borders) on the given rectangleprotected voidapplyDestination(PdfDocument document) protected voidapplyDestinationsAndAnnotation(DrawContext drawContext) protected voidapplyLinkAnnotation(PdfDocument document) applyMargins(Rectangle rect, boolean reverse) Applies margins of the renderer on the given rectangleprotected RectangleapplyMargins(Rectangle rect, UnitValue[] margins, boolean reverse) Applies given margins on the given rectangleapplyPaddings(Rectangle rect, boolean reverse) Applies paddings of the renderer on the given rectangleprotected RectangleapplyPaddings(Rectangle rect, UnitValue[] paddings, boolean reverse) Applies given paddings to the given rectangle.protected voidapplyRelativePositioningTranslation(boolean reverse) protected voidbeginElementOpacityApplying(DrawContext drawContext) ApplyProperty.OPACITYproperty if specified by setting corresponding values in graphic state dictionary opacity will be applied to all elements drawn after calling this method and before callingendElementOpacityApplying(DrawContext)()}.protected voidprotected RectangleCalculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, e.g.protected RectanglecalculateBBox(List<Point> points) Calculates bounding box around points.protected float[]calculateShiftToPositionBBoxOfPointsAt(float left, float top, List<Point> points) This method calculates the shift needed to be applied to the points in order to position upper and left borders of their bounding box at the given lines.protected booleanclipBackgroundArea(DrawContext drawContext, Rectangle outerBorderBox) protected booleanclipBackgroundArea(DrawContext drawContext, Rectangle outerBorderBox, boolean considerBordersBeforeClipping) protected booleanclipBorderArea(DrawContext drawContext, Rectangle outerBorderBox) static PdfFormXObjectcreateXObject(AbstractLinearGradientBuilder linearGradientBuilder, Rectangle xObjectArea, PdfDocument document) Create aPdfFormXObjectwith the given area and containing a linear gradient inside.voiddeleteOwnProperty(int property) Deletes the own property of this entity.voiddeleteProperty(int property) Deletes property from this very renderer, or in case the property is specified on its model element, the property of the model element is deletedvoiddraw(DrawContext drawContext) Flushes the renderer subtree contents, i.e.voiddrawBackground(DrawContext drawContext) Draws a background layer if it is defined by a keyProperty.BACKGROUNDin either the layout element or thisIRendereritself.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.voiddrawChildren(DrawContext drawContext) Performs the drawing operation for allchildrenof this renderer.protected voidendElementOpacityApplying(DrawContext drawContext) protected voidendTransformationIfApplied(PdfCanvas canvas) protected RectanglegetBackgroundArea(Rectangle occupiedAreaWithMargins) Evaluate the actual backgroundGets the border box of a renderer.protected BorderRadius[]Gets border radii of the element in the specified order: top-left, top-right, bottom-right, bottom-left.protected Border[]Gets borders of the element in the specified order: top, right, bottom, left.Gets the childIRenderers.T1 getDefaultProperty(int property) Gets the default property from this entity.protected FloatGets the first yLine of the nested children recursively.protected Floatprotected UnitValue[]Returns margins of the renderer [0] - top; [1] - right; [2] - bottom; [3] - leftCalculates min and max width values for current renderer.getMinMaxWidth(Float areaMaxWidth) Calculates min and max width values for current renderer.Gets the model element associated with this renderer.Gets the resultant occupied area after the last call to theIRenderer.layout(LayoutContext)method.Gets the bounding box that contains all content written to theDrawContextby thisIRenderer.T1 getOwnProperty(int property) Gets own property from this entity.protected UnitValue[]Returns paddings of the renderer [0] - top; [1] - right; [2] - bottom; [3] - leftGets the parentIRenderer.T1 getProperty(int key) Gets the property from this entity.T1 getProperty(int property, T1 defaultValue) Gets a property from this entity or one of its hierarchical parents.getPropertyAsBoolean(int property) Returns a property with a certain key, as a boolean value.getPropertyAsColor(int property) Returns a property with a certain key, as a color.getPropertyAsFloat(int property) Returns a property with a certain key, as a floating point value.getPropertyAsFloat(int property, Float defaultValue) Returns a property with a certain key, as a floating point value.getPropertyAsFont(int property) Returns a property with a certain key, as a font object.getPropertyAsInteger(int property) Returns a property with a certain key, as an integer value.getPropertyAsTransparentColor(int property) Returns a property with a certain key, as aTransparentColor.getPropertyAsUnitValue(int property) Returns a property with a certain key, as a unit value.protected booleanhasAbsoluteUnitValue(int property) Check if corresponding property has point value.booleanhasOwnOrModelProperty(int property) Checks if this renderer or its model element have the specified property, i.e.booleanhasOwnProperty(int property) Checks if this entity has the specified property, i.e.booleanhasProperty(int property) Checks if this entity has the specified property.protected booleanhasRelativeUnitValue(int property) Check if corresponding property has relative value.initElementAreas(LayoutArea area) Gets all rectangles that thisIRenderercan draw upon in the given area.protected booleanprotected static booleanisBorderBoxSizing(IRenderer renderer) booleanprotected booleanIndicates whether the renderer's position is fixed or not.booleanIndicates whether this renderer is flushed or not, i.e.protected booleanprotected booleanisNotFittingHeight(LayoutArea layoutArea) protected booleanisNotFittingLayoutArea(LayoutArea layoutArea) protected booleanisNotFittingWidth(LayoutArea layoutArea) protected static booleanisOverflowFit(OverflowPropertyValue rendererOverflowProperty) protected booleanisOverflowProperty(OverflowPropertyValue equalsTo, int overflowProperty) protected static booleanisOverflowProperty(OverflowPropertyValue equalsTo, OverflowPropertyValue rendererOverflowProperty) protected static booleanisOverflowProperty(OverflowPropertyValue equalsTo, IRenderer renderer, int overflowProperty) protected booleanIndicates whether the renderer's position is fixed or not.protected booleanprotected booleanvoidmove(float dxRight, float dyUp) Moves the renderer subtree by the specified offset.protected FloatRetrieves the element's fixed content box height, if it's set.protected FloatRetrieve element's content box max-ehight, if it's set.protected FloatretrieveMaxWidth(float parentBoxWidth) Retrieves element's fixed content box max width, if it's set.protected FloatRetrieves element's content box min-height, if it's set.protected FloatretrieveMinWidth(float parentBoxWidth) Retrieves element's fixed content box max width, if it's set.protected FloatRetrieve the resolved height declaration.protected FloatretrieveUnitValue(float baseValue, int property) protected FloatretrieveUnitValue(float baseValue, int property, boolean pointOnly) protected FloatretrieveWidth(float parentBoxWidth) Retrieves element's fixed content box width, if it's set.protected AbstractRenderersetBorders(Border border, int borderNumber) protected booleansetMinMaxWidthBasedOnFixedWidth(MinMaxWidth minMaxWidth) Explicitly sets this object as the child of anotherIRendererin the renderer hierarchy.voidsetProperty(int property, Object value) Sets a property for this entity.toString()Returns a string representation of the renderer.transformPoints(List<Point> points, AffineTransform transform) protected voidupdateHeight(UnitValue updatedHeight) Updates fixed content box height value for this renderer.protected voidupdateHeightsOnSplit(boolean wasHeightClipped, AbstractRenderer splitRenderer, AbstractRenderer overflowRenderer) protected voidupdateMaxHeight(UnitValue updatedMaxHeight) Updates content box max-height value for this renderer.protected voidupdateMinHeight(UnitValue updatedMinHeight) Updates content box min-height value for this renderer.protected voidupdateWidth(UnitValue updatedWidthValue) Updates fixed content box width value for this renderer.Methods 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, layout
-
Field Details
-
OVERLAP_EPSILON
public static final float OVERLAP_EPSILON- See Also:
-
EPS
protected static final float EPSThe maximum difference betweenRectanglecoordinates to consider rectangles equal- See Also:
-
INF
protected static final float INFThe infinity value which is used while layouting- See Also:
-
childRenderers
-
positionedRenderers
-
modelElement
-
flushed
protected boolean flushed -
occupiedArea
-
parent
-
properties
-
isLastRendererForModelElement
protected boolean isLastRendererForModelElement
-
-
Constructor Details
-
AbstractRenderer
protected AbstractRenderer()Creates a renderer. -
AbstractRenderer
Creates a renderer for the specified layout element.- Parameters:
-
modelElement- the layout element that will be drawn by this renderer
-
AbstractRenderer
Creates a new renderer based on an instance of another renderer.- Parameters:
-
other- renderer from which to copy essential properties
-
-
Method Details
-
addChild
Adds a child to the current renderer -
getModelElement
Gets the model element associated with this renderer.- Specified by:
-
getModelElementin interfaceIRenderer - Returns:
-
the model element, as a
container of properties
-
getChildRenderers
Gets the childIRenderers.- Specified by:
-
getChildRenderersin interfaceIRenderer - Returns:
-
a list of direct child
renderersof this instance
-
hasProperty
public boolean hasProperty(int property) Checks if this entity has the specified property. Compared toIPropertyContainer.hasOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance- Specified by:
-
hasPropertyin interfaceIPropertyContainer - Parameters:
-
property- the property to be checked - Returns:
-
trueif this instance has given property,falseotherwise
-
hasOwnProperty
public boolean hasOwnProperty(int property) Checks if this entity has the specified property, i.e. if it was set to this very element earlier- Specified by:
-
hasOwnPropertyin interfaceIPropertyContainer - Parameters:
-
property- the property to be checked - Returns:
-
trueif this instance has given own property,falseotherwise
-
hasOwnOrModelProperty
public boolean hasOwnOrModelProperty(int property) Checks if this renderer or its model element have the specified property, i.e. if it was set to this very element or its very model element earlier.- Parameters:
-
property- the property to be checked - Returns:
-
trueif this instance or its model element have given own property,falseotherwise
-
deleteOwnProperty
public void deleteOwnProperty(int property) Deletes the own property of this entity.- Specified by:
-
deleteOwnPropertyin interfaceIPropertyContainer - Parameters:
-
property- the property to be deleted
-
deleteProperty
public void deleteProperty(int property) Deletes property from this very renderer, or in case the property is specified on its model element, the property of the model element is deleted- Parameters:
-
property- the property key to be deleted
-
getProperty
publicT1 getProperty (int key) Gets the property from this entity. Compared toIPropertyContainer.getOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance- Specified by:
-
getPropertyin interfaceIPropertyContainer - Type Parameters:
-
T1- the return type associated with the property - Parameters:
-
key- the property to be retrieved - Returns:
-
the value of the given property.
nullwill be returned if the property value was not found
-
getOwnProperty
publicT1 getOwnProperty (int property) Gets own property from this entity. The property must have been set earlier to this entity. If the property is not found,nullwill be returned.- Specified by:
-
getOwnPropertyin interfaceIPropertyContainer - Type Parameters:
-
T1- the return type associated with the property - Parameters:
-
property- the property to be retrieved - Returns:
-
the value of the given own property.
nullwill be returned if the property value was not found
-
getProperty
publicT1 getProperty (int property, T1 defaultValue) Gets a property from this entity or one of its hierarchical parents. If the property is not found,defaultValuewill be returned.- Specified by:
-
getPropertyin interfaceIRenderer - Type Parameters:
-
T1- the return type associated with the property - Parameters:
-
property- the property to be retrieved -
defaultValue- a fallback value - Returns:
- the value of the given property
-
setProperty
Sets a property for this entity.- Specified by:
-
setPropertyin interfaceIPropertyContainer - Parameters:
-
property- the property to be set -
value- the value of the property
-
getDefaultProperty
publicT1 getDefaultProperty (int property) Gets the default property from this entity.- Specified by:
-
getDefaultPropertyin interfaceIPropertyContainer - Type Parameters:
-
T1- the return type associated with the property - Parameters:
-
property- the property to be retrieved - Returns:
-
the default property value. If the default property is not defined,
nullwill be returned
-
getPropertyAsFont
Returns a property with a certain key, as a font object.- Parameters:
-
property- anenum value - Returns:
-
a
PdfFont
-
getPropertyAsColor
Returns a property with a certain key, as a color.- Parameters:
-
property- anenum value - Returns:
-
a
Color
-
getPropertyAsTransparentColor
Returns a property with a certain key, as aTransparentColor.- Parameters:
-
property- anenum value - Returns:
-
a
TransparentColor
-
getPropertyAsFloat
Returns a property with a certain key, as a floating point value.- Parameters:
-
property- anenum value - Returns:
-
a
Float
-
getPropertyAsFloat
Returns a property with a certain key, as a floating point value.- Parameters:
-
property- anenum value -
defaultValue- default value to be returned if property is not found - Returns:
-
a
Float
-
getPropertyAsBoolean
Returns a property with a certain key, as a boolean value.- Parameters:
-
property- anenum value - Returns:
-
a
Boolean
-
getPropertyAsUnitValue
Returns a property with a certain key, as a unit value.- Parameters:
-
property- anenum value - Returns:
-
a
UnitValue
-
getPropertyAsInteger
Returns a property with a certain key, as an integer value.- Parameters:
-
property- anenum value - Returns:
-
a
Integer
-
toString
Returns a string representation of the renderer. -
getOccupiedArea
Gets the resultant occupied area after the last call to theIRenderer.layout(LayoutContext)method.- Specified by:
-
getOccupiedAreain interfaceIRenderer - Returns:
-
LayoutAreainstance
-
draw
Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to thePdfDocumentetc.- Specified by:
-
drawin interfaceIRenderer - Parameters:
-
drawContext- contains thePdfDocumentto which the renderer subtree if flushed, thePdfCanvason which the renderer subtree is drawn and other additional parameters needed to perform drawing
-
beginElementOpacityApplying
ApplyProperty.OPACITYproperty if specified by setting corresponding values in graphic state dictionary opacity will be applied to all elements drawn after calling this method and before callingendElementOpacityApplying(DrawContext)()}.- Parameters:
-
drawContext- the context (canvas, document, etc) of this drawing operation.
-
endElementOpacityApplying
- Parameters:
-
drawContext- the context (canvas, document, etc) of this drawing operation.
-
drawBackground
Draws a background layer if it is defined by a keyProperty.BACKGROUNDin either the layout element or thisIRendereritself.- Parameters:
-
drawContext- the context (canvas, document, etc) of this drawing operation.
-
createXObject
public static PdfFormXObject createXObject(AbstractLinearGradientBuilder linearGradientBuilder, Rectangle xObjectArea, PdfDocument document) Create aPdfFormXObjectwith the given area and containing a linear gradient inside.- Parameters:
-
linearGradientBuilder- the linear gradient builder -
xObjectArea- the result object area -
document- the pdf document - Returns:
- the xObject with a specified area and a linear gradient
-
getBackgroundArea
Evaluate the actual background- Parameters:
-
occupiedAreaWithMargins- the current occupied area with applied margins - Returns:
- the actual background area
-
clipBorderArea
-
clipBackgroundArea
-
clipBackgroundArea
protected boolean clipBackgroundArea(DrawContext drawContext, Rectangle outerBorderBox, boolean considerBordersBeforeClipping) -
drawChildren
Performs the drawing operation for allchildrenof this renderer.- Parameters:
-
drawContext- the context (canvas, document, etc) of this drawing operation.
-
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.- Parameters:
-
drawContext- the context (canvas, document, etc.) of this drawing operation
-
isFlushed
public boolean isFlushed()Indicates whether this renderer is flushed or not, i.e. ifdraw(DrawContext)has already been called. -
setParent
Explicitly sets this object as the child of anotherIRendererin the renderer hierarchy. Some implementations also use this method internally to create a consistent hierarchy tree. -
getParent
Gets the parentIRenderer. -
move
public void move(float dxRight, float dyUp) Moves the renderer subtree by the specified offset. This method affects occupied area of the renderer. -
initElementAreas
Gets all rectangles that thisIRenderercan draw upon in the given area.- Parameters:
-
area- a physical area on theDrawContext - Returns:
-
a list of
rectangles
-
getOccupiedAreaBBox
Gets the bounding box that contains all content written to theDrawContextby thisIRenderer.- Returns:
-
the smallest
Rectanglethat surrounds the content
-
getBorderAreaBBox
Gets the border box of a renderer. This is a box used to draw borders.- Returns:
- border box of a renderer
-
getInnerAreaBBox
-
applyMargins
Applies margins of the renderer on the given rectangle- Parameters:
-
rect- a rectangle margins will be applied on. -
reverse- indicates whether margins will be applied inside (in case of false) or outside (in case of true) the rectangle. - Returns:
-
a
border boxof the renderer - See Also:
-
applyBorderBox
Applies the border box of the renderer on the given rectangle If the border of a certain side is null, the side will remain as it was.- Parameters:
-
rect- a rectangle the border box will be applied on. -
reverse- indicates whether the border box will be applied inside (in case of false) or outside (in case of true) the rectangle. - Returns:
-
a
border boxof the renderer - See Also:
-
applyPaddings
Applies paddings of the renderer on the given rectangle- Parameters:
-
rect- a rectangle paddings will be applied on. -
reverse- indicates whether paddings will be applied inside (in case of false) or outside (in case of true) the rectangle. - Returns:
-
a
border boxof the renderer - See Also:
-
isFirstOnRootArea
public boolean isFirstOnRootArea() -
applyDestinationsAndAnnotation
-
isBorderBoxSizing
-
isOverflowProperty
-
isOverflowProperty
protected static boolean isOverflowProperty(OverflowPropertyValue equalsTo, IRenderer renderer, int overflowProperty) -
isOverflowProperty
protected static boolean isOverflowProperty(OverflowPropertyValue equalsTo, OverflowPropertyValue rendererOverflowProperty) -
isOverflowFit
-
retrieveWidth
Retrieves element's fixed content box width, if it's set. Takes into accountProperty.BOX_SIZING,Property.MIN_WIDTH, andProperty.MAX_WIDTHproperties.- Parameters:
-
parentBoxWidth- width of the parent element content box. If element has relative width, it will be calculated relatively to this parameter. - Returns:
- element's fixed content box width or null if it's not set.
- See Also:
-
retrieveMaxWidth
Retrieves element's fixed content box max width, if it's set. Takes into accountProperty.BOX_SIZINGandProperty.MIN_WIDTHproperties.- Parameters:
-
parentBoxWidth- width of the parent element content box. If element has relative width, it will be calculated relatively to this parameter. - Returns:
- element's fixed content box max width or null if it's not set.
- See Also:
-
retrieveMinWidth
Retrieves element's fixed content box max width, if it's set. Takes into accountProperty.BOX_SIZINGproperty value.- Parameters:
-
parentBoxWidth- width of the parent element content box. If element has relative width, it will be calculated relatively to this parameter. - Returns:
- element's fixed content box max width or null if it's not set.
- See Also:
-
updateWidth
Updates fixed content box width value for this renderer. Takes into accountProperty.BOX_SIZINGproperty value.- Parameters:
-
updatedWidthValue- element's new fixed content box width.
-
retrieveHeight
Retrieves the element's fixed content box height, if it's set. Takes into accountProperty.BOX_SIZING,Property.MIN_HEIGHT, andProperty.MAX_HEIGHTproperties.- Returns:
- element's fixed content box height or null if it's not set.
-
updateHeight
Updates fixed content box height value for this renderer. Takes into accountProperty.BOX_SIZINGproperty value.- Parameters:
-
updatedHeight- element's new fixed content box height, shall be not null.
-
retrieveMaxHeight
Retrieve element's content box max-ehight, if it's set. Takes into accountProperty.BOX_SIZINGproperty value.- Returns:
- element's content box max-height or null if it's not set.
-
updateMaxHeight
Updates content box max-height value for this renderer. Takes into accountProperty.BOX_SIZINGproperty value.- Parameters:
-
updatedMaxHeight- element's new content box max-height, shall be not null.
-
retrieveMinHeight
Retrieves element's content box min-height, if it's set. Takes into accountProperty.BOX_SIZINGproperty value.- Returns:
- element's content box min-height or null if it's not set.
-
updateMinHeight
Updates content box min-height value for this renderer. Takes into accountProperty.BOX_SIZINGproperty value.- Parameters:
-
updatedMinHeight- element's new content box min-height, shall be not null.
-
retrieveUnitValue
-
retrieveUnitValue
-
getOwnProperties
-
addAllProperties
-
getFirstYLineRecursively
Gets 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.- Returns:
- the first yline of the nested children, null if there is no text found
-
getLastYLineRecursively
-
allowLastYLineRecursiveExtraction
protected boolean allowLastYLineRecursiveExtraction() -
applyMargins
Applies given margins on the given rectangle- Parameters:
-
rect- a rectangle margins will be applied on. -
margins- the margins to be applied on the given rectangle -
reverse- indicates whether margins will be applied inside (in case of false) or outside (in case of true) the rectangle. - Returns:
-
a
border boxof the renderer
-
getMargins
Returns margins of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left- Returns:
-
a
float[]margins of the renderer
-
getPaddings
Returns paddings of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left- Returns:
-
a
float[]paddings of the renderer
-
applyPaddings
Applies given paddings to the given rectangle.- Parameters:
-
rect- a rectangle paddings will be applied on. -
paddings- the paddings to be applied on the given rectangle -
reverse- indicates whether paddings will be applied inside (in case of false) or outside (in case of true) the rectangle. - Returns:
-
a
border boxof the renderer
-
applyBorderBox
Applies the given border box (borders) on the given rectangle- Parameters:
-
rect- a rectangle paddings will be applied on. -
borders- thebordersto be applied on the given rectangle -
reverse- indicates whether the border box will be applied inside (in case of false) or outside (in case of false) the rectangle. - Returns:
-
a
border boxof the renderer
-
applyAbsolutePosition
-
applyRelativePositioningTranslation
protected void applyRelativePositioningTranslation(boolean reverse) -
applyDestination
-
applyAction
-
applyLinkAnnotation
-
retrieveResolvedDeclaredHeight
Retrieve the resolved height declaration. If it has a relative height declaration,retrieveHeight()is called.- 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
-
updateHeightsOnSplit
protected void updateHeightsOnSplit(boolean wasHeightClipped, AbstractRenderer splitRenderer, AbstractRenderer overflowRenderer) -
getMinMaxWidth
Calculates min and max width values for current renderer.- Returns:
-
instance of
MinMaxWidth
-
getMinMaxWidth
Calculates min and max width values for current renderer.- Parameters:
-
areaMaxWidth- max width of the area on which current renderer will be laid out - Returns:
-
instance of
MinMaxWidth
-
setMinMaxWidthBasedOnFixedWidth
-
isNotFittingHeight
-
isNotFittingWidth
-
isNotFittingLayoutArea
-
isPositioned
protected boolean isPositioned()Indicates whether the renderer's position is fixed or not.- Returns:
-
a
boolean
-
isFixedLayout
protected boolean isFixedLayout()Indicates whether the renderer's position is fixed or not.- Returns:
-
a
boolean
-
isStaticLayout
protected boolean isStaticLayout() -
isRelativePosition
protected boolean isRelativePosition() -
isAbsolutePosition
protected boolean isAbsolutePosition() -
isKeepTogether
protected boolean isKeepTogether() -
alignChildHorizontally
-
getBorders
Gets borders of the element in the specified order: top, right, bottom, left.- Returns:
-
an array of BorderDrawer objects. In case when certain border isn't set
Property.BORDERis used, and ifProperty.BORDERis also not set thennullis returned on position of this border
-
getBorderRadii
Gets border radii of the element in the specified order: top-left, top-right, bottom-right, bottom-left.- Returns:
-
an array of BorderRadius objects. In case when certain border radius isn't set
Property.BORDER_RADIUSis used, and ifProperty.BORDER_RADIUSis also not set thennullis returned on position of this border radius
-
setBorders
-
calculateAbsolutePdfBBox
Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, e.g. document page or form xObject. This is particularly useful for the cases when element is nested in the rotated element.- Returns:
-
a
Rectanglewhich is a bbox of the content not relative to the parent's layout area but rather to the some pdf entity coordinate system.
-
calculateBBox
Calculates bounding box around points.- Parameters:
-
points- list of the points calculated bbox will enclose. - Returns:
- array of float values which denote left, bottom, right, top lines of bbox in this specific order
-
rectangleToPointsList
-
transformPoints
-
calculateShiftToPositionBBoxOfPointsAt
protected float[] calculateShiftToPositionBBoxOfPointsAt(float left, float top, List<Point> points) This method calculates the shift needed to be applied to the points in order to position upper and left borders of their bounding box at the given lines.- Parameters:
-
left- x coordinate at which points bbox left border is to be aligned -
top- y coordinate at which points bbox upper border is to be aligned -
points- the points, which bbox will be aligned at the given position - Returns:
- array of two floats, where first element denotes x-coordinate shift and the second element denotes y-coordinate shift which are needed to align points bbox at the given lines.
-
hasAbsoluteUnitValue
protected boolean hasAbsoluteUnitValue(int property) Check if corresponding property has point value.- Parameters:
-
property-Property - Returns:
- false if property value either null, or percent, otherwise true.
-
hasRelativeUnitValue
protected boolean hasRelativeUnitValue(int property) Check if corresponding property has relative value.- Parameters:
-
property-Property - Returns:
- false if property value either null, or point, otherwise true.
-
beginTransformationIfApplied
-
endTransformationIfApplied
-