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 Detail
-
PAGE_BASE_ONLY
public static final int PAGE_BASE_ONLY
Add collected items to base page only, ignoring inserted shadow pages.- See Also:
- Constant Field Values
-
PAGE_ALL
public static final int PAGE_ALL
Add collected boxes to all pages, including inserted shadow pages.- See Also:
- Constant Field Values
-
-
Method Detail
-
collect
public void collect(CssContext c, Layer layer)
-
collectFloats
public void collectFloats(CssContext c, Layer layer)
-
collect
public void collect(CssContext c, Layer layer, Box container, int shadowPageNumber)
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
public static int findPageForY(CssContext c, double y, List<PageBox> pages)
-
getShadowPageForBounds
public static int getShadowPageForBounds(CssContext c, Rectangle bounds, PageBox page)
-
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
public static Rectangle findAdjustedBoundsForContentBox(CssContext c, Box container)
Finds the document coordinates content box bounds of a box adjusted for transform and clipped according to overflow hidden.
-
findStartPage
protected int findStartPage(CssContext c, Rectangle bounds, AffineTransform transform)
-
findEndPage
protected int findEndPage(CssContext c, Rectangle bounds, AffineTransform transform)
-
findStartPage
protected int findStartPage(CssContext c, Box container, AffineTransform transform)
-
findEndPage
protected int findEndPage(CssContext c, Box container, AffineTransform transform)
-
getPageResult
protected PagedBoxCollector.PageResult getPageResult(int pageNo)
-
getMaxPageNumber
protected int getMaxPageNumber()
-
getMinPageNumber
protected int getMinPageNumber()
-
getValidMinPageNumber
protected int getValidMinPageNumber(int pageNo)
-
getValidMaxPageNumber
protected int getValidMaxPageNumber(int pageNo)
-
getPageBox
protected PageBox getPageBox(int pageNo)
-
findLayerRect
public static Rectangle findLayerRect(CssContext c, Layer layer)
-
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
public static int findStartPage(CssContext c, Box container, List<PageBox> pages)
- Returns:
- 0 based page number of start of container paint area (including overflow)
-
findEndPage
public static int findEndPage(CssContext c, Box container, List<PageBox> pages)
- Returns:
- 0 based page number of end of container paint area (including overflow)
-
-