Class Layer

java.lang.Object
org.xhtmlrenderer.layout.Layer

public final class Layer extends Object
All positioned content as well as content with an overflow value other than visible creates a layer. Layers which define stacking contexts provide the entry for rendering the box tree to an output device. The main purpose of this class is to provide an implementation of Appendix E of the spec, but it also provides additional utility services including page management and mapping boxes to coordinates (for e.g. links). When rendering to a paged output device, the layer is also responsible for laying out absolute content (which is laid out after its containing block has completed layout).
  • Field Details

    • PAGED_MODE_SCREEN

      public static final short PAGED_MODE_SCREEN
      See Also:
    • PAGED_MODE_PRINT

      public static final short PAGED_MODE_PRINT
      See Also:
    • _parent

      private final Layer _parent
    • _stackingContext

      private boolean _stackingContext
    • _children

      private List<Layer> _children
    • _master

      private final Box _master
    • _end

      private Box _end
    • _floats

      private List<BlockBox> _floats
    • _fixedBackground

      private boolean _fixedBackground
    • _inline

      private boolean _inline
    • _requiresLayout

      private boolean _requiresLayout
    • _pages

      private final List<PageBox> _pages
    • _lastRequestedPage

      private PageBox _lastRequestedPage
    • _pageSequences

      private Set<BlockBox> _pageSequences
    • _sortedPageSequences

      private List<BlockBox> _sortedPageSequences
    • _runningBlocks

      private Map<String,List<BlockBox>> _runningBlocks
    • POSITIVE

      private static final int POSITIVE
      See Also:
    • ZERO

      private static final int ZERO
      See Also:
    • NEGATIVE

      private static final int NEGATIVE
      See Also:
    • AUTO

      private static final int AUTO
      See Also:
  • Constructor Details

    • Layer

      public Layer(Box master)
    • Layer

      public Layer(Layer parent, Box master)
  • Method Details

    • getParent

      public Layer getParent()
    • isStackingContext

      public boolean isStackingContext()
    • setStackingContext

      private void setStackingContext(boolean stackingContext)
    • getZIndex

      public int getZIndex()
    • getMaster

      public Box getMaster()
    • addChild

      public void addChild(Layer layer)
    • addFloat

      public void addFloat(BlockBox floater, BlockFormattingContext bfc)
    • removeFloat

      public void removeFloat(BlockBox floater)
    • paintFloats

      private void paintFloats(RenderingContext c)
    • paintLayers

      private void paintLayers(RenderingContext c, List<Layer> layers)
    • collectLayers

      private List<Layer> collectLayers(int which)
    • getStackingContextLayers

      private List<Layer> getStackingContextLayers(int which)
    • getSortedLayers

      private List<Layer> getSortedLayers(int which)
    • paintBackgroundsAndBorders

      private void paintBackgroundsAndBorders(RenderingContext c, List<Box> blocks, Map<TableCellBox,List<CollapsedBorderSide>> collapsedTableBorders, BoxRangeLists rangeLists)
    • paintInlineContent

      private void paintInlineContent(RenderingContext c, List<Box> lines, BoxRangeLists rangeLists)
    • paintSelection

      private void paintSelection(RenderingContext c, List<Box> lines)
    • getPaintingDimension

      public Dimension getPaintingDimension(LayoutContext c)
    • paint

      public void paint(RenderingContext c)
    • getFloats

      private List<BlockBox> getFloats()
    • find

      public Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)
    • find

      private Box find(CssContext cssCtx, int absX, int absY, List<Layer> layers, boolean findAnonymous)
    • collectCollapsedTableBorders

      private Map<TableCellBox,List<CollapsedBorderSide>> collectCollapsedTableBorders(List<Box> blocks)
    • paintCollapsedTableBorders

      private void paintCollapsedTableBorders(RenderingContext c, List<CollapsedBorderSide> borders)
    • paintAsLayer

      public void paintAsLayer(RenderingContext c, BlockBox startingPoint)
    • paintListMarkers

      private void paintListMarkers(RenderingContext c, List<Box> blocks, BoxRangeLists rangeLists)
    • paintReplacedElements

      private void paintReplacedElements(RenderingContext c, List<Box> blocks, BoxRangeLists rangeLists)
    • positionFixedLayer

      private void positionFixedLayer(RenderingContext c)
    • paintLayerBackgroundAndBorder

      private void paintLayerBackgroundAndBorder(RenderingContext c)
    • paintReplacedElement

      private void paintReplacedElement(RenderingContext c, BlockBox replaced)
    • isRootLayer

      public boolean isRootLayer()
    • moveIfGreater

      private void moveIfGreater(Dimension result, Dimension test)
    • calcPaintingDimension

      private PaintingInfo calcPaintingDimension(LayoutContext c)
    • positionChildren

      public void positionChildren(LayoutContext c)
    • position

      private void position(LayoutContext c)
    • containsFixedLayer

      private boolean containsFixedLayer()
    • containsFixedContent

      public boolean containsFixedContent()
    • setFixedBackground

      public void setFixedBackground(boolean b)
    • getChildren

      public List<Layer> getChildren()
    • remove

      private void remove(Layer layer)
    • detach

      public void detach()
    • isInline

      public boolean isInline()
    • setInline

      public void setInline(boolean inline)
    • getEnd

      public Box getEnd()
    • setEnd

      public void setEnd(Box end)
    • isRequiresLayout

      public boolean isRequiresLayout()
    • setRequiresLayout

      public void setRequiresLayout(boolean requiresLayout)
    • finish

      public void finish(LayoutContext c)
    • layoutAbsoluteChildren

      private void layoutAbsoluteChildren(LayoutContext c)
    • layoutAbsoluteChild

      private void layoutAbsoluteChild(LayoutContext c, Layer child)
    • getPages

      public List<PageBox> getPages()
    • isLastPage

      public boolean isLastPage(PageBox pageBox)
    • addPage

      public void addPage(CssContext c)
    • removeLastPage

      public void removeLastPage()
    • createPageBox

      public static PageBox createPageBox(CssContext c, String pseudoPage)
    • getFirstPage

      public PageBox getFirstPage(CssContext c, Box box)
    • getLastPage

      public PageBox getLastPage(CssContext c, Box box)
    • ensureHasPage

      public void ensureHasPage(CssContext c, Box box)
    • getPage

      public PageBox getPage(CssContext c, int yOffset)
    • addPagesUntilPosition

      private void addPagesUntilPosition(CssContext c, int position)
    • trimEmptyPages

      public void trimEmptyPages(int maxYHeight)
    • trimPageCount

      public void trimPageCount(int newPageCount)
    • assignPagePaintingPositions

      public void assignPagePaintingPositions(CssContext cssCtx, short mode)
    • assignPagePaintingPositions

      public void assignPagePaintingPositions(CssContext cssCtx, int mode, int additionalClearance)
    • getMaxPageWidth

      public int getMaxPageWidth(CssContext cssCtx, int additionalClearance)
    • getLastPage

      public PageBox getLastPage()
    • crossesPageBreak

      public boolean crossesPageBreak(LayoutContext c, int top, int bottom)
    • findRoot

      public Layer findRoot()
    • addRunningBlock

      public void addRunningBlock(BlockBox block)
    • removeRunningBlock

      public void removeRunningBlock(BlockBox block)
    • getRunningBlock

      public BlockBox getRunningBlock(String identifier, PageBox page, PageElementPosition which)
    • layoutPages

      public void layoutPages(LayoutContext c)
    • addPageSequence

      public void addPageSequence(BlockBox start)
    • getSortedPageSequences

      private List<BlockBox> getSortedPageSequences()
    • getRelativePageNo

      public int getRelativePageNo(RenderingContext c, int absY)
    • findPageSequence

      private BlockBox findPageSequence(List<BlockBox> sequences, int absY)
    • getRelativePageNo

      public int getRelativePageNo(RenderingContext c)
    • getRelativePageCount

      public int getRelativePageCount(RenderingContext c)
    • getPageSequenceStart

      private int getPageSequenceStart(List<BlockBox> sequences, PageBox page)
    • getLastRequestedPage

      private PageBox getLastRequestedPage()
    • setLastRequestedPage

      private void setLastRequestedPage(PageBox lastRequestedPage)