Package com.openhtmltopdf.render
Class LineBox
- java.lang.Object
-
- com.openhtmltopdf.render.Box
-
- com.openhtmltopdf.render.LineBox
-
- All Implemented Interfaces:
InlinePaintable,Styleable,DisplayListItem
public class LineBox extends Box implements InlinePaintable
A line box contains a single line of text (or other inline content). It is created during layout. It also tracks floated and absolute content added while laying out the line.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openhtmltopdf.render.Box
Box.ChildIteratorOfType<T>
-
-
Field Summary
-
Fields inherited from class com.openhtmltopdf.render.Box
CHILDREN_FLUX, DONE, DUMP_LAYOUT, DUMP_RENDER, FLUX, LINE_SEPARATOR, NOTHING
-
-
Constructor Summary
Constructors Constructor Description LineBox()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllChildren(List<? super Box> list, Layer layer)voidaddNonFlowContent(BlockBox box)voidaddReferencedFootnoteBody(BlockBox footnoteBody)voidalign(boolean dynamic, CssContext c)voidanalyzePageBreaks(LayoutContext c, ContentLimitContainer container)voidcalcCanvasLocation()voidcalcChildLocations()voidcheckPagePosition(LayoutContext c, boolean alwaysBreak)Checks if this line box crosses a page break and if so moves it to the next page.voidcollectText(RenderingContext c, StringBuilder buffer)Stringdump(LayoutContext c, String indent, int which)voidexportText(RenderingContext c, Writer writer)Boxfind(CssContext cssCtx, int absX, int absY, boolean findAnonymous)InlineTextfindTrailingText()intgetBaseline()intgetContentStart()FloatDistancesgetFloatDistances()JustificationInfogetJustificationInfo()RectanglegetMarginEdge(CssContext cssCtx, int tx, int ty)MarkerDatagetMarkerData()intgetMaxPaintingBottom()intgetMinPaintingTop()List<Box>getNonFlowContent()RectanglegetPaintingClipEdge(CssContext cssCtx)intgetPaintingHeight()intgetPaintingTop()BlockBoxgetParent()Narrows the return type of LineBox to a BlockBox.List<BlockBox>getReferencedFootnoteBodies()Gets the list of footnote bodies which have calls in this line of text.List<TextDecoration>getTextDecorations()booleanhasFootnotes()booleanhasNonTextContent(CssContext c)booleanintersects(CssContext cssCtx, Shape clip)NOTE: This method does not consider any children of this box but does consider the transformation matrix of the containing layer.booleanisContainsBlockLevelContent()booleanisContainsContent()Whether this line contains any actual text content.booleanisContainsDynamicFunction()booleanisContainsOnlyBlockLevelContent()booleanisContainsVisibleContent()booleanisEndsOnNL()booleanisFirstLine()booleanisLayedOutRTL()booleanisTerminalColumnBreak()Is this box unbreakable in regards to column break opportunities?voidjustify(CssContext c)voidpaintInline(RenderingContext c)voidprunePendingInlineBoxes(LayoutContext c)voidreset(LayoutContext c)Responsible for resetting the state of the box before a repeat call toBlockBox.layout(LayoutContext)or other layout methods.voidsetBaseline(int baseline)voidsetContainsBlockLevelContent(boolean containsBlockLevelContent)voidsetContainsContent(boolean containsContent)voidsetContainsDynamicFunction(boolean containsPageCounter)voidsetContentStart(int contentOffset)voidsetDirectionality(byte direction)voidsetEndsOnNL(boolean endsOnNL)voidsetFloatDistances(FloatDistances floatDistances)voidsetMarkerData(MarkerData markerData)voidsetPaintingHeight(int paintingHeight)voidsetPaintingTop(int paintingTop)voidsetTextDecorations(List<TextDecoration> textDecorations)StringtoString()voidtrimTrailingSpace(LayoutContext c)-
Methods inherited from class com.openhtmltopdf.render.Box
addAllChildren, addChild, addChildForLayout, ancestors, ancestorsWhile, calcChildPaintingInfo, calcPaintingInfo, connectChildrenToCurrentLayer, crossesPageBreak, detach, dumpBoxes, exportPageBoxText, findAncestor, findColumnBreakOpportunities, forcePageBreakAfter, forcePageBreakBefore, forcePageBreakBefore, getAbsoluteClipBox, getAbsX, getAbsY, getAccessibilityObject, getBorder, getBorderBox, getBorderBoxHeight, getBorderBoxWidth, getBorderEdge, getBorderSides, getBoxDimensions, getChild, getChildCount, getChildIterator, getChildIteratorOfType, getChildren, getChildrenClipEdge, getClipBox, getContainingBlock, getContainingBlockWidth, getContainingLayer, getContentAreaEdge, getContentWidth, getDocumentParent, getEffBackgroundColor, getEffectiveWidth, getElement, getElementBoxes, getHeight, getIndex, getLayer, getLeftMBP, getMargin, getMarginBorderPadding, getMarginEdge, getNext, getNextSibling, getPadding, getPaddingEdge, getPaddingWidth, getPaintingBorderEdge, getPaintingInfo, getPaintingPaddingEdge, getParentClipBox, getPrevious, getPreviousSibling, getPseudoElementOrClass, getRelativeOffset, getRightMBP, getState, getStyle, getStyleMargin, getStyleMargin, getTx, getTy, getWidth, getX, getY, hasRootElementBackground, initContainingLayer, isAnonymous, isBody, isContainedInMarginBox, isFirstChild, isInDocumentFlow, isInitialContainingBlock, isInlineBlock, isMarginAreaRoot, isRoot, isStyled, moveIfGreater, paintBackground, paintBorder, paintRootElementBackground, positionRelative, removeAllChildren, removeChild, removeChild, resetChildren, resetChildren, resetTopMargin, rootBox, setAbsX, setAbsY, setAccessiblityObject, setAnonymous, setBorderBoxHeight, setBorderBoxWidth, setBoxDimensions, setContainingBlock, setContainingLayer, setContentWidth, setElement, setHeight, setIndex, setLayer, setLeftMBP, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setParent, setPseudoElementOrClass, setRelativeOffset, setRightMBP, setState, setStyle, setTx, setTy, setX, setY, stateToString
-
-
-
-
Method Detail
-
dump
public String dump(LayoutContext c, String indent, int which)
-
getMarginEdge
public Rectangle getMarginEdge(CssContext cssCtx, int tx, int ty)
- Overrides:
getMarginEdgein classBox
-
paintInline
public void paintInline(RenderingContext c)
- Specified by:
paintInlinein interfaceInlinePaintable
-
isFirstLine
public boolean isFirstLine()
-
prunePendingInlineBoxes
public void prunePendingInlineBoxes(LayoutContext c)
-
isContainsContent
public boolean isContainsContent()
Whether this line contains any actual text content.
-
setContainsContent
public void setContainsContent(boolean containsContent)
-
align
public void align(boolean dynamic, CssContext c)
-
justify
public void justify(CssContext c)
-
getFloatDistances
public FloatDistances getFloatDistances()
-
setFloatDistances
public void setFloatDistances(FloatDistances floatDistances)
-
isContainsBlockLevelContent
public boolean isContainsBlockLevelContent()
-
setContainsBlockLevelContent
public void setContainsBlockLevelContent(boolean containsBlockLevelContent)
-
intersects
public boolean intersects(CssContext cssCtx, Shape clip)
Description copied from class:BoxNOTE: This method does not consider any children of this box but does consider the transformation matrix of the containing layer.- Overrides:
intersectsin classBox
-
getPaintingClipEdge
public Rectangle getPaintingClipEdge(CssContext cssCtx)
- Overrides:
getPaintingClipEdgein classBox
-
getTextDecorations
public List<TextDecoration> getTextDecorations()
-
setTextDecorations
public void setTextDecorations(List<TextDecoration> textDecorations)
-
getPaintingHeight
public int getPaintingHeight()
-
setPaintingHeight
public void setPaintingHeight(int paintingHeight)
-
getPaintingTop
public int getPaintingTop()
-
setPaintingTop
public void setPaintingTop(int paintingTop)
-
getMinPaintingTop
public int getMinPaintingTop()
-
getMaxPaintingBottom
public int getMaxPaintingBottom()
-
addNonFlowContent
public void addNonFlowContent(BlockBox box)
-
reset
public void reset(LayoutContext c)
Description copied from class:BoxResponsible for resetting the state of the box before a repeat call toBlockBox.layout(LayoutContext)or other layout methods.
Any layout operation that is not idempotent MUST be reset in this method. Layout may be called several times on the one box.
-
calcCanvasLocation
public void calcCanvasLocation()
- Specified by:
calcCanvasLocationin classBox
-
calcChildLocations
public void calcChildLocations()
- Overrides:
calcChildLocationsin classBox
-
getMarkerData
public MarkerData getMarkerData()
-
setMarkerData
public void setMarkerData(MarkerData markerData)
-
isContainsDynamicFunction
public boolean isContainsDynamicFunction()
-
setContainsDynamicFunction
public void setContainsDynamicFunction(boolean containsPageCounter)
-
getContentStart
public int getContentStart()
-
setContentStart
public void setContentStart(int contentOffset)
-
findTrailingText
public InlineText findTrailingText()
-
trimTrailingSpace
public void trimTrailingSpace(LayoutContext c)
-
find
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)
-
getBaseline
public int getBaseline()
-
setBaseline
public void setBaseline(int baseline)
-
isContainsOnlyBlockLevelContent
public boolean isContainsOnlyBlockLevelContent()
-
isContainsVisibleContent
public boolean isContainsVisibleContent()
-
collectText
public void collectText(RenderingContext c, StringBuilder buffer)
- Overrides:
collectTextin classBox
-
exportText
public void exportText(RenderingContext c, Writer writer) throws IOException
- Overrides:
exportTextin classBox- Throws:
IOException
-
analyzePageBreaks
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container)
- Overrides:
analyzePageBreaksin classBox
-
checkPagePosition
public void checkPagePosition(LayoutContext c, boolean alwaysBreak)
Checks if this line box crosses a page break and if so moves it to the next page. Also takes care that in-flow lines do not overlap footnote content.
-
getJustificationInfo
public JustificationInfo getJustificationInfo()
-
setDirectionality
public void setDirectionality(byte direction)
-
isLayedOutRTL
public boolean isLayedOutRTL()
-
hasNonTextContent
public boolean hasNonTextContent(CssContext c)
- Overrides:
hasNonTextContentin classBox
-
isTerminalColumnBreak
public boolean isTerminalColumnBreak()
Description copied from class:BoxIs this box unbreakable in regards to column break opportunities?- Overrides:
isTerminalColumnBreakin classBox
-
isEndsOnNL
public boolean isEndsOnNL()
-
setEndsOnNL
public void setEndsOnNL(boolean endsOnNL)
-
getReferencedFootnoteBodies
public List<BlockBox> getReferencedFootnoteBodies()
Gets the list of footnote bodies which have calls in this line of text. Useful for moving those footnotes when this line is moved to a new page.
-
hasFootnotes
public boolean hasFootnotes()
-
addReferencedFootnoteBody
public void addReferencedFootnoteBody(BlockBox footnoteBody)
-
-