Package com.itextpdf.layout.renderer
Class LineRenderer
java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.LineRenderer
- All Implemented Interfaces:
-
IPropertyContainer
,IRenderer
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected byte[]
protected float
protected float
Fields inherited from class com.itextpdf.layout.renderer.AbstractRenderer
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected LineRenderer
protected void
applyLeading
(float deltaY) protected int
Returns the number of base characters, i.e.boolean
protected LineRenderer
protected LineRenderer
protected Float
Gets the first yLine of the nested children recursively.protected Float
float
getLeadingValue
(Leading leading) float
float
Calculates min and max width values for current renderer.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.protected int
float
getYLine()
void
justify
(float width) 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 int
length()
Gets the total lengths of characters in this line.protected LineRenderer[]
split()
toString()
Returns a string representation of the renderer.protected LineRenderer
trimLast()
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, drawBorder, drawChildren, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderAreaBBox, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getInnerAreaBBox, getMargins, 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, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidth
-
Field Details
-
maxAscent
protected float maxAscent -
maxDescent
protected float maxDescent -
levels
protected byte[] levels
-
-
Constructor Details
-
LineRenderer
public LineRenderer()
-
-
Method Details
-
layout
Description copied from interface:IRenderer
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.LayoutResult
can be extended to return custom layout results for custom elements, e.g.TextRenderer
usesTextLayoutResult
as 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
-
getMaxAscent
public float getMaxAscent() -
getMaxDescent
public float getMaxDescent() -
getYLine
public float getYLine() -
getLeadingValue
-
getNextRenderer
Description copied from interface:IRenderer
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
-
getFirstYLineRecursively
Description copied from class:AbstractRenderer
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.- Overrides:
-
getFirstYLineRecursively
in classAbstractRenderer
- Returns:
- the first yline of the nested children, null if there is no text found
-
getLastYLineRecursively
- Overrides:
-
getLastYLineRecursively
in classAbstractRenderer
-
justify
public void justify(float width) -
getNumberOfSpaces
protected int getNumberOfSpaces() -
length
protected int length()Gets the total lengths of characters in this line. Other elements (images, tables) are not taken into account.- Returns:
- the total lengths of characters in this line.
-
baseCharactersCount
protected int baseCharactersCount()Returns the number of base characters, i.e. non-mark characters- Returns:
- the number of base non-mark characters
-
toString
Description copied from class:AbstractRenderer
Returns a string representation of the renderer.- Overrides:
-
toString
in classAbstractRenderer
- Returns:
-
a
String
- See Also:
-
createSplitRenderer
-
createOverflowRenderer
-
split
-
adjustChildrenYLine
-
applyLeading
protected void applyLeading(float deltaY) -
trimLast
-
containsImage
public boolean containsImage() -
getMinMaxWidth
Description copied from class:AbstractRenderer
Calculates min and max width values for current renderer.- Overrides:
-
getMinMaxWidth
in classAbstractRenderer
- Returns:
-
instance of
MinMaxWidth
-