Package com.openhtmltopdf.render
Class InlineLayoutBox
- java.lang.Object
-
- com.openhtmltopdf.render.Box
-
- com.openhtmltopdf.render.InlineLayoutBox
-
- All Implemented Interfaces:
InlinePaintable,Styleable,DisplayListItem
public class InlineLayoutBox extends Box implements InlinePaintable
ABoxwhich contains the portion of an inline element layed out on a single line. It may contain content from severalInlineBoxobjects if the original inline element was interrupted by nested content. Unlike other boxes, its children may be eitherBoxobjects (for example, a box withdisplay: inline-block) orInlineTextobjects. For this reason, it's children are not stored in thechildrenproperty, but instead stored in theinlineChildrenproperty.
-
-
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 InlineLayoutBox(LayoutContext c, Element elem, CalculatedStyle style, int cbWidth)
-
Method Summary
-
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
-
-
-
-
Constructor Detail
-
InlineLayoutBox
public InlineLayoutBox(LayoutContext c, Element elem, CalculatedStyle style, int cbWidth)
-
-
Method Detail
-
copyOf
public InlineLayoutBox copyOf()
-
calculateHeight
public void calculateHeight(LayoutContext c)
-
getBaseline
public int getBaseline()
-
setBaseline
public void setBaseline(int baseline)
-
getInlineChildCount
public int getInlineChildCount()
-
addInlineChild
public void addInlineChild(LayoutContext c, Object child)
-
addInlineChild
public void addInlineChild(LayoutContext c, Object child, boolean callUnmarkPending)
-
getInlineChildren
public List<Object> getInlineChildren()
EitherBox, including InlineLayoutBoxorInlineTextobjects.
-
getInlineChild
public Object getInlineChild(int i)
-
getInlineWidth
public int getInlineWidth(CssContext cssCtx)
-
prunePending
public void prunePending(LayoutContext c)
-
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
public void unmarkPending(LayoutContext c)
-
connectChildrenToCurrentLayer
public void connectChildrenToCurrentLayer(LayoutContext c)
- Overrides:
connectChildrenToCurrentLayerin classBox
-
paintSelection
public void paintSelection(RenderingContext c)
-
paintInline
public void paintInline(RenderingContext c)
- Specified by:
paintInlinein interfaceInlinePaintable
-
hasNonTextContent
public boolean hasNonTextContent(CssContext c)
- Overrides:
hasNonTextContentin classBox
-
isAllTextItems
public boolean isAllTextItems(CssContext c)
-
getBorderSides
public int getBorderSides()
- Overrides:
getBorderSidesin classBox
-
getBorderEdge
public Rectangle getBorderEdge(int left, int top, CssContext cssCtx)
- Overrides:
getBorderEdgein classBox
-
getMarginEdge
public Rectangle getMarginEdge(int left, int top, CssContext cssCtx, int tx, int ty)
- Overrides:
getMarginEdgein classBox
-
getContentAreaEdge
public Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx)
- Overrides:
getContentAreaEdgein classBox
-
getLeftMarginBorderPadding
public int getLeftMarginBorderPadding(CssContext cssCtx)
-
getRightMarginPaddingBorder
public int getRightMarginPaddingBorder(CssContext cssCtx)
-
getInlineWidth
public int getInlineWidth()
-
setInlineWidth
public void setInlineWidth(int inlineWidth)
-
isContainsVisibleContent
public boolean isContainsVisibleContent()
-
intersectsInlineBlocks
public boolean intersectsInlineBlocks(CssContext cssCtx, Shape clip)
-
getTextDecorations
public List<TextDecoration> getTextDecorations()
-
setTextDecorations
public void setTextDecorations(List<TextDecoration> textDecoration)
-
getLineBox
public LineBox getLineBox()
-
getElementBoxes
public List<Box> getElementBoxes(Element elem)
- Overrides:
getElementBoxesin classBox
-
positionRelative
public Dimension positionRelative(CssContext cssCtx)
- Overrides:
positionRelativein classBox
-
paintDebugOutline
public void paintDebugOutline(RenderingContext c)
-
resetChildren
protected void resetChildren(LayoutContext c)
- Overrides:
resetChildrenin classBox
-
removeChild
public boolean removeChild(Box child)
Removes a child box if it is indeed a child and adjusts the index of subsequent children. Returns whether this was a child.- Overrides:
removeChildin 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:
removeChildin classBox
-
getPrevious
protected Box getPrevious(Box child)
- Overrides:
getPreviousin classBox
-
calcCanvasLocation
public void calcCanvasLocation()
- Specified by:
calcCanvasLocationin classBox
-
calcChildLocations
public void calcChildLocations()
- Overrides:
calcChildLocationsin classBox
-
calcChildPaintingInfo
protected void calcChildPaintingInfo(CssContext c, PaintingInfo result, boolean useCache)
- Overrides:
calcChildPaintingInfoin classBox
-
lookForDynamicFunctions
public void lookForDynamicFunctions(RenderingContext c)
-
findTrailingText
public InlineText findTrailingText()
-
calculateTextDecoration
public void calculateTextDecoration(LayoutContext c)
-
find
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)
-
getContainingBlockWidth
public int getContainingBlockWidth()
- Overrides:
getContainingBlockWidthin classBox
-
setContainingBlockWidth
public void setContainingBlockWidth(int containingBlockWidth)
-
dump
public String dump(LayoutContext c, String indent, int which)
-
collectText
public void collectText(RenderingContext c, StringBuilder buffer)
- Overrides:
collectTextin classBox
-
countJustifiableChars
public void countJustifiableChars(CharCounts counts)
-
adjustHorizontalPosition
public float adjustHorizontalPosition(JustificationInfo info, float adjust)
-
adjustHorizontalPositionRTL
public float adjustHorizontalPositionRTL(JustificationInfo info, float adjust)
-
getEffectiveWidth
public int getEffectiveWidth()
- Overrides:
getEffectiveWidthin classBox
-
-