Top Description Fields Constructors Methods
com.openhtmltopdf.layout

public Class Layer

extends Object
Class Inheritance
Imports
com.openhtmltopdf.css.constants.CSSName, .IdentValue, .MarginBoxName, .PageElementPosition, com.openhtmltopdf.css.newmatch.PageInfo, com.openhtmltopdf.css.parser.CSSPrimitiveValue, .PropertyValue, com.openhtmltopdf.css.style.CalculatedStyle, .CssContext, .EmptyStyle, .FSDerivedValue, com.openhtmltopdf.css.style.derived.ListValue, .RectPropertySet, com.openhtmltopdf.newtable.CollapsedBorderValue, .TableBox, .TableCellBox, com.openhtmltopdf.render.*, com.openhtmltopdf.render.displaylist.TransformCreator, com.openhtmltopdf.util.LogMessageId, .SearchUtil, .XRLog, .SearchUtil.IntComparator, java.awt.*, java.awt.geom.AffineTransform, java.util.*, .List, java.util.function.Predicate, java.util.logging.Level

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 layed out after its containing block has completed layout).

Field Summary

Modifier and TypeField and Description
private List<Layer>
private AffineTransform
private Box
private List<BlockBox>
private boolean
private boolean
private final boolean
private boolean
private boolean
private PageBox
private Box
private List<PageBox>
private Set<BlockBox>
private Layer
private boolean
private Map<String, List<BlockBox>>
private Box
private int
private int
private Box
private int
private int
private List<BlockBox>
private boolean
public static final int
public static final int
public static final short
public static final short
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
public
Layer(Box master, CssContext c)

Creates the root layer.

public
Layer(Box master, CssContext c, boolean isolated)

public
Layer(Layer parent, Box master, CssContext c)

Creates a child layer.

Method Summary

Modifier and TypeMethod and Description
public void
addChild(Layer layer)

public void
public void
public void
private void
public void
protected List<AffineTransform>
applyTranform(RenderingContext c, Box box)
Deprecated

Applies the transforms specified for the box and returns a list of inverse transforms that should be applied once the transformed element has been output.

private void
applyTransformFunctions(float flipFactor, List<PropertyValue> transformList, List<AffineTransform> resultTransforms)
Deprecated

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

private PaintingInfo
private Map<TableCellBox, List<CollapsedBorderSide>>
public List<Layer>
collectLayers(int
NEGATIVE ZERO POSITIVE AUTO corresponding to z-index property.
which
)

Called recusively to collect all descendant layers in a layer tree so they can be painted in correct order.

private float
public static PageBox
public boolean
crossesPageBreak(LayoutContext c, int top, int bottom)

Returns whether the a box with the given top and bottom would cross a page break.

public void
public void
private Box
find(CssContext cssCtx, int absX, int absY, List<Layer> layers, boolean findAnonymous)
Deprecated

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

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

public Layer
public void
public List<Layer>
getChildren()

The resulting list should not be modified.

public AffineTransform

Returns:

null or affine transform.
getCurrentTransformMatrix
()

The document coordinates current transform, this is cumulative from layer to child layer.

public Box
public PageBox
getFirstPage(CssContext c, int absY)

Returns the page box for a Y position.

public PageBox
public List<BlockBox>
public PageBox
public PageBox
private PageBox
public Box
public int
getMaxPageWidth(CssContext cssCtx, int additionalClearance)

public PageBox
getPage(CssContext c, int yOffset)

Gets the page box for the given document y offset.

public List<PageBox>
public List<PageBox>
getPages(CssContext c, int top, int bottom)

Tries to return a list of pages that cover top to bottom.

private int
public Dimension
public Layer
public int
public int
public int
public BlockBox
public Box
public int
public int
public Box
public int
public int
public List<Layer>
getSortedLayers(int which)

private List<BlockBox>
private List<Layer>
public int
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
private void
private void
public void
private void
private SearchUtil.IntComparator
pageFinder(List<PageBox> pages, int yOffset, Predicate<PageBox> matcher)

Returns a comparator that determines if the given pageBox is a match, too late or too early.

private Predicate<PageBox>
pagePredicate(int yOffset)

Returns a predicate that determines if yOffset sits on the given page.

public void
paint(RenderingContext c)
Deprecated

public void
paintAsLayer(RenderingContext c, BlockBox startingPoint)
Deprecated

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

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

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

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

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

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

private void
public void
public void
public void
propagateCurrentTransformationMatrix(CssContext c)

Recursively propagates the transformation matrix.

private void
remove(Layer layer)

public void
removeFloat(BlockBox floater)

FIXME: Only used when we reset a box, so trying to remove at sometime in the future.

public void
public void
public void
setEnd(Box end)

public void
setForDeletion(boolean forDeletion)

public void
setInline(boolean inline)

private void
setIsolated(boolean b)

private void
setLastRequestedPage(PageBox lastRequestedPage)

public void
public void
setRequiresLayout(boolean requiresLayout)

public void
setSelectionEnd(Box selectionEnd)

public void
setSelectionEndX(int selectionEndX)

public void
setSelectionEndY(int selectionEndY)

public void
setSelectionStart(Box selectionStart)

public void
setSelectionStartX(int selectionStartX)

public void
setSelectionStartY(int selectionStartY)

public void
setStackingContext(boolean stackingContext)

public void
trimEmptyPages(CssContext c, int maxYHeight)

public void
trimPageCount(int newPageCount)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait