Package com.openhtmltopdf.render
Class Box
- java.lang.Object
-
- com.openhtmltopdf.render.Box
-
- All Implemented Interfaces:
Styleable,DisplayListItem
- Direct Known Subclasses:
BlockBox,InlineLayoutBox,LineBox
public abstract class Box extends java.lang.Object implements Styleable, DisplayListItem
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBox.ChildIteratorOfType<T>
-
Field Summary
Fields Modifier and Type Field Description private java.awt.geom.Area_absoluteClipBoxprivate int_absXprivate int_absYprivate java.lang.Object_accessibilityObjectprivate boolean_anonymousprivate java.util.List<Box>_boxesprivate boolean_clipBoxCalculatedprivate Box_containingBlockprivate Layer_containingLayerprivate int_contentWidthBox width.private org.w3c.dom.Element_elementprivate int_heightBox height.private int_indexprivate Layer_layerprivate int_leftMBPprivate PaintingInfo_paintingInfoprivate Box_parentprivate java.lang.String_pseudoElementOrClassprivate java.awt.Dimension_relativeOffsetprivate int_rightMBPprivate int_stateprivate CalculatedStyle_styleprivate int_txKeeps track of the start of childrens containing block.private int_typrivate RectPropertySet_workingMarginprivate int_xprivate int_ystatic intCHILDREN_FLUXstatic intDONEstatic intDUMP_LAYOUTstatic intDUMP_RENDERstatic intFLUXprotected static java.lang.StringLINE_SEPARATORstatic intNOTHING
-
Constructor Summary
Constructors Modifier Constructor Description protectedBox()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddAllChildren(java.util.List<Box> children)voidaddChild(Box child)voidaddChildForLayout(LayoutContext c, Box child)voidanalyzePageBreaks(LayoutContext c, ContentLimitContainer container)java.util.List<Box>ancestors()Get all ancestors, up until the root box.java.util.List<Box>ancestorsWhile(java.util.function.Predicate<Box> predicate)Creates a list of ancestors by walking up the chain of parent, grandparent, etc.private java.awt.geom.AreacalcAbsoluteClipBox(CssContext c)abstract voidcalcCanvasLocation()voidcalcChildLocations()protected voidcalcChildPaintingInfo(CssContext c, PaintingInfo result, boolean useCache)private java.awt.RectanglecalcClipBox(RenderingContext c, Layer layer)PaintingInfocalcPaintingInfo(CssContext c, boolean useCache)voidcollectText(RenderingContext c, java.lang.StringBuilder buffer)voidconnectChildrenToCurrentLayer(LayoutContext c)booleancrossesPageBreak(LayoutContext c)Whether this box would cross a page break.voiddetach(LayoutContext c)abstract java.lang.Stringdump(LayoutContext c, java.lang.String indent, int which)protected voiddumpBoxes(LayoutContext c, java.lang.String indent, java.util.List<Box> boxes, int which, java.lang.StringBuilder result)private voidensureWorkingMargin(CssContext cssContext)private voidexportPageBoxText(RenderingContext c, java.io.Writer writer)protected voidexportPageBoxText(RenderingContext c, java.io.Writer writer, int yPos)voidexportText(RenderingContext c, java.io.Writer writer)Boxfind(CssContext cssCtx, int absX, int absY, boolean findAnonymous)BoxfindAncestor(java.util.function.Predicate<Box> predicate)Walks up the ancestor tree to the root testing ancestors agains the predicate.voidfindColumnBreakOpportunities(FlowingColumnContainerBox.ColumnBreakStore store)Recursive method to find column break opportunities.voidforcePageBreakAfter(LayoutContext c, IdentValue pageBreakValue)Forces a page break after this box.intforcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName)intforcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName, int absY)java.awt.geom.AreagetAbsoluteClipBox(CssContext c)Returns the absolute (ie transformed if needed) clip area for this box.intgetAbsX()intgetAbsY()java.lang.ObjectgetAccessibilityObject()BorderPropertySetgetBorder(CssContext cssCtx)java.awt.RectanglegetBorderBox(CssContext c)Only to be called after layout, due to double use of getHeight().intgetBorderBoxHeight(CssContext c)intgetBorderBoxWidth(CssContext c)java.awt.RectanglegetBorderEdge(int left, int top, CssContext cssCtx)intgetBorderSides()BoxDimensionsgetBoxDimensions()BoxgetChild(int i)intgetChildCount()java.util.Iterator<Box>getChildIterator()<T> java.util.Iterator<T>getChildIteratorOfType(java.lang.Class<T> type)Returns an iterator of boxes cast to type.java.util.List<Box>getChildren()java.awt.RectanglegetChildrenClipEdge(CssContext c)java.awt.RectanglegetClipBox(RenderingContext c, Layer layer)Gets the combined clip of this box relative to the containing layer.private BoxgetClipParent()BoxgetContainingBlock()protected intgetContainingBlockWidth()LayergetContainingLayer()java.awt.RectanglegetContentAreaEdge(int left, int top, CssContext cssCtx)intgetContentWidth()BoxgetDocumentParent()FSColorgetEffBackgroundColor(RenderingContext c)intgetEffectiveWidth()org.w3c.dom.ElementgetElement()java.util.List<Box>getElementBoxes(org.w3c.dom.Element elem)intgetHeight()Uh oh! This refers to content height during layout but total height after layout!protected intgetIndex()The zero based index of this child amongst its fellow children of its parent.LayergetLayer()intgetLeftMBP()RectPropertySetgetMargin(CssContext cssContext)intgetMarginBorderPadding(CssContext cssCtx, int which)java.awt.RectanglegetMarginEdge(int left, int top, CssContext cssCtx, int tx, int ty)java.awt.RectanglegetMarginEdge(CssContext cssCtx, int tx, int ty)protected BoxgetNext(Box child)BoxgetNextSibling()RectPropertySetgetPadding(CssContext cssCtx)java.awt.RectanglegetPaddingEdge(int left, int top, CssContext cssCtx)protected intgetPaddingWidth(CssContext cssCtx)java.awt.RectanglegetPaintingBorderEdge(CssContext cssCtx)java.awt.RectanglegetPaintingClipEdge(CssContext cssCtx)PaintingInfogetPaintingInfo()java.awt.RectanglegetPaintingPaddingEdge(CssContext cssCtx)BoxgetParent()java.awt.RectanglegetParentClipBox(RenderingContext c, Layer layer)Gets the layer relative clip for the parent box.protected BoxgetPrevious(Box child)BoxgetPreviousSibling()java.lang.StringgetPseudoElementOrClass()java.awt.DimensiongetRelativeOffset()intgetRightMBP()intgetState()CalculatedStylegetStyle()protected RectPropertySetgetStyleMargin(CssContext cssContext)protected RectPropertySetgetStyleMargin(CssContext cssContext, boolean useCache)intgetTx()intgetTy()intgetWidth()intgetX()intgetY()booleanhasNonTextContent(CssContext c)booleanhasRootElementBackground(RenderingContext c)If the html or body box have a background return true.voidinitContainingLayer(LayoutContext c)booleanintersects(CssContext cssCtx, java.awt.Shape clip)NOTE: This method does not consider any children of this box but does consider the transformation matrix of the containing layer.booleanisAnonymous()booleanisBody()booleanisContainedInMarginBox()booleanisFirstChild()Is this box the first child of its parent?booleanisInDocumentFlow()protected booleanisInitialContainingBlock()protected booleanisInlineBlock()protected booleanisMarginAreaRoot()private booleanisPaintsRootElementBackground()booleanisRoot()booleanisStyled()booleanisTerminalColumnBreak()Is this box unbreakable in regards to column break opportunities?protected voidmoveIfGreater(java.awt.Dimension result, java.awt.Dimension test)voidpaintBackground(RenderingContext c)voidpaintBorder(RenderingContext c)voidpaintRootElementBackground(RenderingContext c)private voidpaintRootElementBackground(RenderingContext c, PaintingInfo pI)java.awt.DimensionpositionRelative(CssContext cssCtx)voidremoveAllChildren()booleanremoveChild(int index)Removes child by index and adjusts the index of subsequent children.booleanremoveChild(Box target)Removes a child box if it is indeed a child and adjusts the index of subsequent children.voidreset(LayoutContext c)Responsible for resetting the state of the box before a repeat call toBlockBox.layout(LayoutContext)or other layout methods.protected voidresetChildren(LayoutContext c)voidresetChildren(LayoutContext c, int start, int end)protected voidresetTopMargin(CssContext cssContext)BoxrootBox()Returns the highest ancestor box.voidsetAbsX(int absX)voidsetAbsY(int absY)voidsetAccessiblityObject(java.lang.Object object)voidsetAnonymous(boolean anonymous)protected voidsetBorderBoxHeight(CssContext c, int h)voidsetBorderBoxWidth(CssContext c, int borderBoxWidth)voidsetBoxDimensions(BoxDimensions dimensions)voidsetContainingBlock(Box containingBlock)voidsetContainingLayer(Layer containingLayer)voidsetContentWidth(int contentWidth)voidsetElement(org.w3c.dom.Element element)voidsetHeight(int height)Uh oh! This refers to content height during layout but total height after layout!protected voidsetIndex(int index)SeegetIndex()Must make sure this is correct when removing children/rearranging children.voidsetLayer(Layer layer)voidsetLeftMBP(int leftMBP)voidsetMarginBottom(CssContext cssContext, int marginBottom)voidsetMarginLeft(CssContext cssContext, int marginLeft)voidsetMarginRight(CssContext cssContext, int marginRight)voidsetMarginTop(CssContext cssContext, int marginTop)private voidsetPaintingInfo(PaintingInfo paintingInfo)voidsetParent(Box box)voidsetPseudoElementOrClass(java.lang.String pseudoElementOrClass)voidsetRelativeOffset(java.awt.Dimension relativeOffset)voidsetRightMBP(int rightMBP)voidsetState(int state)voidsetStyle(CalculatedStyle style)voidsetTx(int tx)voidsetTy(int ty)voidsetX(int x)voidsetY(int y)static java.lang.StringstateToString(int state)java.lang.StringtoString()
-
-
-
Field Detail
-
LINE_SEPARATOR
protected static final java.lang.String LINE_SEPARATOR
-
_element
private org.w3c.dom.Element _element
-
_x
private int _x
-
_y
private int _y
-
_absY
private int _absY
-
_absX
private int _absX
-
_contentWidth
private int _contentWidth
Box width.
-
_rightMBP
private int _rightMBP
-
_leftMBP
private int _leftMBP
-
_height
private int _height
Box height.
-
_layer
private Layer _layer
-
_containingLayer
private Layer _containingLayer
-
_parent
private Box _parent
-
_boxes
private java.util.List<Box> _boxes
-
_tx
private int _tx
Keeps track of the start of childrens containing block.
-
_ty
private int _ty
-
_style
private CalculatedStyle _style
-
_containingBlock
private Box _containingBlock
-
_relativeOffset
private java.awt.Dimension _relativeOffset
-
_paintingInfo
private PaintingInfo _paintingInfo
-
_workingMargin
private RectPropertySet _workingMargin
-
_index
private int _index
-
_pseudoElementOrClass
private java.lang.String _pseudoElementOrClass
-
_anonymous
private boolean _anonymous
-
_absoluteClipBox
private java.awt.geom.Area _absoluteClipBox
-
_clipBoxCalculated
private boolean _clipBoxCalculated
-
_accessibilityObject
private java.lang.Object _accessibilityObject
-
NOTHING
public static final int NOTHING
- See Also:
- Constant Field Values
-
FLUX
public static final int FLUX
- See Also:
- Constant Field Values
-
CHILDREN_FLUX
public static final int CHILDREN_FLUX
- See Also:
- Constant Field Values
-
DONE
public static final int DONE
- See Also:
- Constant Field Values
-
_state
private int _state
-
DUMP_RENDER
public static final int DUMP_RENDER
- See Also:
- Constant Field Values
-
DUMP_LAYOUT
public static final int DUMP_LAYOUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getClipBox
public java.awt.Rectangle getClipBox(RenderingContext c, Layer layer)
Gets the combined clip of this box relative to the containing layer. The returned clip is in document coordinate space (not transformed in any way). For example, if we have the following nesting: overflow hidden := transformed box := overflow hidden := overflow hidden := overflow visible this function called on the overflow visible box will return the combined clip of its two immediate ancestors in document coordinate space. It stops at the transformed box because the transform triggers a layer. Currently this method is used for getting the clip to apply to a float, which are nested in layers but taken out of the default block list and therefore clip stack. Since it is only used for floats, the result is not cached. Revisit this decision if using for every box. There are several other clip methods available: +getChildrenClipEdge(CssContext)- gets the local clip for a single box. +getParentClipBox(RenderingContext, Layer)- gets the layer relative clip for the parent box. +getAbsoluteClipBox(CssContext)- gets the absolute clip box in document coordinates
-
getClipParent
private Box getClipParent()
-
getParentClipBox
public java.awt.Rectangle getParentClipBox(RenderingContext c, Layer layer)
Gets the layer relative clip for the parent box. SeegetClipBox(RenderingContext, Layer)
-
calcClipBox
private java.awt.Rectangle calcClipBox(RenderingContext c, Layer layer)
-
getAbsoluteClipBox
public java.awt.geom.Area getAbsoluteClipBox(CssContext c)
Returns the absolute (ie transformed if needed) clip area for this box. Cached as this will be needed on every box to check if the clip area is inside a page.
-
calcAbsoluteClipBox
private java.awt.geom.Area calcAbsoluteClipBox(CssContext c)
-
dump
public abstract java.lang.String dump(LayoutContext c, java.lang.String indent, int which)
-
dumpBoxes
protected void dumpBoxes(LayoutContext c, java.lang.String indent, java.util.List<Box> boxes, int which, java.lang.StringBuilder result)
-
getWidth
public int getWidth()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
addChildForLayout
public void addChildForLayout(LayoutContext c, Box child)
-
addChild
public void addChild(Box child)
-
addAllChildren
public void addAllChildren(java.util.List<Box> children)
-
removeAllChildren
public void removeAllChildren()
-
removeChild
public boolean removeChild(Box target)
Removes a child box if it is indeed a child and adjusts the index of subsequent children. Returns whether this was a child.
-
getPreviousSibling
public Box getPreviousSibling()
-
getNextSibling
public Box getNextSibling()
-
removeChild
public boolean removeChild(int index)
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 withremoveChild(Box)
-
setParent
public void setParent(Box box)
-
getParent
public Box getParent()
-
getDocumentParent
public Box getDocumentParent()
-
getChildCount
public int getChildCount()
-
getChild
public Box getChild(int i)
-
getChildIterator
public java.util.Iterator<Box> getChildIterator()
-
getChildren
public java.util.List<Box> getChildren()
-
getChildIteratorOfType
public <T> java.util.Iterator<T> getChildIteratorOfType(java.lang.Class<T> type)
Returns an iterator of boxes cast to type. If a box is not of type, an error will be logged and null will be returned for that box. Therefore, this method should only be used when it is certain all children are of a particular type. Eg: TableBox has children only of type TableSectionBox.
-
getState
public int getState()
-
setState
public void setState(int state)
-
stateToString
public static java.lang.String stateToString(int state)
-
getStyle
public final CalculatedStyle getStyle()
-
setStyle
public void setStyle(CalculatedStyle style)
-
getContainingBlock
public Box getContainingBlock()
-
setContainingBlock
public void setContainingBlock(Box containingBlock)
-
getMarginEdge
public java.awt.Rectangle getMarginEdge(int left, int top, CssContext cssCtx, int tx, int ty)
-
getMarginEdge
public java.awt.Rectangle getMarginEdge(CssContext cssCtx, int tx, int ty)
-
getPaintingBorderEdge
public java.awt.Rectangle getPaintingBorderEdge(CssContext cssCtx)
-
getPaintingPaddingEdge
public java.awt.Rectangle getPaintingPaddingEdge(CssContext cssCtx)
-
getPaintingClipEdge
public java.awt.Rectangle getPaintingClipEdge(CssContext cssCtx)
-
getChildrenClipEdge
public java.awt.Rectangle getChildrenClipEdge(CssContext c)
-
intersects
public boolean intersects(CssContext cssCtx, java.awt.Shape clip)
NOTE: This method does not consider any children of this box but does consider the transformation matrix of the containing layer.
-
getBorderEdge
public java.awt.Rectangle getBorderEdge(int left, int top, CssContext cssCtx)
-
getPaddingEdge
public java.awt.Rectangle getPaddingEdge(int left, int top, CssContext cssCtx)
-
getPaddingWidth
protected int getPaddingWidth(CssContext cssCtx)
-
getContentAreaEdge
public java.awt.Rectangle getContentAreaEdge(int left, int top, CssContext cssCtx)
-
getLayer
public Layer getLayer()
-
setLayer
public void setLayer(Layer layer)
-
positionRelative
public java.awt.Dimension positionRelative(CssContext cssCtx)
-
isInlineBlock
protected boolean isInlineBlock()
-
setAbsY
public void setAbsY(int absY)
-
getAbsY
public int getAbsY()
-
setAbsX
public void setAbsX(int absX)
-
getAbsX
public int getAbsX()
-
isStyled
public boolean isStyled()
-
getBorderSides
public int getBorderSides()
-
paintBorder
public void paintBorder(RenderingContext c)
-
isPaintsRootElementBackground
private boolean isPaintsRootElementBackground()
-
paintBackground
public void paintBackground(RenderingContext c)
-
hasNonTextContent
public boolean hasNonTextContent(CssContext c)
-
setAccessiblityObject
public void setAccessiblityObject(java.lang.Object object)
-
getAccessibilityObject
public java.lang.Object getAccessibilityObject()
-
paintRootElementBackground
public void paintRootElementBackground(RenderingContext c)
-
paintRootElementBackground
private void paintRootElementBackground(RenderingContext c, PaintingInfo pI)
-
hasRootElementBackground
public boolean hasRootElementBackground(RenderingContext c)
If the html or body box have a background return true.
-
getContainingLayer
public Layer getContainingLayer()
-
setContainingLayer
public void setContainingLayer(Layer containingLayer)
-
initContainingLayer
public void initContainingLayer(LayoutContext c)
-
connectChildrenToCurrentLayer
public void connectChildrenToCurrentLayer(LayoutContext c)
-
getElementBoxes
public java.util.List<Box> getElementBoxes(org.w3c.dom.Element elem)
-
reset
public void reset(LayoutContext c)
Responsible 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.
-
detach
public void detach(LayoutContext c)
-
resetChildren
public void resetChildren(LayoutContext c, int start, int end)
-
resetChildren
protected void resetChildren(LayoutContext c)
-
calcCanvasLocation
public abstract void calcCanvasLocation()
-
calcChildLocations
public void calcChildLocations()
-
forcePageBreakBefore
public int forcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName)
-
forcePageBreakBefore
public int forcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName, int absY)
-
forcePageBreakAfter
public void forcePageBreakAfter(LayoutContext c, IdentValue pageBreakValue)
Forces a page break after this box.
-
crossesPageBreak
public boolean crossesPageBreak(LayoutContext c)
Whether this box would cross a page break.
SeeLayer.crossesPageBreak(LayoutContext, int, int)for extra info.
-
getRelativeOffset
public java.awt.Dimension getRelativeOffset()
-
setRelativeOffset
public void setRelativeOffset(java.awt.Dimension relativeOffset)
-
find
public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)
-
isRoot
public boolean isRoot()
-
isBody
public boolean isBody()
-
getElement
public org.w3c.dom.Element getElement()
- Specified by:
getElementin interfaceStyleable
-
setElement
public void setElement(org.w3c.dom.Element element)
- Specified by:
setElementin interfaceStyleable
-
setMarginTop
public void setMarginTop(CssContext cssContext, int marginTop)
-
setMarginBottom
public void setMarginBottom(CssContext cssContext, int marginBottom)
-
setMarginLeft
public void setMarginLeft(CssContext cssContext, int marginLeft)
-
setMarginRight
public void setMarginRight(CssContext cssContext, int marginRight)
-
ensureWorkingMargin
private void ensureWorkingMargin(CssContext cssContext)
-
getMargin
public RectPropertySet getMargin(CssContext cssContext)
-
getStyleMargin
protected RectPropertySet getStyleMargin(CssContext cssContext)
-
getStyleMargin
protected RectPropertySet getStyleMargin(CssContext cssContext, boolean useCache)
-
getPadding
public RectPropertySet getPadding(CssContext cssCtx)
-
getBorder
public BorderPropertySet getBorder(CssContext cssCtx)
-
getContainingBlockWidth
protected int getContainingBlockWidth()
-
resetTopMargin
protected void resetTopMargin(CssContext cssContext)
-
calcPaintingInfo
public PaintingInfo calcPaintingInfo(CssContext c, boolean useCache)
-
calcChildPaintingInfo
protected void calcChildPaintingInfo(CssContext c, PaintingInfo result, boolean useCache)
-
getMarginBorderPadding
public int getMarginBorderPadding(CssContext cssCtx, int which)
-
moveIfGreater
protected void moveIfGreater(java.awt.Dimension result, java.awt.Dimension test)
-
getIndex
protected int getIndex()
The zero based index of this child amongst its fellow children of its parent.
-
setIndex
protected void setIndex(int index)
SeegetIndex()Must make sure this is correct when removing children/rearranging children.
-
getPseudoElementOrClass
public java.lang.String getPseudoElementOrClass()
- Specified by:
getPseudoElementOrClassin interfaceStyleable
-
setPseudoElementOrClass
public void setPseudoElementOrClass(java.lang.String pseudoElementOrClass)
-
setX
public void setX(int x)
-
getX
public int getX()
-
setY
public void setY(int y)
-
getY
public int getY()
-
setTy
public void setTy(int ty)
-
getTy
public int getTy()
-
setTx
public void setTx(int tx)
-
getTx
public int getTx()
-
setRightMBP
public void setRightMBP(int rightMBP)
-
getRightMBP
public int getRightMBP()
-
setLeftMBP
public void setLeftMBP(int leftMBP)
-
getLeftMBP
public int getLeftMBP()
-
setHeight
public void setHeight(int height)
Uh oh! This refers to content height during layout but total height after layout!
-
getHeight
public int getHeight()
Uh oh! This refers to content height during layout but total height after layout!
-
setBorderBoxHeight
protected void setBorderBoxHeight(CssContext c, int h)
-
getBorderBoxHeight
public int getBorderBoxHeight(CssContext c)
-
getBorderBox
public java.awt.Rectangle getBorderBox(CssContext c)
Only to be called after layout, due to double use of getHeight().
-
setContentWidth
public void setContentWidth(int contentWidth)
-
getContentWidth
public int getContentWidth()
-
getBorderBoxWidth
public int getBorderBoxWidth(CssContext c)
-
setBorderBoxWidth
public void setBorderBoxWidth(CssContext c, int borderBoxWidth)
-
getPaintingInfo
public PaintingInfo getPaintingInfo()
-
setPaintingInfo
private void setPaintingInfo(PaintingInfo paintingInfo)
-
isAnonymous
public boolean isAnonymous()
-
setAnonymous
public void setAnonymous(boolean anonymous)
-
getBoxDimensions
public BoxDimensions getBoxDimensions()
-
setBoxDimensions
public void setBoxDimensions(BoxDimensions dimensions)
-
collectText
public void collectText(RenderingContext c, java.lang.StringBuilder buffer)
-
exportText
public void exportText(RenderingContext c, java.io.Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
exportPageBoxText
private void exportPageBoxText(RenderingContext c, java.io.Writer writer) throws java.io.IOException
- Throws:
java.io.IOException
-
exportPageBoxText
protected void exportPageBoxText(RenderingContext c, java.io.Writer writer, int yPos) throws java.io.IOException
- Throws:
java.io.IOException
-
isInDocumentFlow
public boolean isInDocumentFlow()
-
analyzePageBreaks
public void analyzePageBreaks(LayoutContext c, ContentLimitContainer container)
-
getEffBackgroundColor
public FSColor getEffBackgroundColor(RenderingContext c)
-
isMarginAreaRoot
protected boolean isMarginAreaRoot()
-
isContainedInMarginBox
public boolean isContainedInMarginBox()
-
getEffectiveWidth
public int getEffectiveWidth()
-
isInitialContainingBlock
protected boolean isInitialContainingBlock()
-
isFirstChild
public boolean isFirstChild()
Is this box the first child of its parent?
-
isTerminalColumnBreak
public boolean isTerminalColumnBreak()
Is this box unbreakable in regards to column break opportunities?
-
ancestorsWhile
public java.util.List<Box> ancestorsWhile(java.util.function.Predicate<Box> predicate)
Creates a list of ancestors by walking up the chain of parent, grandparent, etc. Stops when the provided predicate returns false or the root box otherwise.
-
ancestors
public java.util.List<Box> ancestors()
Get all ancestors, up until the root box.
-
findAncestor
public Box findAncestor(java.util.function.Predicate<Box> predicate)
Walks up the ancestor tree to the root testing ancestors agains the predicate. NOTE: Does not test against the current box (this).- Returns:
- the box for which predicate returned true or null if none found.
-
rootBox
public Box rootBox()
Returns the highest ancestor box. May be current box (this).
-
findColumnBreakOpportunities
public void findColumnBreakOpportunities(FlowingColumnContainerBox.ColumnBreakStore store)
Recursive method to find column break opportunities.- Parameters:
store- - use to report break opportunities.
-
-