Class PagedBoxCollector


  • public class PagedBoxCollector
    extends Object
    • 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
    • Constructor Detail

      • PagedBoxCollector

        public 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 Detail

      • 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 in overflow:hiddenblocks.
        Parameters:
        c -
        layer -
        container -
      • collect

        public void collect​(CssContext c,
                            Layer layer,
                            Box container,
                            int pgStart,
                            int pgEnd,
                            int shadowPageNumber)
      • 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.
      • 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)
      • 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)