Package org.xhtmlrenderer.layout
Class Layer
java.lang.Object
org.xhtmlrenderer.layout.Layer
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).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
(package private) static enum
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
addPageSequence
(BlockBox start) private void
addPagesUntilPosition
(CssContext c, int position) void
addRunningBlock
(BlockBox block) void
assignPagePaintingPositions
(CssContext cssCtx, Layer.PagedMode mode) void
assignPagePaintingPositions
(CssContext cssCtx, Layer.PagedMode mode, int additionalClearance) private PaintingInfo
private @Nullable Map<TableCellBox,
List<CollapsedBorderSide>> collectCollapsedTableBorders
(List<Box> blocks) collectLayers
(Layer.Width which) boolean
private boolean
static PageBox
createPageBox
(CssContext c, String pseudoPage) static PageBox
createPageBox
(CssContext c, String pseudoPage, int top, int pageNo) boolean
crossesPageBreak
(LayoutContext c, int top, int bottom) void
detach()
void
ensureHasPage
(CssContext c, Box box) @Nullable Box
find
(CssContext cssCtx, int absX, int absY, boolean findAnonymous) private @Nullable Box
find
(CssContext cssCtx, int absX, int absY, List<Layer> layers, boolean findAnonymous) private @Nullable BlockBox
findPageSequence
(List<BlockBox> sequences, int absY) findRoot()
void
@Nullable Box
getEnd()
@Nullable PageBox
getFirstPage
(CssContext c, Box box) @Nullable PageBox
@Nullable PageBox
getLastPage
(CssContext c, Box box) private @Nullable PageBox
int
getMaxPageWidth
(CssContext cssCtx, int additionalClearance) @Nullable PageBox
getPage
(CssContext c, int yOffset) getPages()
private int
getPageSequenceStart
(List<BlockBox> sequences, PageBox page) @Nullable Layer
int
int
int
getRelativePageNo
(RenderingContext c, int absY) @Nullable BlockBox
getRunningBlock
(String identifier, PageBox page, PageElementPosition which) getSortedLayers
(Layer.Width which) int
boolean
isInline()
boolean
isLastPage
(PageBox pageBox) boolean
boolean
boolean
private void
layoutAbsoluteChild
(LayoutContext c, Layer child) private void
void
private void
moveIfGreater
(Dimension result, Dimension test) void
void
paintAsLayer
(RenderingContext c, BlockBox startingPoint) private void
paintBackgroundsAndBorders
(RenderingContext c, List<Box> blocks, @Nullable Map<TableCellBox, List<CollapsedBorderSide>> collapsedTableBorders, BoxRangeLists rangeLists) private void
private void
private void
paintInlineContent
(RenderingContext c, List<Box> lines, BoxRangeLists rangeLists) private void
private void
paintLayers
(RenderingContext c, List<Layer> layers) private void
paintListMarkers
(RenderingContext c, List<Box> blocks, BoxRangeLists rangeLists) private void
paintReplacedElement
(RenderingContext c, BlockBox replaced) private void
paintReplacedElements
(RenderingContext c, List<Box> blocks, BoxRangeLists rangeLists) private void
paintSelection
(RenderingContext c, List<Box> lines) private void
void
private void
private static String
pseudoPage
(int size) private void
void
removeFloat
(BlockBox floater) void
void
removeRunningBlock
(BlockBox block) void
void
setFixedBackground
(boolean b) void
setInline
(boolean inline) private void
setLastRequestedPage
(@Nullable PageBox lastRequestedPage) void
setRequiresLayout
(boolean requiresLayout) void
trimEmptyPages
(int maxYHeight) void
trimPageCount
(int newPageCount)
-
Field Details
-
_parent
-
_stackingContext
private final boolean _stackingContext -
_children
-
_master
-
_end
-
_floats
-
_fixedBackground
private boolean _fixedBackground -
_inline
private boolean _inline -
_requiresLayout
private boolean _requiresLayout -
_pages
-
_lastRequestedPage
-
_pageSequences
-
_sortedPageSequences
-
_runningBlocks
-
-
Constructor Details
-
Layer
-
Layer
-
Layer
-
-
Method Details
-
getParent
-
isStackingContext
@CheckReturnValue public boolean isStackingContext() -
getZIndex
@CheckReturnValue public int getZIndex() -
getMaster
-
addChild
-
addFloat
-
removeFloat
-
paintFloats
-
paintLayers
-
collectLayers
-
getStackingContextLayers
-
getSortedLayers
-
paintBackgroundsAndBorders
private void paintBackgroundsAndBorders(RenderingContext c, List<Box> blocks, @Nullable Map<TableCellBox, List<CollapsedBorderSide>> collapsedTableBorders, BoxRangeLists rangeLists) -
paintInlineContent
-
paintSelection
-
getPaintingDimension
-
paint
-
getFloats
-
find
@CheckReturnValue public @Nullable Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) -
find
@CheckReturnValue private @Nullable Box find(CssContext cssCtx, int absX, int absY, List<Layer> layers, boolean findAnonymous) -
collectCollapsedTableBorders
@CheckReturnValue private @Nullable Map<TableCellBox,List<CollapsedBorderSide>> collectCollapsedTableBorders(List<Box> blocks) -
paintCollapsedTableBorders
-
paintAsLayer
-
paintListMarkers
-
paintReplacedElements
-
positionFixedLayer
-
paintLayerBackgroundAndBorder
-
paintReplacedElement
-
isRootLayer
public boolean isRootLayer() -
moveIfGreater
-
calcPaintingDimension
-
positionChildren
-
position
-
containsFixedLayer
@CheckReturnValue private boolean containsFixedLayer() -
containsFixedContent
@CheckReturnValue public boolean containsFixedContent() -
setFixedBackground
public void setFixedBackground(boolean b) -
getChildren
-
remove
-
detach
public void detach() -
isInline
@CheckReturnValue public boolean isInline() -
setInline
public void setInline(boolean inline) -
getEnd
-
setEnd
-
isRequiresLayout
@CheckReturnValue public boolean isRequiresLayout() -
setRequiresLayout
public void setRequiresLayout(boolean requiresLayout) -
finish
-
layoutAbsoluteChildren
-
layoutAbsoluteChild
-
getPages
-
isLastPage
-
addPage
-
pseudoPage
-
removeLastPage
public void removeLastPage() -
createPageBox
-
createPageBox
@CheckReturnValue public static PageBox createPageBox(CssContext c, String pseudoPage, int top, int pageNo) -
getFirstPage
-
getLastPage
-
ensureHasPage
-
getPage
-
addPagesUntilPosition
-
trimEmptyPages
public void trimEmptyPages(int maxYHeight) -
trimPageCount
public void trimPageCount(int newPageCount) -
assignPagePaintingPositions
-
assignPagePaintingPositions
public void assignPagePaintingPositions(CssContext cssCtx, Layer.PagedMode mode, int additionalClearance) -
getMaxPageWidth
-
getLastPage
-
crossesPageBreak
-
findRoot
-
addRunningBlock
-
removeRunningBlock
-
getRunningBlock
public @Nullable BlockBox getRunningBlock(String identifier, PageBox page, PageElementPosition which) -
layoutPages
-
addPageSequence
-
getSortedPageSequences
-
getRelativePageNo
-
findPageSequence
-
getRelativePageNo
-
getRelativePageCount
-
getPageSequenceStart
-
getLastRequestedPage
-
setLastRequestedPage
-