Package org.xhtmlrenderer.render
Class Box
java.lang.Object
org.xhtmlrenderer.render.Box
- All Implemented Interfaces:
Styleable
- Direct Known Subclasses:
BlockBox
,InlineLayoutBox
,LineBox
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private final boolean
private @Nullable Box
private @Nullable Layer
private int
Box width.private @Nullable Element
private int
private int
private @Nullable Layer
private int
private @Nullable PaintingInfo
private @Nullable Box
private @Nullable String
private @Nullable Dimension
private int
private Box.State
private @Nullable CalculatedStyle
private int
Keeps track of the start of children's containing block.private int
private @Nullable RectPropertySet
private int
private int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Box
(@Nullable Element element, @Nullable CalculatedStyle style, boolean anonymous) protected
Box
(@Nullable Box parent, @Nullable CalculatedStyle style) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllChildren
(List<Box> children) void
void
addChildForLayout
(LayoutContext c, Box child) void
analyzePageBreaks
(LayoutContext c, ContentLimitContainer container) protected void
appendPosition
(StringBuilder result) protected void
appendSize
(StringBuilder result) abstract void
void
protected void
calcChildPaintingInfo
(CssContext c, PaintingInfo result, boolean useCache) calcPaintingInfo
(CssContext c, boolean useCache) void
clearSelection
(List<Box> modified) void
collectText
(RenderingContext c, StringBuilder buffer) void
boolean
void
abstract String
dump
(LayoutContext c, String indent, Box.Dump which) protected void
dumpBoxes
(LayoutContext c, String indent, List<Box> boxes, Box.Dump which, StringBuilder result) private @NonNull RectPropertySet
ensureWorkingMargin
(CssContext cssContext) private void
exportPageBoxText
(RenderingContext c, Writer writer) protected void
exportPageBoxText
(RenderingContext c, Writer writer, int yPos) void
exportText
(RenderingContext c, Writer writer) @Nullable Box
find
(CssContext cssCtx, int absX, int absY, boolean findAnonymous) void
forcePageBreakAfter
(LayoutContext c, IdentValue pageBreakValue) int
forcePageBreakBefore
(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName) int
getAbsX()
int
getAbsY()
getBorder
(CssContext cssCtx) getBorderEdge
(int left, int top, CssContext cssCtx) int
getChild
(int i) int
@Nullable Box
protected int
@Nullable Layer
getContentAreaEdge
(int left, int top, CssContext cssCtx) int
int
@Nullable Element
getElementBoxes
(Element elem) int
protected int
getIndex()
@Nullable Layer
getLayer()
int
getMargin
(CssContext cssContext) int
getMarginBorderPadding
(CssContext cssCtx, CalculatedStyle.Edge edge) getMarginEdge
(int left, int top, CssContext cssCtx, int tx, int ty) getMarginEdge
(CssContext cssCtx, int tx, int ty) protected @Nullable Box
@Nullable Box
getPadding
(CssContext cssCtx) getPaddingEdge
(int left, int top, CssContext cssCtx) protected int
getPaddingWidth
(CssContext cssCtx) getPaintingBorderEdge
(CssContext cssCtx) getPaintingClipEdge
(CssContext cssCtx) @Nullable PaintingInfo
getPaintingPaddingEdge
(CssContext cssCtx) @Nullable Box
protected @Nullable Box
getPrevious
(Box child) @Nullable Box
@Nullable String
@Nullable Dimension
int
getState()
final @Nullable CalculatedStyle
getStyle()
protected RectPropertySet
getStyleMargin
(CssContext cssContext) protected RectPropertySet
getStyleMarginNoCache
(CssContext cssContext) int
getTx()
int
getTy()
int
getWidth()
int
getX()
int
getY()
void
boolean
intersects
(CssContext cssCtx, @Nullable Shape clip) NOTE: This method does not consider any children of this boxboolean
boolean
isBody()
boolean
boolean
protected boolean
protected boolean
protected boolean
private boolean
boolean
isRoot()
boolean
isStyled()
protected void
moveIfGreater
(Dimension result, Dimension test) void
void
void
private void
positionRelative
(CssContext cssCtx) void
void
removeChild
(int i) void
removeChild
(Box target) void
protected void
void
resetChildren
(LayoutContext c, int start, int end) protected void
resetTopMargin
(CssContext cssContext) void
protected void
void
void
setAbsX
(int absX) void
setAbsY
(int absY) void
setBoxDimensions
(BoxDimensions dimensions) void
setContainingBlock
(Box containingBlock) void
setContainingLayer
(@Nullable Layer containingLayer) void
setContentWidth
(int contentWidth) final void
setElement
(@Nullable Element element) void
setHeight
(int height) protected void
setIndex
(int index) void
void
setLeftMBP
(int leftMBP) protected void
setMarginBottom
(CssContext cssContext, int marginBottom) void
setMarginLeft
(CssContext cssContext, int marginLeft) protected void
setMarginRight
(CssContext cssContext, int marginRight) protected final void
setMarginTop
(CssContext cssContext, int marginTop) private void
setPaintingInfo
(@Nullable PaintingInfo paintingInfo) void
void
setPseudoElementOrClass
(String pseudoElementOrClass) void
setRightMBP
(int rightMBP) void
void
setStyle
(@Nullable CalculatedStyle style) void
setTx
(int tx) void
setTy
(int ty) void
setX
(int x) void
setY
(int y) toString()
-
Field Details
-
_element
-
_x
private int _x -
_y
private int _y -
_absY
private int _absY -
_absX
private int _absX -
_contentWidth
private int _contentWidthBox width. -
_rightMBP
private int _rightMBP -
_leftMBP
private int _leftMBP -
_height
private int _height -
_layer
-
_containingLayer
-
_parent
-
_boxes
-
_tx
private int _txKeeps track of the start of children's containing block. -
_ty
private int _ty -
_style
-
_containingBlock
-
_relativeOffset
-
_paintingInfo
-
_workingMargin
-
_index
private int _index -
_pseudoElementOrClass
-
_anonymous
private final boolean _anonymous -
_state
-
-
Constructor Details
-
Box
-
Box
-
-
Method Details
-
dump
-
dumpBoxes
protected void dumpBoxes(LayoutContext c, String indent, List<Box> boxes, Box.Dump which, StringBuilder result) -
getWidth
public int getWidth() -
toString
-
appendPosition
-
appendSize
-
addChildForLayout
-
addChild
-
addAllChildren
-
removeAllChildren
public void removeAllChildren() -
removeChild
-
getPreviousSibling
-
getNextSibling
-
getPrevious
-
getNext
-
removeChild
public void removeChild(int i) -
setParent
-
getParent
-
getChildCount
public int getChildCount() -
getChild
-
getChildren
-
getState
-
setState
-
getStyle
-
setStyle
-
getContainingBlock
-
setContainingBlock
-
getMarginEdge
-
getMarginEdge
-
getPaintingBorderEdge
-
getPaintingPaddingEdge
-
getPaintingClipEdge
-
getChildrenClipEdge
-
intersects
NOTE: This method does not consider any children of this box -
getBorderEdge
-
getPaddingEdge
-
getPaddingWidth
-
getContentAreaEdge
-
getLayer
-
setLayer
-
positionRelative
-
isInlineBlock
protected boolean isInlineBlock() -
setAbsY
public void setAbsY(int absY) -
getAbsY
public int getAbsY() -
setAbsX
public void setAbsX(int absX) -
getAbsX
public int getAbsX() -
isStyled
public boolean isStyled() -
getBorderSides
public int getBorderSides() -
paintBorder
-
isPaintsRootElementBackground
private boolean isPaintsRootElementBackground() -
paintBackground
-
paintRootElementBackground
-
paintRootElementBackground
-
getContainingLayer
-
setContainingLayer
-
initContainingLayer
-
connectChildrenToCurrentLayer
-
getElementBoxes
-
reset
-
detach
-
resetChildren
-
resetChildren
-
calcCanvasLocation
public abstract void calcCanvasLocation() -
calcChildLocations
public void calcChildLocations() -
forcePageBreakBefore
public int forcePageBreakBefore(LayoutContext c, IdentValue pageBreakValue, boolean pendingPageName) -
forcePageBreakAfter
-
crossesPageBreak
-
getRelativeOffset
-
find
@CheckReturnValue public @Nullable Box find(CssContext cssCtx, int absX, int absY, boolean findAnonymous) -
isRoot
public boolean isRoot() -
isBody
public boolean isBody() -
getElement
- Specified by:
getElement
in interfaceStyleable
-
setElement
- Specified by:
setElement
in interfaceStyleable
-
setMarginTop
-
setMarginBottom
-
setMarginLeft
-
setMarginRight
-
ensureWorkingMargin
-
getMargin
-
getStyleMargin
-
getStyleMarginNoCache
-
getPadding
-
getBorder
-
getContainingBlockWidth
protected int getContainingBlockWidth() -
resetTopMargin
-
clearSelection
-
selectAll
public void selectAll() -
calcPaintingInfo
-
calcChildPaintingInfo
-
getMarginBorderPadding
-
moveIfGreater
-
restyle
-
restyleChildren
-
getRestyleTarget
-
getIndex
protected int getIndex() -
setIndex
protected void setIndex(int index) -
getPseudoElementOrClass
- Specified by:
getPseudoElementOrClass
in interfaceStyleable
-
setPseudoElementOrClass
-
setX
public void setX(int x) -
getX
public int getX() -
setY
public void setY(int y) -
getY
public int getY() -
setTy
public void setTy(int ty) -
getTy
public int getTy() -
setTx
public void setTx(int tx) -
getTx
public int getTx() -
setRightMBP
public void setRightMBP(int rightMBP) -
getRightMBP
public int getRightMBP() -
setLeftMBP
public void setLeftMBP(int leftMBP) -
getLeftMBP
public int getLeftMBP() -
setHeight
public void setHeight(int height) -
getHeight
public int getHeight() -
setContentWidth
public void setContentWidth(int contentWidth) -
getContentWidth
public int getContentWidth() -
getPaintingInfo
-
setPaintingInfo
-
isAnonymous
public boolean isAnonymous() -
getBoxDimensions
-
setBoxDimensions
-
collectText
- Throws:
IOException
-
exportText
- Throws:
IOException
-
exportPageBoxText
- Throws:
IOException
-
exportPageBoxText
- Throws:
IOException
-
isInDocumentFlow
public boolean isInDocumentFlow() -
analyzePageBreaks
-
getEffBackgroundColor
-
isMarginAreaRoot
protected boolean isMarginAreaRoot() -
isContainedInMarginBox
public boolean isContainedInMarginBox() -
getEffectiveWidth
public int getEffectiveWidth() -
isInitialContainingBlock
protected boolean isInitialContainingBlock()
-