Package com.openhtmltopdf.render
Class InlineLayoutBox
java.lang.Object
com.openhtmltopdf.render.Box
com.openhtmltopdf.render.InlineLayoutBox
- All Implemented Interfaces:
InlinePaintable
,Styleable
,DisplayListItem
A
Box
which contains the portion of an inline element layed out on a
single line. It may contain content from several InlineBox
objects
if the original inline element was interrupted by nested content.
Unlike other boxes, its children may be either Box
objects
(for example, a box with display: inline-block
) or
InlineText
objects. For this reason, it's children are not
stored in the children
property, but instead stored in the
inlineChildren
property.-
Nested Class Summary
Nested classes/interfaces inherited from class com.openhtmltopdf.render.Box
Box.ChildIteratorOfType<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private boolean
private int
private boolean
private boolean
private List
<TextDecoration> Fields inherited from class com.openhtmltopdf.render.Box
CHILDREN_FLUX, DONE, DUMP_LAYOUT, DUMP_RENDER, FLUX, LINE_SEPARATOR, NOTHING
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
InlineLayoutBox
(LayoutContext c, Element elem, CalculatedStyle style, int cbWidth) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllChildren
(List<? super Box> list, Layer layer) private AnonymousBlockBox
addFollowingBlockBoxes
(BlockBox container, List<Box> result) void
addInlineChild
(LayoutContext c, Object child) void
addInlineChild
(LayoutContext c, Object child, boolean callUnmarkPending) private void
addToContentList
(List<Box> list) float
adjustHorizontalPosition
(JustificationInfo info, float adjust) float
adjustHorizontalPositionRTL
(JustificationInfo info, float adjust) void
void
protected void
calcChildPaintingInfo
(CssContext c, PaintingInfo result, boolean useCache) void
void
void
collectText
(RenderingContext c, StringBuilder buffer) void
private boolean
containsEnd
(List<Box> result) copyOf()
void
countJustifiableChars
(CharCounts counts) dump
(LayoutContext c, String indent, int which) find
(CssContext cssCtx, int absX, int absY, boolean findAnonymous) int
getBorderEdge
(int left, int top, CssContext cssCtx) int
int
getContentAreaEdge
(int left, int top, CssContext cssCtx) int
getElementBoxes
(Element elem) getInlineChild
(int i) int
EitherBox, including InlineLayoutBox
orInlineText
objects.int
int
getInlineWidth
(CssContext cssCtx) int
getLeftMarginBorderPadding
(CssContext cssCtx) getMarginEdge
(int left, int top, CssContext cssCtx, int tx, int ty) protected Box
protected Box
getPrevious
(Box child) int
boolean
boolean
intersectsInlineBlocks
(CssContext cssCtx, Shape clip) boolean
boolean
private boolean
isEndingBox
(Box b) boolean
boolean
boolean
void
void
void
void
positionRelative
(CssContext cssCtx) void
boolean
removeChild
(int i) Removes child by index and adjusts the index of subsequent children.boolean
removeChild
(Box child) Removes a child box if it is indeed a child and adjusts the index of subsequent children.protected void
void
setBaseline
(int baseline) void
setContainingBlockWidth
(int containingBlockWidth) void
setEndsHere
(boolean endsHere) void
setInlineWidth
(int inlineWidth) void
setPending
(boolean b) void
setStartsHere
(boolean startsHere) void
setTextDecorations
(List<TextDecoration> textDecoration) toString()
void
Methods inherited from class com.openhtmltopdf.render.Box
addAllChildren, addChild, addChildForLayout, analyzePageBreaks, ancestors, ancestorsWhile, calcPaintingInfo, crossesPageBreak, detach, dumpBoxes, exportPageBoxText, exportText, findAncestor, findColumnBreakOpportunities, forcePageBreakAfter, forcePageBreakBefore, forcePageBreakBefore, getAbsoluteClipBox, getAbsX, getAbsY, getAccessibilityObject, getBorder, getBorderBox, getBorderBoxHeight, getBorderBoxWidth, getBoxDimensions, getChild, getChildCount, getChildIterator, getChildIteratorOfType, getChildren, getChildrenClipEdge, getClipBox, getContainingBlock, getContainingLayer, getContentWidth, getDocumentParent, getEffBackgroundColor, getElement, getHeight, getIndex, getLayer, getLeftMBP, getMargin, getMarginBorderPadding, getMarginEdge, getNextSibling, getPadding, getPaddingEdge, getPaddingWidth, getPaintingBorderEdge, getPaintingClipEdge, getPaintingInfo, getPaintingPaddingEdge, getParent, getParentClipBox, getPreviousSibling, getPseudoElementOrClass, getRelativeOffset, getRightMBP, getState, getStyle, getStyleMargin, getStyleMargin, getTx, getTy, getWidth, getX, getY, hasRootElementBackground, initContainingLayer, intersects, isAnonymous, isBody, isContainedInMarginBox, isFirstChild, isInDocumentFlow, isInitialContainingBlock, isInlineBlock, isMarginAreaRoot, isRoot, isStyled, isTerminalColumnBreak, moveIfGreater, paintBackground, paintBorder, paintRootElementBackground, removeAllChildren, reset, 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
-
Field Details
-
_baseline
private int _baseline -
_startsHere
private boolean _startsHere -
_endsHere
private boolean _endsHere -
_inlineChildren
-
_pending
private boolean _pending -
_inlineWidth
private int _inlineWidth -
_textDecorations
-
_containingBlockWidth
private int _containingBlockWidth
-
-
Constructor Details
-
InlineLayoutBox
-
InlineLayoutBox
private InlineLayoutBox()
-
-
Method Details
-
copyOf
-
calculateHeight
-
getBaseline
public int getBaseline() -
setBaseline
public void setBaseline(int baseline) -
getInlineChildCount
public int getInlineChildCount() -
addInlineChild
-
addInlineChild
-
getInlineChildren
EitherBox, including InlineLayoutBox
orInlineText
objects. -
getInlineChild
-
getInlineWidth
-
prunePending
-
isEndsHere
public boolean isEndsHere() -
setEndsHere
public void setEndsHere(boolean endsHere) -
isStartsHere
public boolean isStartsHere() -
setStartsHere
public void setStartsHere(boolean startsHere) -
isPending
public boolean isPending() -
setPending
public void setPending(boolean b) -
unmarkPending
-
connectChildrenToCurrentLayer
- Overrides:
connectChildrenToCurrentLayer
in classBox
-
paintSelection
-
paintInline
- Specified by:
paintInline
in interfaceInlinePaintable
-
hasNonTextContent
- Overrides:
hasNonTextContent
in classBox
-
isAllTextItems
-
getBorderSides
public int getBorderSides()- Overrides:
getBorderSides
in classBox
-
getBorderEdge
- Overrides:
getBorderEdge
in classBox
-
getMarginEdge
- Overrides:
getMarginEdge
in classBox
-
getContentAreaEdge
- Overrides:
getContentAreaEdge
in classBox
-
getLeftMarginBorderPadding
-
getRightMarginPaddingBorder
-
getInlineWidth
public int getInlineWidth() -
setInlineWidth
public void setInlineWidth(int inlineWidth) -
isContainsVisibleContent
public boolean isContainsVisibleContent() -
intersectsInlineBlocks
-
getTextDecorations
-
setTextDecorations
-
addToContentList
-
getLineBox
-
getElementWithContent
-
addFollowingBlockBoxes
-
isEndingBox
-
containsEnd
-
getElementBoxes
- Overrides:
getElementBoxes
in classBox
-
positionRelative
- Overrides:
positionRelative
in classBox
-
addAllChildren
-
paintDebugOutline
-
resetChildren
- Overrides:
resetChildren
in classBox
-
removeChild
Removes a child box if it is indeed a child and adjusts the index of subsequent children. Returns whether this was a child.- Overrides:
removeChild
in classBox
-
removeChild
public boolean removeChild(int i) Removes child by index and adjusts the index of subsequent children. Returns true if this box has children, throws if the index is out-of-bounds.
IMPORTANT: This method must be kept in sync withBox.removeChild(Box)
- Overrides:
removeChild
in classBox
-
getPrevious
- Overrides:
getPrevious
in classBox
-
getNext
-
calcCanvasLocation
public void calcCanvasLocation()- Specified by:
calcCanvasLocation
in classBox
-
calcChildLocations
public void calcChildLocations()- Overrides:
calcChildLocations
in classBox
-
calcChildPaintingInfo
- Overrides:
calcChildPaintingInfo
in classBox
-
lookForDynamicFunctions
-
findTrailingText
-
calculateTextDecoration
-
find
-
getContainingBlockWidth
public int getContainingBlockWidth()- Overrides:
getContainingBlockWidth
in classBox
-
setContainingBlockWidth
public void setContainingBlockWidth(int containingBlockWidth) -
toString
-
dump
-
collectText
- Overrides:
collectText
in classBox
-
countJustifiableChars
-
adjustHorizontalPosition
-
adjustHorizontalPositionRTL
-
getEffectiveWidth
public int getEffectiveWidth()- Overrides:
getEffectiveWidth
in classBox
-