Top Description Inners Fields Constructors Methods
com.openhtmltopdf.render

public Class BlockBox

extends Box
implements InlinePaintable
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.layout.InlinePaintable
Known Direct Subclasses
com.openhtmltopdf.render.FlowingColumnBox, com.openhtmltopdf.render.FlowingColumnContainerBox, com.openhtmltopdf.render.MarginBox, com.openhtmltopdf.render.ViewportBox, com.openhtmltopdf.newtable.TableBox, com.openhtmltopdf.newtable.TableCellBox, com.openhtmltopdf.newtable.TableRowBox, com.openhtmltopdf.newtable.TableSectionBox, com.openhtmltopdf.render.AnonymousBlockBox
Imports
java.awt.Point, .Rectangle, java.util.Iterator, .LinkedList, .List, org.w3c.dom.Element, com.openhtmltopdf.css.constants.CSSName, .IdentValue, com.openhtmltopdf.css.newmatch.CascadedStyle, com.openhtmltopdf.css.parser.FSRGBColor, com.openhtmltopdf.css.style.CalculatedStyle, .CssContext, .FSDerivedValue, com.openhtmltopdf.css.style.derived.BorderPropertySet, .LengthValue, .RectPropertySet, com.openhtmltopdf.extend.FSImage, .ReplacedElement, com.openhtmltopdf.layout.BlockBoxing, .BlockFormattingContext, .BoxBuilder, .BreakAtLineContext, .CounterFunction, .FloatManager, .InlineBoxing, .InlinePaintable, .LayoutContext, .PaintingInfo, .PersistentBFC, .Styleable, com.openhtmltopdf.newtable.TableRowBox, com.openhtmltopdf.util.ThreadCtx

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). See ContentType

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
BlockBox.ContentType

What type of direct child content this block box contains.

private static class
public static class

Field Summary

Modifier and TypeField and Description
private boolean
private BlockBox.ContentType
private int
private boolean
private CascadedStyle
private CascadedStyle
private FloatedBoxData
private boolean
private List<Styleable>
private boolean
private int
private MarkerData
private int
private boolean
private int
private boolean
private boolean
private BlockBox.MarginCollapseResult
private PersistentBFC
private ReplacedElement
private Box
private boolean
protected static final int
public static final int
public static final int
public static final int
Inherited from com.openhtmltopdf.render.Box:
CHILDREN_FLUXDONEDUMP_LAYOUTDUMP_RENDERFLUXLINE_SEPARATORNOTHING

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
private void
protected void
private void
private void
public int
public BreakAtLineContext
public void
public void
protected void
private void
public void
protected void
calcDimensions(LayoutContext c, int cssWidth)

private int
private void
protected int
public void
public int
protected void
private void
public void
private void
private void
private int
private int
private int
private void
public boolean
protected void
checkPopBfc(LayoutContext c)

Checks if this box established a block formatting context and if so removes the last bfc from the stack.

protected void
checkPushBfc(LayoutContext c)

Checks if this box establishes a block formatting context and if so creates one and pushes it to the stack of bfcs.

protected boolean
private void
private void
protected void
private void
collapseTopMargin(LayoutContext c, boolean calculationRoot, BlockBox.MarginCollapseResult result)

public BlockBox
public void
private void
createReplaced(LayoutContext c)

Creates the replaced element as required.

public String
dump(LayoutContext c, String indent, int which)

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

public void
private LineBox
private void
private LineBox
public LineBox
findLastNthLineBox(int count)

public int
protected int
public BlockBox.ContentType
public int
private int
protected int
protected int
private int
private int
private int
private int
protected int
protected int
getCSSWidth(CssContext c, boolean shrinkingToFit)

public Box
protected String
public CascadedStyle
public CascadedStyle
public FloatedBoxData
public List<Styleable>
public LineBox
public int
public MarkerData
public int
public int
protected BlockBox
protected int
public Rectangle
public PersistentBFC
public ReplacedElement
public Box
public void
initStaticPos(LayoutContext c, BlockBox parent, int childOffset)

protected boolean
public boolean
public boolean
public boolean
public boolean
private boolean
protected boolean
public boolean
public boolean
public boolean
protected boolean
public boolean
public boolean
protected boolean
protected boolean
public boolean
public boolean
private boolean
public boolean
private boolean
private boolean
public boolean

Returns:

true if a pagebreak is needed before this block because there is not enough space left on the current page.
isPageBreakNeededBecauseOfMinHeight
(LayoutContext context)

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.

public boolean
protected boolean
public boolean
private boolean
private void
public void
public void
layout(LayoutContext c, int contentStart)

protected void
layoutChildren(LayoutContext c, int contentStart)

protected void
layoutInlineChildren(LayoutContext c, int contentStart, int breakAtLine, boolean tryAgain)

private MarkerData.GlyphMarker
private MarkerData.ImageMarker
private MarkerData.TextMarker
public void
public void
public void
public void
positionAbsolute(CssContext cssCtx, int direction)

public void
protected void
propagateExtraSpace(LayoutContext c, ContentLimitContainer parentContainer, ContentLimitContainer currentContainer, int extraTop, int extraBottom)

private 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.

protected void
private void
satisfyWidowsAndOrphans(LayoutContext c, int contentStart, boolean tryAgain)

TERMINOLOGY: Orphans refers to the number of lines of content in this box before the first page break.

public void
setBottomMarginCalculated(boolean bottomMarginCalculated)

public void
protected void
setChildrenHeight(int childrenHeight)

private void
protected void
setDimensionsCalculated(boolean dimensionsCalculated)

public void
public void
public void
public void
public void
setFromCaptionedTable(boolean fromTable)

public void
setInlineContent(List<Styleable> inlineContent)

Inline content is created by the box builder.

public void
setListCounter(int listCounter)

public void
protected void
setMaxWidth(int maxWidth)

protected void
setMinMaxCalculated(boolean minMaxCalculated)

protected void
setMinWidth(int minWidth)

public void
setNeedPageClear(boolean needPageClear)

protected void
setNeedShrinkToFitCalculatation(boolean needShrinkToFitCalculatation)

public void
public void
public void
setStaticEquivalent(Box staticEquivalent)

public void
setTopMarginCalculated(boolean topMarginCalculated)

public boolean
private void
sizeReplacedElement(LayoutContext c, ReplacedElement re)

Size a replaced element taking into account size properties including min/max, border-box/content-box and the natural size/aspect ratio of the replaced object.

public void
public void
public String
toString()

Overrides com.openhtmltopdf.render.Box.toString.

Returns a string representation of the object.

Inherited from com.openhtmltopdf.render.Box:
addAllChildrenaddChildaddChildForLayoutanalyzePageBreaksancestorsancestorsWhilecalcPaintingInfocollectTextconnectChildrenToCurrentLayercrossesPageBreakdetachdumpBoxesexportPageBoxTextexportTextfindfindAncestorfindColumnBreakOpportunitiesforcePageBreakAfterforcePageBreakBeforeforcePageBreakBeforegetAbsoluteClipBoxgetAbsXgetAbsYgetAccessibilityObjectgetBordergetBorderBoxgetBorderBoxHeightgetBorderBoxWidthgetBorderEdgegetBorderSidesgetBoxDimensionsgetChildgetChildCountgetChildIteratorgetChildIteratorOfTypegetChildrengetChildrenClipEdgegetClipBoxgetContainingBlockgetContainingBlockWidthgetContainingLayergetContentAreaEdgegetContentWidthgetEffBackgroundColorgetEffectiveWidthgetElementgetElementBoxesgetHeightgetIndexgetLayergetLeftMBPgetMargingetMarginBorderPaddinggetMarginEdgegetMarginEdgegetNextgetNextSiblinggetPaddinggetPaddingEdgegetPaddingWidthgetPaintingBorderEdgegetPaintingInfogetPaintingPaddingEdgegetParentgetParentClipBoxgetPreviousgetPreviousSiblinggetPseudoElementOrClassgetRelativeOffsetgetRightMBPgetStategetStylegetStyleMargingetStyleMargingetTxgetTygetWidthgetXgetYhasNonTextContenthasRootElementBackgroundinitContainingLayerintersectsisAnonymousisBodyisContainedInMarginBoxisFirstChildisInDocumentFlowisInitialContainingBlockisMarginAreaRootisRootisStyledisTerminalColumnBreakmoveIfGreaterpaintBackgroundpaintBorderpaintRootElementBackgroundpositionRelativeremoveAllChildrenremoveChildremoveChildresetChildrenresetChildrenresetTopMarginrootBoxsetAbsXsetAbsYsetAccessiblityObjectsetAnonymoussetBorderBoxHeightsetBorderBoxWidthsetBoxDimensionssetContainingBlocksetContainingLayersetContentWidthsetHeightsetIndexsetLayersetLeftMBPsetMarginBottomsetMarginLeftsetMarginRightsetMarginTopsetParentsetPseudoElementOrClasssetRelativeOffsetsetRightMBPsetStatesetStylesetTxsetTysetXsetYstateToString