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 Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Box
private boolean
private boolean
private PageBox
private final Box
private final Layer
private boolean
private boolean
private static final int
private static final int
static final short
static final short
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addFloat
(BlockBox floater, BlockFormattingContext bfc) void
void
addPageSequence
(BlockBox start) private void
addPagesUntilPosition
(CssContext c, int position) void
addRunningBlock
(BlockBox block) void
assignPagePaintingPositions
(CssContext cssCtx, int mode, int additionalClearance) void
assignPagePaintingPositions
(CssContext cssCtx, short mode) private PaintingInfo
private Map<TableCellBox,
List<CollapsedBorderSide>> collectCollapsedTableBorders
(List<Box> blocks) collectLayers
(int which) boolean
private boolean
static PageBox
createPageBox
(CssContext c, String pseudoPage) boolean
crossesPageBreak
(LayoutContext c, int top, int bottom) void
detach()
void
ensureHasPage
(CssContext c, Box box) find
(CssContext cssCtx, int absX, int absY, boolean findAnonymous) private Box
find
(CssContext cssCtx, int absX, int absY, List<Layer> layers, boolean findAnonymous) private BlockBox
findPageSequence
(List<BlockBox> sequences, int absY) findRoot()
void
getEnd()
getFirstPage
(CssContext c, Box box) getLastPage
(CssContext c, Box box) private PageBox
int
getMaxPageWidth
(CssContext cssCtx, int additionalClearance) getPage
(CssContext c, int yOffset) getPages()
private int
getPageSequenceStart
(List<BlockBox> sequences, PageBox page) int
int
int
getRelativePageNo
(RenderingContext c, int absY) getRunningBlock
(String identifier, PageBox page, PageElementPosition which) getSortedLayers
(int which) getStackingContextLayers
(int 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, 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 void
void
removeFloat
(BlockBox floater) void
void
removeRunningBlock
(BlockBox block) void
void
setFixedBackground
(boolean b) void
setInline
(boolean inline) private void
setLastRequestedPage
(PageBox lastRequestedPage) void
setRequiresLayout
(boolean requiresLayout) private void
setStackingContext
(boolean stackingContext) void
trimEmptyPages
(int maxYHeight) void
trimPageCount
(int newPageCount)
-
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
-
_stackingContext
private boolean _stackingContext -
_children
-
_master
-
_end
-
_floats
-
_fixedBackground
private boolean _fixedBackground -
_inline
private boolean _inline -
_requiresLayout
private boolean _requiresLayout -
_pages
-
_lastRequestedPage
-
_pageSequences
-
_sortedPageSequences
-
_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
-
Layer
-
-
Method Details
-
getParent
-
isStackingContext
public boolean isStackingContext() -
setStackingContext
private void setStackingContext(boolean stackingContext) -
getZIndex
public int getZIndex() -
getMaster
-
addChild
-
addFloat
-
removeFloat
-
paintFloats
-
paintLayers
-
collectLayers
-
getStackingContextLayers
-
getSortedLayers
-
paintBackgroundsAndBorders
private void paintBackgroundsAndBorders(RenderingContext c, List<Box> blocks, Map<TableCellBox, List<CollapsedBorderSide>> collapsedTableBorders, BoxRangeLists rangeLists) -
paintInlineContent
-
paintSelection
-
getPaintingDimension
-
paint
-
getFloats
-
find
-
find
-
collectCollapsedTableBorders
-
paintCollapsedTableBorders
-
paintAsLayer
-
paintListMarkers
-
paintReplacedElements
-
positionFixedLayer
-
paintLayerBackgroundAndBorder
-
paintReplacedElement
-
isRootLayer
public boolean isRootLayer() -
moveIfGreater
-
calcPaintingDimension
-
positionChildren
-
position
-
containsFixedLayer
private boolean containsFixedLayer() -
containsFixedContent
public boolean containsFixedContent() -
setFixedBackground
public void setFixedBackground(boolean b) -
getChildren
-
remove
-
detach
public void detach() -
isInline
public boolean isInline() -
setInline
public void setInline(boolean inline) -
getEnd
-
setEnd
-
isRequiresLayout
public boolean isRequiresLayout() -
setRequiresLayout
public void setRequiresLayout(boolean requiresLayout) -
finish
-
layoutAbsoluteChildren
-
layoutAbsoluteChild
-
getPages
-
isLastPage
-
addPage
-
removeLastPage
public void removeLastPage() -
createPageBox
-
getFirstPage
-
getLastPage
-
ensureHasPage
-
getPage
-
addPagesUntilPosition
-
trimEmptyPages
public void trimEmptyPages(int maxYHeight) -
trimPageCount
public void trimPageCount(int newPageCount) -
assignPagePaintingPositions
-
assignPagePaintingPositions
-
getMaxPageWidth
-
getLastPage
-
crossesPageBreak
-
findRoot
-
addRunningBlock
-
removeRunningBlock
-
getRunningBlock
-
layoutPages
-
addPageSequence
-
getSortedPageSequences
-
getRelativePageNo
-
findPageSequence
-
getRelativePageNo
-
getRelativePageCount
-
getPageSequenceStart
-
getLastRequestedPage
-
setLastRequestedPage
-