Top Description Fields Constructors Methods
com.openhtmltopdf.render

public Class LineBox

extends Box
implements InlinePaintable
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.layout.InlinePaintable
Imports
java.awt.Rectangle, .Shape, java.io.IOException, .Writer, java.util.ArrayList, .Collections, .List, com.openhtmltopdf.bidi.BidiSplitter, com.openhtmltopdf.css.constants.CSSName, .IdentValue, com.openhtmltopdf.css.parser.FSRGBColor, com.openhtmltopdf.css.style.CssContext, com.openhtmltopdf.extend.StructureType, com.openhtmltopdf.layout.BoxCollector, .InlineBoxing, .InlinePaintable, .Layer, .LayoutContext, .PaintingInfo, com.openhtmltopdf.util.XRRuntimeException

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.

Field Summary

Modifier and TypeField and Description
private int
private boolean
private boolean
private boolean
private int
private FloatDistances
private boolean
private JustificationInfo
private MarkerData
private List<Box>
private int
private int
private List<TextDecoration>
private byte
private static final float
private static final float
private List<BlockBox>
Inherited from com.openhtmltopdf.render.Box:
CHILDREN_FLUXDONEDUMP_LAYOUTDUMP_RENDERFLUXLINE_SEPARATORNOTHING

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addAllChildren(List<? super Box> list, Layer layer)

public void
public void
private void
private void
private void
public void
align(boolean dynamic, CssContext c)

public void
private void
public void
public void
private void
checkFootnoteReservedPage(LayoutContext c, PageBox pageBoxAfter, boolean runHooks)

Checks that the line box is not on a footnote reserved page and if so pushes it down to the first non-reserved page.

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.

public void
private CharCounts
public String
dump(LayoutContext c, String indent, int which)

Implements abstract com.openhtmltopdf.render.Box.dump.

public void
public Box
find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)

Overrides com.openhtmltopdf.render.Box.find.

public InlineText
public int
public int
public FloatDistances
public JustificationInfo
public Rectangle
public MarkerData
public int
public int
public List<Box>
public Rectangle
public int
public int
public BlockBox
getParent()

Overrides com.openhtmltopdf.render.Box.getParent.

Narrows the return type of LineBox to a BlockBox.

public List<BlockBox>
getReferencedFootnoteBodies()

Gets the list of footnote bodies which have calls in this line of text.

public List<TextDecoration>
public boolean
public boolean
public boolean
intersects(CssContext cssCtx, Shape clip)

Overrides com.openhtmltopdf.render.Box.intersects.

Note

This method does not consider any children of this box but does consider the transformation matrix of the containing layer.

private boolean
private boolean
public boolean
public boolean
isContainsContent()

Whether this line contains any actual text content.

public boolean
public boolean
public boolean
public boolean
public boolean
private boolean
public boolean
public boolean
isTerminalColumnBreak()

Overrides com.openhtmltopdf.render.Box.isTerminalColumnBreak.

Is this box unbreakable in regards to column break opportunities?

public void
private void
private boolean
public void
public void
public void
reset(LayoutContext c)

Overrides com.openhtmltopdf.render.Box.reset.

Responsible for resetting the state of the box before a repeat call to BlockBox#layout(LayoutContext) or other layout methods.

public void
setBaseline(int baseline)

public void
setContainsBlockLevelContent(boolean containsBlockLevelContent)

public void
setContainsContent(boolean containsContent)

See isContainsContent()

public void
setContainsDynamicFunction(boolean containsPageCounter)

public void
setContentStart(int contentOffset)

public void
setDirectionality(byte direction)

public void
setEndsOnNL(boolean endsOnNL)

public void
private void
public void
public void
setPaintingHeight(int paintingHeight)

public void
setPaintingTop(int paintingTop)

public void
public String
toString()

Overrides com.openhtmltopdf.render.Box.toString.

Returns a string representation of the object.

