Class PagedBoxCollector
java.lang.Object
com.openhtmltopdf.render.displaylist.PagedBoxCollector
public class PagedBoxCollector extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPagedBoxCollector.PageFinderstatic classPagedBoxCollector.PageInfostatic classPagedBoxCollector.PageResult -
Field Summary
Fields Modifier and Type Field Description static intPAGE_ALLAdd collected boxes to all pages, including inserted shadow pages.static intPAGE_BASE_ONLYAdd collected items to base page only, ignoring inserted shadow pages. -
Constructor Summary
Constructors Constructor Description PagedBoxCollector(List<PageBox> pages, int minPage, int maxPage)A more efficient paged box collector that can only find boxes on pages minPage to maxPage inclusive. -
Method Summary
Modifier and Type Method Description voidcollect(CssContext c, Layer layer)voidcollect(CssContext c, Layer layer, Box container, int shadowPageNumber)The main box collection method.voidcollect(CssContext c, Layer layer, Box container, int pgStart, int pgEnd, int shadowPageNumber)voidcollectFloats(CssContext c, Layer layer)static RectanglefindAdjustedBoundsForBorderBox(CssContext c, Box container, List<PageBox> pages)Finds the document coordinates border box bounds of a box adjusted for transform and clipped according to overflow hidden.static RectanglefindAdjustedBoundsForContentBox(CssContext c, Box container)Finds the document coordinates content box bounds of a box adjusted for transform and clipped according to overflow hidden.protected intfindEndPage(CssContext c, Box container, AffineTransform transform)static intfindEndPage(CssContext c, Box container, List<PageBox> pages)protected intfindEndPage(CssContext c, Rectangle bounds, AffineTransform transform)static List<PagedBoxCollector.PageInfo>findLayerPages(CssContext c, Layer layer, List<PageBox> pages)Returns the pages a layer appears on including inserted overflow pages.static RectanglefindLayerRect(CssContext c, Layer layer)static intfindPageForY(CssContext c, double y, List<PageBox> pages)protected intfindStartPage(CssContext c, Box container, AffineTransform transform)static intfindStartPage(CssContext c, Box container, List<PageBox> pages)protected intfindStartPage(CssContext c, Rectangle bounds, AffineTransform transform)protected intgetMaxPageNumber()protected intgetMinPageNumber()protected PageBoxgetPageBox(int pageNo)protected PagedBoxCollector.PageResultgetPageResult(int pageNo)static intgetShadowPageForBounds(CssContext c, Rectangle bounds, PageBox page)protected intgetValidMaxPageNumber(int pageNo)protected intgetValidMinPageNumber(int pageNo)
-
Field Details
-
PAGE_BASE_ONLY
public static final int PAGE_BASE_ONLYAdd collected items to base page only, ignoring inserted shadow pages.- See Also:
- Constant Field Values
-
PAGE_ALL
public static final int PAGE_ALLAdd collected boxes to all pages, including inserted shadow pages.- See Also:
- Constant Field Values
-
-
Constructor Details
-
PagedBoxCollector
A more efficient paged box collector that can only find boxes on pages minPage to maxPage inclusive.
-
-
Method Details
-
collect
-
collectFloats
-
collect
The main box collection method. This method works recursively to add all the boxes (inlines and blocks separately) owned by this layer to their respective flat page display lists. It also adds clip and setClip operations where needed to clip content inoverflow:hiddenblocks.- Parameters:
c-layer-container-
-
collect
public void collect(CssContext c, Layer layer, Box container, int pgStart, int pgEnd, int shadowPageNumber) -
findPageForY
-
getShadowPageForBounds
-
findAdjustedBoundsForBorderBox
public static Rectangle findAdjustedBoundsForBorderBox(CssContext c, Box container, List<PageBox> pages)Finds the document coordinates border box bounds of a box adjusted for transform and clipped according to overflow hidden. -
findAdjustedBoundsForContentBox
Finds the document coordinates content box bounds of a box adjusted for transform and clipped according to overflow hidden. -
findStartPage
-
findEndPage
-
findStartPage
-
findEndPage
-
getPageResult
-
getMaxPageNumber
protected int getMaxPageNumber() -
getMinPageNumber
protected int getMinPageNumber() -
getValidMinPageNumber
protected int getValidMinPageNumber(int pageNo) -
getValidMaxPageNumber
protected int getValidMaxPageNumber(int pageNo) -
getPageBox
-
findLayerRect
-
findLayerPages
public static List<PagedBoxCollector.PageInfo> findLayerPages(CssContext c, Layer layer, List<PageBox> pages)Returns the pages a layer appears on including inserted overflow pages. Takes into account any transform and overflow hidden clipping. -
findStartPage
- Returns:
- 0 based page number of start of container paint area (including overflow)
-
findEndPage
- Returns:
- 0 based page number of end of container paint area (including overflow)
-