Package com.openhtmltopdf.layout
Class BlockBoxing
- java.lang.Object
-
- com.openhtmltopdf.layout.BlockBoxing
-
public class BlockBoxing extends java.lang.Object
Utility class for laying block content. It is called when a block box contains block level content.BoxBuilder
will have made sure that the block we're working on will either contain only inline or block content. If we're in a paged media environment, the various page break related properties are also handled here. If a rule is violated, the affected run of boxes will be layed out again. If the rule still cannot be satisfied, the rule will be dropped.
IMPORTANT: This is quite hard to get right without causing an explosion of layouts caused by re-attempts to satisfy page-break-inside: avoid in deeply nested content. Please be careful when editing these functions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
BlockBoxing.AbstractRelayoutDataList
private static class
BlockBoxing.LiteRelayoutDataList
-
Field Summary
Fields Modifier and Type Field Description private static int
NO_PAGE_TRIM
-
Constructor Summary
Constructors Modifier Constructor Description private
BlockBoxing()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
avoidPageBreakBetween(BlockBox previous, BlockBox current)
If we should try to avoid a page break between two block boxes.private static LineBox
getFirstLine(Box box)
private static boolean
isPageBreakBetweenChildBoxes(BlockBoxing.AbstractRelayoutDataList relayoutDataList, int runStart, int runEnd, LayoutContext c, BlockBox block)
private static void
layoutBlockChild(LayoutContext c, BlockBox parent, BlockBox child, boolean needPageClear, int childOffset, int trimmedPageCount, LayoutState layoutState)
private static void
layoutBlockChild0(LayoutContext c, BlockBox parent, BlockBox child, boolean needPageClear, int childOffset, int trimmedPageCount)
static void
layoutContent(LayoutContext c, BlockBox block, int contentStart)
private static java.lang.Integer
processPageBreakAvoidRun(LayoutContext c, BlockBox block, java.util.List<Box> localChildren, int offset, BlockBoxing.AbstractRelayoutDataList relayoutDataList, BlockBox childBox)
private static int
relayoutRun(LayoutContext c, java.util.List<Box> localChildren, BlockBox block, BlockBoxing.AbstractRelayoutDataList relayoutDataList, int start, int end, boolean onNewPage)
private static void
repositionBox(LayoutContext c, BlockBox child, int trimmedPageCount)
-
-
-
Field Detail
-
NO_PAGE_TRIM
private static final int NO_PAGE_TRIM
- See Also:
- Constant Field Values
-
-
Method Detail
-
layoutContent
public static void layoutContent(LayoutContext c, BlockBox block, int contentStart)
-
processPageBreakAvoidRun
private static java.lang.Integer processPageBreakAvoidRun(LayoutContext c, BlockBox block, java.util.List<Box> localChildren, int offset, BlockBoxing.AbstractRelayoutDataList relayoutDataList, BlockBox childBox)
-
isPageBreakBetweenChildBoxes
private static boolean isPageBreakBetweenChildBoxes(BlockBoxing.AbstractRelayoutDataList relayoutDataList, int runStart, int runEnd, LayoutContext c, BlockBox block)
-
relayoutRun
private static int relayoutRun(LayoutContext c, java.util.List<Box> localChildren, BlockBox block, BlockBoxing.AbstractRelayoutDataList relayoutDataList, int start, int end, boolean onNewPage)
-
layoutBlockChild
private static void layoutBlockChild(LayoutContext c, BlockBox parent, BlockBox child, boolean needPageClear, int childOffset, int trimmedPageCount, LayoutState layoutState)
-
layoutBlockChild0
private static void layoutBlockChild0(LayoutContext c, BlockBox parent, BlockBox child, boolean needPageClear, int childOffset, int trimmedPageCount)
-
repositionBox
private static void repositionBox(LayoutContext c, BlockBox child, int trimmedPageCount)
-
-