public void
Inherited from com.openhtmltopdf.render.Box:
addAllChildrenaddChildaddChildForLayoutancestorsancestorsWhilecalcChildPaintingInfocalcPaintingInfoconnectChildrenToCurrentLayercrossesPageBreakdetachdumpBoxesexportPageBoxTextfindAncestorfindColumnBreakOpportunitiesforcePageBreakAfterforcePageBreakBeforeforcePageBreakBeforegetAbsoluteClipBoxgetAbsXgetAbsYgetAccessibilityObjectgetBordergetBorderBoxgetBorderBoxHeightgetBorderBoxWidthgetBorderEdgegetBorderSidesgetBoxDimensionsgetChildgetChildCountgetChildIteratorgetChildIteratorOfTypegetChildrengetChildrenClipEdgegetClipBoxgetContainingBlockgetContainingBlockWidthgetContainingLayergetContentAreaEdgegetContentWidthgetDocumentParentgetEffBackgroundColorgetEffectiveWidthgetElementgetElementBoxesgetHeightgetIndexgetLayergetLeftMBPgetMargingetMarginBorderPaddinggetMarginEdgegetNextgetNextSiblinggetPaddinggetPaddingEdgegetPaddingWidthgetPaintingBorderEdgegetPaintingInfogetPaintingPaddingEdgegetParentClipBoxgetPreviousgetPreviousSiblinggetPseudoElementOrClassgetRelativeOffsetgetRightMBPgetStategetStylegetStyleMargingetStyleMargingetTxgetTygetWidthgetXgetYhasRootElementBackgroundinitContainingLayerisAnonymousisBodyisContainedInMarginBoxisFirstChildisInDocumentFlowisInitialContainingBlockisInlineBlockisMarginAreaRootisRootisStyledmoveIfGreaterpaintBackgroundpaintBorderpaintRootElementBackgroundpositionRelativeremoveAllChildrenremoveChildremoveChildresetChildrenresetChildrenresetTopMarginrootBoxsetAbsXsetAbsYsetAccessiblityObjectsetAnonymoussetBorderBoxHeightsetBorderBoxWidthsetBoxDimensionssetContainingBlocksetContainingLayersetContentWidthsetElementsetHeightsetIndexsetLayersetLeftMBPsetMarginBottomsetMarginLeftsetMarginRightsetMarginTopsetParentsetPseudoElementOrClasssetRelativeOffsetsetRightMBPsetStatesetStylesetTxsetTysetXsetYstateToString

Field Detail

_baselineback to summary
private int _baseline
_containsBlockLevelContentback to summary
private boolean _containsBlockLevelContent
_containsContentback to summary
private boolean _containsContent
_containsDynamicFunctionback to summary
private boolean _containsDynamicFunction
_contentStartback to summary
private int _contentStart
_floatDistancesback to summary
private FloatDistances _floatDistances
_isEndsOnNLback to summary
private boolean _isEndsOnNL
_justificationInfoback to summary
private JustificationInfo _justificationInfo
_markerDataback to summary
private MarkerData _markerData
_nonFlowContentback to summary
private List<Box> _nonFlowContent
_paintingHeightback to summary
private int _paintingHeight
_paintingTopback to summary
private int _paintingTop
_textDecorationsback to summary
private List<TextDecoration> _textDecorations
directionback to summary
private byte direction
JUSTIFY_NON_SPACE_SHAREback to summary
private static final float JUSTIFY_NON_SPACE_SHARE
JUSTIFY_SPACE_SHAREback to summary
private static final float JUSTIFY_SPACE_SHARE
referencedFootnoteBodiesback to summary
private List<BlockBox> referencedFootnoteBodies

Constructor Detail

LineBoxback to summary
public LineBox()

Method Detail

addAllChildrenback to summary
public void addAllChildren(List<? super Box> list, Layer layer)
addNonFlowContentback to summary
public void addNonFlowContent(BlockBox box)
addReferencedFootnoteBodyback to summary
public void addReferencedFootnoteBody(BlockBox footnoteBody)

See getReferencedFootnoteBodies()

adjustChildrenback to summary
private void adjustChildren(JustificationInfo info)
adjustChildrenRTLback to summary
private void adjustChildrenRTL(JustificationInfo info)
afterChangePageback to summary
private void afterChangePage(LayoutContext c)
alignback to summary
public void align(boolean dynamic, CssContext c)
analyzePageBreaksback to summary
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container)

Overrides com.openhtmltopdf.render.Box.analyzePageBreaks.

Annotations
@Override
beforeChangePageback to summary
private void beforeChangePage(LayoutContext c)
calcCanvasLocationback to summary
public void calcCanvasLocation()

Implements abstract com.openhtmltopdf.render.Box.calcCanvasLocation.

Annotations
@Override
calcChildLocationsback to summary
public void calcChildLocations()

Overrides com.openhtmltopdf.render.Box.calcChildLocations.

Annotations
@Override
checkFootnoteReservedPageback to summary
private void checkFootnoteReservedPage(LayoutContext c, PageBox pageBoxAfter, boolean runHooks)

Checks that the line box is not on a footnote reserved page and if so pushes it down to the first non-reserved page.

checkPagePositionback to summary
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.

collectTextback to summary
public void collectText(RenderingContext c, StringBuilder buffer)

Overrides com.openhtmltopdf.render.Box.collectText.

Annotations
@Override
countJustifiableCharsback to summary
private CharCounts countJustifiableChars()
dumpback to summary
public String dump(LayoutContext c, String indent, int which)

Implements abstract com.openhtmltopdf.render.Box.dump.

Annotations
@Override
exportTextback to summary
public void exportText(RenderingContext c, Writer writer) throws IOException

Overrides com.openhtmltopdf.render.Box.exportText.

Annotations
@Override
findback to summary
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)

Overrides com.openhtmltopdf.render.Box.find.

Annotations
@Override
findTrailingTextback to summary
public InlineText findTrailingText()
getBaselineback to summary
public int getBaseline()
getContentStartback to summary
public int getContentStart()
getFloatDistancesback to summary
public FloatDistances getFloatDistances()
getJustificationInfoback to summary
public JustificationInfo getJustificationInfo()
getMarginEdgeback to summary
public Rectangle getMarginEdge(CssContext cssCtx, int tx, int ty)

Overrides com.openhtmltopdf.render.Box.getMarginEdge.

Annotations
@Override
getMarkerDataback to summary
public MarkerData getMarkerData()
getMaxPaintingBottomback to summary
public int getMaxPaintingBottom()
getMinPaintingTopback to summary
public int getMinPaintingTop()
getNonFlowContentback to summary
public List<Box> getNonFlowContent()
getPaintingClipEdgeback to summary
public Rectangle getPaintingClipEdge(CssContext cssCtx)

Overrides com.openhtmltopdf.render.Box.getPaintingClipEdge.

Annotations
@Override
getPaintingHeightback to summary
public int getPaintingHeight()
getPaintingTopback to summary
public int getPaintingTop()
getParentback to summary
public BlockBox getParent()

Overrides com.openhtmltopdf.render.Box.getParent.

Narrows the return type of LineBox to a BlockBox. Reduces the need to cast everywhere.

Annotations
@Override
getReferencedFootnoteBodiesback to summary
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.

getTextDecorationsback to summary
public List<TextDecoration> getTextDecorations()
hasFootnotesback to summary
public boolean hasFootnotes()

See getReferencedFootnoteBodies()

hasNonTextContentback to summary
public boolean hasNonTextContent(CssContext c)

Overrides com.openhtmltopdf.render.Box.hasNonTextContent.

Annotations
@Override
intersectsback to summary
public boolean intersects(CssContext cssCtx, Shape clip)

Overrides com.openhtmltopdf.render.Box.intersects.

Doc from com.openhtmltopdf.render.Box.intersects.

Note

This method does not consider any children of this box but does consider the transformation matrix of the containing layer.

Annotations
@Override
intersectsInlineBlocksback to summary
private boolean intersectsInlineBlocks(CssContext cssCtx, Shape clip)
intersectsLineback to summary
private boolean intersectsLine(CssContext cssCtx, Shape clip)
isContainsBlockLevelContentback to summary
public boolean isContainsBlockLevelContent()
isContainsContentback to summary
public boolean isContainsContent()

Whether this line contains any actual text content.

isContainsDynamicFunctionback to summary
public boolean isContainsDynamicFunction()
isContainsOnlyBlockLevelContentback to summary
public boolean isContainsOnlyBlockLevelContent()
isContainsVisibleContentback to summary
public boolean isContainsVisibleContent()
isEndsOnNLback to summary
public boolean isEndsOnNL()
isFirstLineback to summary
public boolean isFirstLine()
isLastLineWithContentback to summary
private boolean isLastLineWithContent()
isLayedOutRTLback to summary
public boolean isLayedOutRTL()
isTerminalColumnBreakback to summary
public boolean isTerminalColumnBreak()

Overrides com.openhtmltopdf.render.Box.isTerminalColumnBreak.

Doc from com.openhtmltopdf.render.Box.isTerminalColumnBreak.

Is this box unbreakable in regards to column break opportunities?

Annotations
@Override
justifyback to summary
public void justify(CssContext c)
lookForDynamicFunctionsback to summary
private void lookForDynamicFunctions(RenderingContext c)
overlapsFootnoteback to summary
private boolean overlapsFootnote(PageBox pageBox)
paintInlineback to summary
public void paintInline(RenderingContext c)

Implements com.openhtmltopdf.layout.InlinePaintable.paintInline.

Annotations
@Override
prunePendingInlineBoxesback to summary
public void prunePendingInlineBoxes(LayoutContext c)
resetback to summary
public void reset(LayoutContext c)

Overrides com.openhtmltopdf.render.Box.reset.

Doc from com.openhtmltopdf.render.Box.reset.

Responsible for resetting the state of the box before a repeat call to BlockBox#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.

Annotations
@Override
setBaselineback to summary
public void setBaseline(int baseline)
setContainsBlockLevelContentback to summary
public void setContainsBlockLevelContent(boolean containsBlockLevelContent)
setContainsContentback to summary
public void setContainsContent(boolean containsContent)

See isContainsContent()

setContainsDynamicFunctionback to summary
public void setContainsDynamicFunction(boolean containsPageCounter)
setContentStartback to summary
public void setContentStart(int contentOffset)
setDirectionalityback to summary
public void setDirectionality(byte direction)
setEndsOnNLback to summary
public void setEndsOnNL(boolean endsOnNL)
setFloatDistancesback to summary
public void setFloatDistances(FloatDistances floatDistances)
setJustificationInfoback to summary
private void setJustificationInfo(JustificationInfo justificationInfo)
setMarkerDataback to summary
public void setMarkerData(MarkerData markerData)
setPaintingHeightback to summary
public void setPaintingHeight(int paintingHeight)
setPaintingTopback to summary
public void setPaintingTop(int paintingTop)
setTextDecorationsback to summary
public void setTextDecorations(List<TextDecoration> textDecorations)
toStringback to summary
public String toString()

Overrides com.openhtmltopdf.render.Box.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
trimTrailingSpaceback to summary
public void trimTrailingSpace(LayoutContext c)