Top Inners Fields Constructors Methods
com.openhtmltopdf.render

public abstract Class Box

extends Object
implements Styleable, DisplayListItem
Class Inheritance
All Implemented Interfaces
com.openhtmltopdf.render.DisplayListItem, com.openhtmltopdf.layout.Styleable
Known Direct Subclasses
com.openhtmltopdf.render.InlineLayoutBox, com.openhtmltopdf.render.LineBox, com.openhtmltopdf.render.BlockBox
Imports
com.openhtmltopdf.css.constants.CSSName, .IdentValue, com.openhtmltopdf.css.parser.FSColor, .FSRGBColor, com.openhtmltopdf.css.style.CalculatedStyle, .CssContext, com.openhtmltopdf.css.style.derived.BorderPropertySet, .RectPropertySet, com.openhtmltopdf.layout.Layer, .LayoutContext, .PaintingInfo, .Styleable, com.openhtmltopdf.render.FlowingColumnContainerBox.ColumnBreakStore, com.openhtmltopdf.util.LambdaUtil, .LogMessageId, .XRLog, org.w3c.dom.Element, .Node, java.awt.*, java.awt.geom.AffineTransform, .Area, java.io.IOException, .Writer, java.util.ArrayList, .Collections, .Iterator, .List, java.util.function.Predicate, java.util.logging.Level

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private Area
private int
private int
private Object
private boolean
private List<Box>
private boolean
private Box
private Layer
private int
_contentWidth

Box width.

private Element
private int
_height

Box height.

private int
private Layer
private int
private PaintingInfo
private Box
private String
private Dimension
private int
private int
private CalculatedStyle
private int
_tx

Keeps track of the start of childrens containing block.

private int
private RectPropertySet
private int
private int
public static final int
public static final int
public static final int
public static final int
public static final int
protected static final String
public static final int

Constructor Summary

AccessConstructor and Description
protected
Box()

Method Summary

Modifier and TypeMethod and Description
public void
addAllChildren(List<Box> children)

public void
addChild(Box child)

public void
public void
public List<Box>
ancestors()

Get all ancestors, up until the root box.

public List<Box>
ancestorsWhile(Predicate<Box> predicate)

Creates a list of ancestors by walking up the chain of parent, grandparent, etc. Stops when the provided predicate returns false or the root box otherwise.

private Area
public abstract void
public void
protected void
calcChildPaintingInfo(CssContext c, PaintingInfo result, boolean useCache)

private Rectangle
public PaintingInfo
calcPaintingInfo(CssContext c, boolean useCache)

public void
public void
public boolean
crossesPageBreak(LayoutContext c)

Whether this box would cross a page break.

public void
public abstract String
dump(LayoutContext c, String indent, int which)

protected void
dumpBoxes(LayoutContext c, String indent, List<Box> boxes, int which, StringBuilder result)

private void
private void
protected void
public void
public Box
find(CssContext cssCtx, int absX, int absY, boolean findAnonymous)

public Box

Returns:

the box for which predicate returned true or null if none found.
findAncestor
(Predicate<Box> predicate)

Walks up the ancestor tree to the root testing ancestors agains the predicate.

public void
findColumnBreakOpportunities(FlowingColumnContainerBox.ColumnBreakStore
- use to report break opportunities.
store
)

Recursive method to find column break opportunities.

public void
forcePageBreakAfter(LayoutContext c, IdentValue pageBreakValue)

Forces a page break after this box.

public int
forcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName)

public int
forcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName, int absY)

public Area
getAbsoluteClipBox(CssContext c)

Returns the absolute (ie transformed if needed) clip area for this box.

public int
public int
public Object
public BorderPropertySet
public Rectangle
getBorderBox(CssContext c)

Only to be called after layout, due to double use of getHeight().

public int
public int
public Rectangle
getBorderEdge(int left, int top, CssContext cssCtx)

public int
public BoxDimensions
public Box
getChild(int i)

public int
public Iterator<Box>
public <T> Iterator<T>
getChildIteratorOfType(Class<T> type)

Returns an iterator of boxes cast to type.

public List<Box>
public Rectangle
public Rectangle
getClipBox(RenderingContext c, Layer layer)

Gets the combined clip of this box relative to the containing layer.

private Box
public Box
protected int
public Layer
public Rectangle
getContentAreaEdge(int left, int top, CssContext cssCtx)

public int
public Box
public FSColor
public int
public Element
public List<Box>
public int
getHeight()

Uh oh!

protected int
getIndex()

The zero based index of this child amongst its fellow children of its parent.

public Layer
public int
public RectPropertySet
getMargin(CssContext cssContext)

public int
public Rectangle
getMarginEdge(int left, int top, CssContext cssCtx, int tx, int ty)

public Rectangle
getMarginEdge(CssContext cssCtx, int tx, int ty)

protected Box
getNext(Box child)

public Box
public RectPropertySet
public Rectangle
getPaddingEdge(int left, int top, CssContext cssCtx)

protected int
public Rectangle
public Rectangle
public PaintingInfo
public Rectangle
public Box
public Rectangle
getParentClipBox(RenderingContext c, Layer layer)

Gets the layer relative clip for the parent box.

protected Box
public Box
public String
public Dimension
public int
public synchronized int
public final CalculatedStyle
protected RectPropertySet
protected RectPropertySet
getStyleMargin(CssContext cssContext, boolean useCache)

public int
public int
public int
public int
getX()

public int
getY()

public boolean
public boolean
hasRootElementBackground(RenderingContext c)

If the html or body box have a background return true.

public void
public boolean
intersects(CssContext cssCtx, Shape clip)

Note

This method does not consider any children of this box but does consider the transformation matrix of the containing layer.

public boolean
public boolean
public boolean
public boolean
isFirstChild()

Is this box the first child of its parent?

public boolean
protected boolean
protected boolean
protected boolean
private boolean
public boolean
public boolean
public boolean
isTerminalColumnBreak()

Is this box unbreakable in regards to column break opportunities?

protected void
public void
public void
public void
private void
public Dimension
public void
public boolean
removeChild(Box target)

Removes a child box if it is indeed a child and adjusts the index of subsequent children.

public boolean
removeChild(int index)

Removes child by index and adjusts the index of subsequent children.

public void
reset(LayoutContext c)

Responsible for resetting the state of the box before a repeat call to BlockBox#layout(LayoutContext) or other layout methods.

public void
resetChildren(LayoutContext c, int start, int end)

protected void
protected void
public Box
rootBox()

Returns the highest ancestor box.

public void
setAbsX(int absX)

public void
setAbsY(int absY)

public void
public void
setAnonymous(boolean anonymous)

protected void
public void
setBorderBoxWidth(CssContext c, int borderBoxWidth)

public void
public void
setContainingBlock(Box containingBlock)

public void
setContainingLayer(Layer containingLayer)

public void
setContentWidth(int contentWidth)

public void
public void
setHeight(int height)

Uh oh!

protected void
setIndex(int index)

See getIndex() Must make sure this is correct when removing children/rearranging children.

public void
setLayer(Layer layer)

public void
setLeftMBP(int leftMBP)

public void
setMarginBottom(CssContext cssContext, int marginBottom)

public void
setMarginLeft(CssContext cssContext, int marginLeft)

public void
setMarginRight(CssContext cssContext, int marginRight)

public void
setMarginTop(CssContext cssContext, int marginTop)

private void
public void
public void
setPseudoElementOrClass(String pseudoElementOrClass)

public void
setRelativeOffset(Dimension relativeOffset)

public void
setRightMBP(int rightMBP)

public synchronized void
setState(int state)

public void
public void
setTx(int tx)

public void
setTy(int ty)

public void
setX(int x)

public void
setY(int y)

public static String
stateToString(int state)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait