org.xhtmlrenderer.render
Class Box
java.lang.Object
org.xhtmlrenderer.render.Box
- All Implemented Interfaces:
- Styleable
- Direct Known Subclasses:
- BlockBox, InlineLayoutBox, LineBox
public abstract class Box
- extends Object
- implements Styleable
|
Constructor Summary |
protected |
Box()
|
|
Method Summary |
void |
addAllChildren(List children)
|
void |
addChild(Box child)
|
void |
addChildForLayout(LayoutContext c,
Box child)
|
void |
analyzePageBreaks(LayoutContext c,
ContentLimitContainer container)
|
abstract void |
calcCanvasLocation()
|
void |
calcChildLocations()
|
protected void |
calcChildPaintingInfo(CssContext c,
PaintingInfo result,
boolean useCache)
|
PaintingInfo |
calcPaintingInfo(CssContext c,
boolean useCache)
|
void |
clearSelection(List modified)
|
void |
collectText(RenderingContext c,
StringBuffer buffer)
|
void |
connectChildrenToCurrentLayer(LayoutContext c)
|
boolean |
crossesPageBreak(LayoutContext c)
|
void |
detach(LayoutContext c)
|
abstract String |
dump(LayoutContext c,
String indent,
int which)
|
protected void |
dumpBoxes(LayoutContext c,
String indent,
List boxes,
int which,
StringBuffer result)
|
protected void |
exportPageBoxText(RenderingContext c,
Writer writer,
int yPos)
|
void |
exportText(RenderingContext c,
Writer writer)
|
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()
|
BorderPropertySet |
getBorder(CssContext cssCtx)
|
Rectangle |
getBorderEdge(int left,
int top,
CssContext cssCtx)
|
int |
getBorderSides()
|
BoxDimensions |
getBoxDimensions()
|
Box |
getChild(int i)
|
int |
getChildCount()
|
Iterator |
getChildIterator()
|
List |
getChildren()
|
Rectangle |
getChildrenClipEdge(RenderingContext c)
|
Box |
getContainingBlock()
|
protected int |
getContainingBlockWidth()
|
Layer |
getContainingLayer()
|
Rectangle |
getContentAreaEdge(int left,
int top,
CssContext cssCtx)
|
int |
getContentWidth()
|
Box |
getDocumentParent()
|
FSColor |
getEffBackgroundColor(RenderingContext c)
|
int |
getEffectiveWidth()
|
Element |
getElement()
|
List |
getElementBoxes(Element elem)
|
int |
getHeight()
|
protected int |
getIndex()
|
Layer |
getLayer()
|
int |
getLeftMBP()
|
RectPropertySet |
getMargin(CssContext cssContext)
|
int |
getMarginBorderPadding(CssContext cssCtx,
int which)
|
Rectangle |
getMarginEdge(CssContext cssCtx,
int tx,
int ty)
|
Rectangle |
getMarginEdge(int left,
int top,
CssContext cssCtx,
int tx,
int ty)
|
protected Box |
getNext(Box child)
|
Box |
getNextSibling()
|
RectPropertySet |
getPadding(CssContext cssCtx)
|
Rectangle |
getPaddingEdge(int left,
int top,
CssContext cssCtx)
|
protected int |
getPaddingWidth(CssContext cssCtx)
|
Rectangle |
getPaintingBorderEdge(CssContext cssCtx)
|
Rectangle |
getPaintingClipEdge(CssContext cssCtx)
|
PaintingInfo |
getPaintingInfo()
|
Rectangle |
getPaintingPaddingEdge(CssContext cssCtx)
|
Box |
getParent()
|
protected Box |
getPrevious(Box child)
|
Box |
getPreviousSibling()
|
String |
getPseudoElementOrClass()
|
Dimension |
getRelativeOffset()
|
Box |
getRestyleTarget()
|
int |
getRightMBP()
|
int |
getState()
|
CalculatedStyle |
getStyle()
|
protected RectPropertySet |
getStyleMargin(CssContext cssContext)
|
protected RectPropertySet |
getStyleMargin(CssContext cssContext,
boolean useCache)
|
int |
getTx()
|
int |
getTy()
|
int |
getWidth()
|
int |
getX()
|
int |
getY()
|
void |
initContainingLayer(LayoutContext c)
|
boolean |
intersects(CssContext cssCtx,
Shape clip)
NOTE: This method does not consider any children of this box |
boolean |
isAnonymous()
|
boolean |
isBody()
|
boolean |
isContainedInMarginBox()
|
boolean |
isInDocumentFlow()
|
protected boolean |
isInlineBlock()
|
protected boolean |
isMarginAreaRoot()
|
boolean |
isRoot()
|
boolean |
isStyled()
|
protected void |
moveIfGreater(Dimension result,
Dimension test)
|
void |
paintBackground(RenderingContext c)
|
void |
paintBorder(RenderingContext c)
|
void |
paintRootElementBackground(RenderingContext c)
|
Dimension |
positionRelative(CssContext cssCtx)
|
void |
removeAllChildren()
|
void |
removeChild(Box target)
|
void |
removeChild(int i)
|
void |
reset(LayoutContext c)
|
protected void |
resetChildren(LayoutContext c)
|
void |
resetChildren(LayoutContext c,
int start,
int end)
|
protected void |
resetTopMargin(CssContext cssContext)
|
void |
restyle(LayoutContext c)
|
protected void |
restyleChildren(LayoutContext c)
|
void |
selectAll()
|
void |
setAbsX(int absX)
|
void |
setAbsY(int absY)
|
void |
setAnonymous(boolean anonymous)
|
void |
setBoxDimensions(BoxDimensions dimensions)
|
void |
setContainingBlock(Box containingBlock)
|
void |
setContainingLayer(Layer containingLayer)
|
void |
setContentWidth(int contentWidth)
|
void |
setElement(Element element)
|
void |
setHeight(int height)
|
protected void |
setIndex(int index)
|
void |
setLayer(Layer layer)
|
void |
setLeftMBP(int leftMBP)
|
void |
setMarginBottom(CssContext cssContext,
int marginBottom)
|
void |
setMarginLeft(CssContext cssContext,
int marginLeft)
|
void |
setMarginRight(CssContext cssContext,
int marginRight)
|
void |
setMarginTop(CssContext cssContext,
int marginTop)
|
void |
setParent(Box box)
|
void |
setPseudoElementOrClass(String pseudoElementOrClass)
|
void |
setRelativeOffset(Dimension relativeOffset)
|
void |
setRightMBP(int rightMBP)
|
void |
setState(int state)
|
void |
setStyle(CalculatedStyle style)
|
void |
setTx(int tx)
|
void |
setTy(int ty)
|
void |
setX(int x)
|
void |
setY(int y)
|
static String |
stateToString(int state)
|
String |
toString()
|
LINE_SEPARATOR
protected static final String LINE_SEPARATOR
NOTHING
public static final int NOTHING
- See Also:
- Constant Field Values
FLUX
public static final int FLUX
- See Also:
- Constant Field Values
CHILDREN_FLUX
public static final int CHILDREN_FLUX
- See Also:
- Constant Field Values
DONE
public static final int DONE
- See Also:
- Constant Field Values
DUMP_RENDER
public static final int DUMP_RENDER
- See Also:
- Constant Field Values
DUMP_LAYOUT
public static final int DUMP_LAYOUT
- See Also:
- Constant Field Values
Box
protected Box()
dump
public abstract String dump(LayoutContext c,
String indent,
int which)
dumpBoxes
protected void dumpBoxes(LayoutContext c,
String indent,
List boxes,
int which,
StringBuffer result)
getWidth
public int getWidth()
toString
public String toString()
- Overrides:
toString in class Object
addChildForLayout
public void addChildForLayout(LayoutContext c,
Box child)
addChild
public void addChild(Box child)
addAllChildren
public void addAllChildren(List children)
removeAllChildren
public void removeAllChildren()
removeChild
public void removeChild(Box target)
getPreviousSibling
public Box getPreviousSibling()
getNextSibling
public Box getNextSibling()
getPrevious
protected Box getPrevious(Box child)
getNext
protected Box getNext(Box child)
removeChild
public void removeChild(int i)
setParent
public void setParent(Box box)
getParent
public Box getParent()
getDocumentParent
public Box getDocumentParent()
getChildCount
public int getChildCount()
getChild
public Box getChild(int i)
getChildIterator
public Iterator getChildIterator()
getChildren
public List getChildren()
getState
public int getState()
setState
public void setState(int state)
stateToString
public static String stateToString(int state)
getStyle
public final CalculatedStyle getStyle()
- Specified by:
getStyle in interface Styleable
setStyle
public void setStyle(CalculatedStyle style)
- Specified by:
setStyle in interface Styleable
getContainingBlock
public Box getContainingBlock()
setContainingBlock
public void setContainingBlock(Box containingBlock)
getMarginEdge
public Rectangle getMarginEdge(int left,
int top,
CssContext cssCtx,
int tx,
int ty)
getMarginEdge
public Rectangle getMarginEdge(CssContext cssCtx,
int tx,
int ty)
getPaintingBorderEdge
public Rectangle getPaintingBorderEdge(CssContext cssCtx)
getPaintingPaddingEdge
public Rectangle getPaintingPaddingEdge(CssContext cssCtx)
getPaintingClipEdge
public Rectangle getPaintingClipEdge(CssContext cssCtx)
getChildrenClipEdge
public Rectangle getChildrenClipEdge(RenderingContext c)
intersects
public boolean intersects(CssContext cssCtx,
Shape clip)
- NOTE: This method does not consider any children of this box
getBorderEdge
public Rectangle getBorderEdge(int left,
int top,
CssContext cssCtx)
getPaddingEdge
public Rectangle getPaddingEdge(int left,
int top,
CssContext cssCtx)
getPaddingWidth
protected int getPaddingWidth(CssContext cssCtx)
getContentAreaEdge
public Rectangle getContentAreaEdge(int left,
int top,
CssContext cssCtx)
getLayer
public Layer getLayer()
setLayer
public void setLayer(Layer layer)
positionRelative
public Dimension positionRelative(CssContext cssCtx)
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
public void paintBorder(RenderingContext c)
paintBackground
public void paintBackground(RenderingContext c)
paintRootElementBackground
public void paintRootElementBackground(RenderingContext c)
getContainingLayer
public Layer getContainingLayer()
setContainingLayer
public void setContainingLayer(Layer containingLayer)
initContainingLayer
public void initContainingLayer(LayoutContext c)
connectChildrenToCurrentLayer
public void connectChildrenToCurrentLayer(LayoutContext c)
getElementBoxes
public List getElementBoxes(Element elem)
reset
public void reset(LayoutContext c)
detach
public void detach(LayoutContext c)
resetChildren
public void resetChildren(LayoutContext c,
int start,
int end)
resetChildren
protected void resetChildren(LayoutContext c)
calcCanvasLocation
public abstract void calcCanvasLocation()
calcChildLocations
public void calcChildLocations()
forcePageBreakBefore
public int forcePageBreakBefore(LayoutContext c,
IdentValue pageBreakValue,
boolean pendingPageName)
forcePageBreakAfter
public void forcePageBreakAfter(LayoutContext c,
IdentValue pageBreakValue)
crossesPageBreak
public boolean crossesPageBreak(LayoutContext c)
getRelativeOffset
public Dimension getRelativeOffset()
setRelativeOffset
public void setRelativeOffset(Dimension relativeOffset)
find
public Box find(CssContext cssCtx,
int absX,
int absY,
boolean findAnonymous)
isRoot
public boolean isRoot()
isBody
public boolean isBody()
getElement
public Element getElement()
- Specified by:
getElement in interface Styleable
setElement
public void setElement(Element element)
- Specified by:
setElement in interface Styleable
setMarginTop
public void setMarginTop(CssContext cssContext,
int marginTop)
setMarginBottom
public void setMarginBottom(CssContext cssContext,
int marginBottom)
setMarginLeft
public void setMarginLeft(CssContext cssContext,
int marginLeft)
setMarginRight
public void setMarginRight(CssContext cssContext,
int marginRight)
getMargin
public RectPropertySet getMargin(CssContext cssContext)
getStyleMargin
protected RectPropertySet getStyleMargin(CssContext cssContext)
getStyleMargin
protected RectPropertySet getStyleMargin(CssContext cssContext,
boolean useCache)
getPadding
public RectPropertySet getPadding(CssContext cssCtx)
getBorder
public BorderPropertySet getBorder(CssContext cssCtx)
getContainingBlockWidth
protected int getContainingBlockWidth()
resetTopMargin
protected void resetTopMargin(CssContext cssContext)
clearSelection
public void clearSelection(List modified)
selectAll
public void selectAll()
calcPaintingInfo
public PaintingInfo calcPaintingInfo(CssContext c,
boolean useCache)
calcChildPaintingInfo
protected void calcChildPaintingInfo(CssContext c,
PaintingInfo result,
boolean useCache)
getMarginBorderPadding
public int getMarginBorderPadding(CssContext cssCtx,
int which)
moveIfGreater
protected void moveIfGreater(Dimension result,
Dimension test)
restyle
public void restyle(LayoutContext c)
restyleChildren
protected void restyleChildren(LayoutContext c)
getRestyleTarget
public Box getRestyleTarget()
getIndex
protected int getIndex()
setIndex
protected void setIndex(int index)
getPseudoElementOrClass
public String getPseudoElementOrClass()
- Specified by:
getPseudoElementOrClass in interface Styleable
setPseudoElementOrClass
public void setPseudoElementOrClass(String pseudoElementOrClass)
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
public PaintingInfo getPaintingInfo()
isAnonymous
public boolean isAnonymous()
setAnonymous
public void setAnonymous(boolean anonymous)
getBoxDimensions
public BoxDimensions getBoxDimensions()
setBoxDimensions
public void setBoxDimensions(BoxDimensions dimensions)
collectText
public void collectText(RenderingContext c,
StringBuffer buffer)
throws IOException
- Throws:
IOException
exportText
public void exportText(RenderingContext c,
Writer writer)
throws IOException
- Throws:
IOException
exportPageBoxText
protected void exportPageBoxText(RenderingContext c,
Writer writer,
int yPos)
throws IOException
- Throws:
IOException
isInDocumentFlow
public boolean isInDocumentFlow()
analyzePageBreaks
public void analyzePageBreaks(LayoutContext c,
ContentLimitContainer container)
getEffBackgroundColor
public FSColor getEffBackgroundColor(RenderingContext c)
isMarginAreaRoot
protected boolean isMarginAreaRoot()
isContainedInMarginBox
public boolean isContainedInMarginBox()
getEffectiveWidth
public int getEffectiveWidth()
Copyright © 2013. All Rights Reserved.