Package com.openhtmltopdf.render
Class BlockBox
java.lang.Object
com.openhtmltopdf.render.Box
com.openhtmltopdf.render.BlockBox
- All Implemented Interfaces:
InlinePaintable,Styleable,DisplayListItem
- Direct Known Subclasses:
AnonymousBlockBox,FlowingColumnBox,FlowingColumnContainerBox,MarginBox,TableBox,TableCellBox,TableRowBox,TableSectionBox,ViewportBox
public class BlockBox extends Box implements InlinePaintable
A block box as defined in the CSS spec. It also provides a base class for
other kinds of block content (for example table rows or cells).
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBlockBox.MarginCollapseResultNested classes/interfaces inherited from class com.openhtmltopdf.render.Box
Box.ChildIteratorOfType<T> -
Field Summary
Fields Modifier and Type Field Description static intCONTENT_BLOCKstatic intCONTENT_EMPTYstatic intCONTENT_INLINEstatic intCONTENT_UNKNOWNprotected static intNO_BASELINEstatic intPOSITION_BOTHstatic intPOSITION_HORIZONTALLYstatic intPOSITION_VERTICALLYFields inherited from class com.openhtmltopdf.render.Box
CHILDREN_FLUX, DONE, DUMP_LAYOUT, DUMP_RENDER, FLUX, LINE_SEPARATOR, NOTHING -
Constructor Summary
Constructors Constructor Description BlockBox() -
Method Summary
Methods inherited from class com.openhtmltopdf.render.Box
addAllChildren, addChild, addChildForLayout, analyzePageBreaks, ancestors, ancestorsWhile, calcPaintingInfo, collectText, connectChildrenToCurrentLayer, crossesPageBreak, detach, dumpBoxes, exportPageBoxText, exportText, find, 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, getEffBackgroundColor, getEffectiveWidth, getElement, getElementBoxes, getHeight, getIndex, getLayer, getLeftMBP, getMargin, getMarginBorderPadding, getMarginEdge, getMarginEdge, getNext, getNextSibling, getPadding, getPaddingEdge, getPaddingWidth, getPaintingBorderEdge, getPaintingInfo, getPaintingPaddingEdge, getParent, getParentClipBox, getPrevious, getPreviousSibling, getPseudoElementOrClass, getRelativeOffset, getRestyleTarget, getRightMBP, getState, getStyle, getStyleMargin, getStyleMargin, getTx, getTy, getWidth, getX, getY, hasNonTextContent, hasRootElementBackground, initContainingLayer, intersects, isAnonymous, isBody, isContainedInMarginBox, isFirstChild, isInDocumentFlow, isInitialContainingBlock, isMarginAreaRoot, isRoot, isStyled, isTerminalColumnBreak, moveIfGreater, paintBackground, paintBorder, paintRootElementBackground, positionRelative, removeAllChildren, removeChild, removeChild, resetChildren, resetChildren, resetTopMargin, restyle, restyleChildren, rootBox, setAbsX, setAbsY, setAccessiblityObject, setAnonymous, setBorderBoxHeight, setBorderBoxWidth, setBoxDimensions, setContainingBlock, setContainingLayer, setContentWidth, setHeight, setIndex, setLayer, setLeftMBP, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setParent, setPseudoElementOrClass, setRelativeOffset, setRightMBP, setState, setStyle, setTx, setTy, setX, setY, stateToString
-
Field Details
-
POSITION_VERTICALLY
public static final int POSITION_VERTICALLY- See Also:
- Constant Field Values
-
POSITION_HORIZONTALLY
public static final int POSITION_HORIZONTALLY- See Also:
- Constant Field Values
-
POSITION_BOTH
public static final int POSITION_BOTH- See Also:
- Constant Field Values
-
CONTENT_UNKNOWN
public static final int CONTENT_UNKNOWN- See Also:
- Constant Field Values
-
CONTENT_INLINE
public static final int CONTENT_INLINE- See Also:
- Constant Field Values
-
CONTENT_BLOCK
public static final int CONTENT_BLOCK- See Also:
- Constant Field Values
-
CONTENT_EMPTY
public static final int CONTENT_EMPTY- See Also:
- Constant Field Values
-
NO_BASELINE
protected static final int NO_BASELINE- See Also:
- Constant Field Values
-
-
Constructor Details
-
BlockBox
public BlockBox()
-
-
Method Details
-
setElement
- Specified by:
setElementin interfaceStyleable- Overrides:
setElementin classBox
-
copyOf
-
getExtraBoxDescription
-
toString
-
appendPositioningInfo
-
dump
-
isListItem
public boolean isListItem() -
paintListMarker
-
getPaintingClipEdge
- Overrides:
getPaintingClipEdgein classBox
-
paintInline
- Specified by:
paintInlinein interfaceInlinePaintable
-
isInline
public boolean isInline() -
getLineBox
-
paintDebugOutline
-
getMarkerData
-
setMarkerData
-
createMarkerData
-
getListCounter
public int getListCounter() -
setListCounter
public void setListCounter(int listCounter) -
getPersistentBFC
-
setPersistentBFC
-
getStaticEquivalent
-
setStaticEquivalent
-
shouldBeReplaced
public boolean shouldBeReplaced() -
isReplaced
public boolean isReplaced() -
calcCanvasLocation
public void calcCanvasLocation()- Specified by:
calcCanvasLocationin classBox
-
calcInitialFloatedCanvasLocation
-
calcChildLocations
public void calcChildLocations()- Overrides:
calcChildLocationsin classBox
-
isNeedPageClear
public boolean isNeedPageClear() -
setNeedPageClear
public void setNeedPageClear(boolean needPageClear) -
positionAbsolute
-
isPageBreakNeededBecauseOfMinHeight
Using the css: -fs-page-break-min-height: 5cm; on a block element you can force a pagebreak before this block, if not enough space (e.g. 5cm in this case) is remaining on the current page for the block.- Returns:
- true if a pagebreak is needed before this block because there is not enough space left on the current page.
-
positionAbsoluteOnPage
-
getReplacedElement
-
setReplacedElement
-
reset
-
resolveAutoMargins
protected void resolveAutoMargins(LayoutContext c, int cssWidth, RectPropertySet padding, BorderPropertySet border) -
calcDimensions
-
calcDimensions
-
addBoxID
-
layout
-
layout
-
isAllowHeightToShrink
protected boolean isAllowHeightToShrink() -
getPageClearance
protected int getPageClearance() -
calcLayoutHeight
protected void calcLayoutHeight(LayoutContext c, BorderPropertySet border, RectPropertySet margin, RectPropertySet padding)Oh oh! Up to this method height is used to track content height. After this method it is used to track total layout height! -
ensureChildren
-
layoutChildren
-
layoutInlineChildren
protected void layoutInlineChildren(LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain) -
getChildrenContentType
public int getChildrenContentType() -
setChildrenContentType
public void setChildrenContentType(int contentType) -
getInlineContent
-
setInlineContent
-
isSkipWhenCollapsingMargins
protected boolean isSkipWhenCollapsingMargins() -
isMayCollapseMarginsWithChildren
protected boolean isMayCollapseMarginsWithChildren() -
collapseMargins
-
getNextCollapsableSibling
-
isTopMarginCalculated
public boolean isTopMarginCalculated() -
setTopMarginCalculated
public void setTopMarginCalculated(boolean topMarginCalculated) -
isBottomMarginCalculated
public boolean isBottomMarginCalculated() -
setBottomMarginCalculated
public void setBottomMarginCalculated(boolean bottomMarginCalculated) -
getCSSWidth
-
getCSSWidth
-
getCSSFitToWidth
-
getCSSHeight
-
isAutoHeight
public boolean isAutoHeight() -
getAvailableWidth
-
isFixedWidthAdvisoryOnly
protected boolean isFixedWidthAdvisoryOnly() -
calcMinMaxWidth
-
getMaxWidth
public int getMaxWidth() -
setMaxWidth
protected void setMaxWidth(int maxWidth) -
getMinWidth
public int getMinWidth() -
setMinWidth
protected void setMinWidth(int minWidth) -
styleText
-
styleText
-
calcChildPaintingInfo
- Overrides:
calcChildPaintingInfoin classBox
-
getFirstLetterStyle
-
setFirstLetterStyle
-
getFirstLineStyle
-
setFirstLineStyle
-
isMinMaxCalculated
protected boolean isMinMaxCalculated() -
setMinMaxCalculated
protected void setMinMaxCalculated(boolean minMaxCalculated) -
setDimensionsCalculated
protected void setDimensionsCalculated(boolean dimensionsCalculated) -
setNeedShrinkToFitCalculatation
protected void setNeedShrinkToFitCalculatation(boolean needShrinkToFitCalculatation) -
initStaticPos
-
calcBaseline
-
calcInitialBreakAtLine
-
isCurrentBreakAtLineContext
-
calcBreakAtLineContext
-
calcInlineBaseline
-
findOffset
-
findLastNthLineBox
-
isNeedsKeepWithInline
-
isFloated
public boolean isFloated() -
getFloatedBoxData
-
setFloatedBoxData
-
getChildrenHeight
public int getChildrenHeight() -
setChildrenHeight
protected void setChildrenHeight(int childrenHeight) -
isFromCaptionedTable
public boolean isFromCaptionedTable() -
setFromCaptionedTable
public void setFromCaptionedTable(boolean fromTable) -
isInlineBlock
protected boolean isInlineBlock()- Overrides:
isInlineBlockin classBox
-
isInMainFlow
public boolean isInMainFlow() -
getDocumentParent
- Overrides:
getDocumentParentin classBox
-
isContainsInlineContent
-
checkPageContext
-
isNeedsClipOnPaint
-
propagateExtraSpace
protected void propagateExtraSpace(LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom)
-