Class Layer
java.lang.Object
org.openpdf.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 enumprivate static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidaddPageSequence(BlockBox start) private voidaddPagesUntilPosition(CssContext c, int position) voidaddRunningBlock(BlockBox block) voidassignPagePaintingPositions(CssContext cssCtx, Layer.PagedMode mode) voidassignPagePaintingPositions(CssContext cssCtx, Layer.PagedMode mode, int additionalClearance) private PaintingInfoprivate @Nullable Map<TableCellBox, List<CollapsedBorderSide>> collectCollapsedTableBorders(List<Box> blocks) collectLayers(Layer.Width which) booleanprivate booleanstatic PageBoxcreatePageBox(CssContext c, String pseudoPage) static PageBoxcreatePageBox(CssContext c, String pseudoPage, int top, int pageNo) booleancrossesPageBreak(LayoutContext c, int top, int bottom) voiddetach()voidensureHasPage(CssContext c, Box box) @Nullable Boxfind(CssContext cssCtx, int absX, int absY, boolean findAnonymous) private @Nullable Boxfind(CssContext cssCtx, int absX, int absY, List<Layer> layers, boolean findAnonymous) private @Nullable BlockBoxfindPageSequence(List<BlockBox> sequences, int absY) findRoot()void@Nullable BoxgetEnd()@Nullable PageBoxgetFirstPage(CssContext c, Box box) @Nullable PageBox@Nullable PageBoxgetLastPage(CssContext c, Box box) private @Nullable PageBoxintgetMaxPageWidth(CssContext cssCtx, int additionalClearance) float@Nullable PageBoxgetPage(CssContext c, int yOffset) getPages()private intgetPageSequenceStart(List<BlockBox> sequences, PageBox page) @Nullable LayerintintintgetRelativePageNo(RenderingContext c, int absY) @Nullable BlockBoxgetRunningBlock(String identifier, PageBox page, PageElementPosition which) getSortedLayers(Layer.Width which) intbooleanisInline()booleanisLastPage(PageBox pageBox) booleanbooleanbooleanprivate voidlayoutAbsoluteChild(LayoutContext c, Layer child) private voidvoidprivate voidmoveIfGreater(Dimension result, Dimension test) voidvoidpaintAsLayer(RenderingContext c, BlockBox startingPoint) private voidpaintBackgroundsAndBorders(RenderingContext c, List<Box> blocks, @Nullable Map<TableCellBox, List<CollapsedBorderSide>> collapsedTableBorders, BoxRangeLists rangeLists) private voidprivate voidprivate voidpaintInlineContent(RenderingContext c, List<Box> lines, BoxRangeLists rangeLists) private voidprivate voidpaintLayers(RenderingContext c, List<Layer> layers) private voidpaintListMarkers(RenderingContext c, List<Box> blocks, BoxRangeLists rangeLists) private voidpaintReplacedElement(RenderingContext c, BlockBox replaced) private voidpaintReplacedElements(RenderingContext c, List<Box> blocks, BoxRangeLists rangeLists) private voidpaintSelection(RenderingContext c, List<Box> lines) private voidvoidprivate voidprivate static StringpseudoPage(int size) private voidvoidremoveFloat(BlockBox floater) voidvoidremoveRunningBlock(BlockBox block) voidvoidsetFixedBackground(boolean b) voidsetInline(boolean inline) private voidsetLastRequestedPage(@Nullable PageBox lastRequestedPage) voidsetRequiresLayout(boolean requiresLayout) voidtrimEmptyPages(int maxYHeight) voidtrimPageCount(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() -
getOpacity
public float getOpacity() -
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
-