Class Box

    • Constructor Detail

      • Box

        protected Box()
    • Method Detail

      • getClipBox

        public Rectangle getClipBox​(RenderingContext c,
                                    Layer layer)
        Gets the combined clip of this box relative to the containing layer. The returned clip is in document coordinate space (not transformed in any way). For example, if we have the following nesting: overflow hidden := transformed box := overflow hidden := overflow hidden := overflow visible this function called on the overflow visible box will return the combined clip of its two immediate ancestors in document coordinate space. It stops at the transformed box because the transform triggers a layer. Currently this method is used for getting the clip to apply to a float, which are nested in layers but taken out of the default block list and therefore clip stack. Since it is only used for floats, the result is not cached. Revisit this decision if using for every box. There are several other clip methods available: + getChildrenClipEdge(CssContext) - gets the local clip for a single box. + getParentClipBox(RenderingContext, Layer) - gets the layer relative clip for the parent box. + getAbsoluteClipBox(CssContext) - gets the absolute clip box in document coordinates
      • getAbsoluteClipBox

        public Area getAbsoluteClipBox​(CssContext c)
        Returns the absolute (ie transformed if needed) clip area for this box. Cached as this will be needed on every box to check if the clip area is inside a page.
      • getWidth

        public int getWidth()
      • addChildForLayout

        public void addChildForLayout​(LayoutContext c,
                                      Box child)
      • addChild

        public void addChild​(Box child)
      • addAllChildren

        public void addAllChildren​(List<Box> 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<Box> getChildIterator()
      • getChildren

        public List<Box> getChildren()
      • getState

        public int getState()
      • setState

        public void setState​(int state)
      • stateToString

        public static String stateToString​(int state)
      • getContainingBlock

        public Box getContainingBlock()
      • setContainingBlock

        public void setContainingBlock​(Box containingBlock)
      • getMarginEdge

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

        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.
      • 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)
      • 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()
      • hasNonTextContent

        public boolean hasNonTextContent​(CssContext c)
      • setAccessiblityObject

        public void setAccessiblityObject​(Object object)
      • getAccessibilityObject

        public Object getAccessibilityObject()
      • paintRootElementBackground

        public void paintRootElementBackground​(RenderingContext c)
      • hasRootElementBackground

        public boolean hasRootElementBackground​(RenderingContext c)
        If the html or body box have a background return true.
      • 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<Box> getElementBoxes​(Element elem)
      • 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)
      • 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()
      • 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)
      • getContainingBlockWidth

        protected int getContainingBlockWidth()
      • resetTopMargin

        protected void resetTopMargin​(CssContext cssContext)
      • calcChildPaintingInfo

        protected void calcChildPaintingInfo​(CssContext c,
                                             PaintingInfo result,
                                             boolean useCache)
      • getMarginBorderPadding

        public int getMarginBorderPadding​(CssContext cssCtx,
                                          int which)
      • restyleChildren

        protected void restyleChildren​(LayoutContext c)
      • getRestyleTarget

        public Box getRestyleTarget()
      • getIndex

        protected int getIndex()
      • setIndex

        protected void setIndex​(int index)
      • 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)
        Uh oh! This refers to content height during layout but total height after layout!
      • getHeight

        public int getHeight()
        Uh oh! This refers to content height during layout but total height after layout!
      • setBorderBoxHeight

        protected void setBorderBoxHeight​(CssContext c,
                                          int h)
      • getBorderBoxHeight

        protected int getBorderBoxHeight​(CssContext c)
      • getBorderBox

        public Rectangle getBorderBox​(CssContext c)
        Only to be called after layout, due to double use of getHeight().
      • setContentWidth

        public void setContentWidth​(int contentWidth)
      • getContentWidth

        public int getContentWidth()
      • getBorderBoxWidth

        public int getBorderBoxWidth​(CssContext c)
      • setBorderBoxWidth

        public void setBorderBoxWidth​(CssContext c,
                                      int borderBoxWidth)
      • isAnonymous

        public boolean isAnonymous()
      • setAnonymous

        public void setAnonymous​(boolean anonymous)
      • setBoxDimensions

        public void setBoxDimensions​(BoxDimensions dimensions)
      • isInDocumentFlow

        public boolean isInDocumentFlow()
      • isMarginAreaRoot

        protected boolean isMarginAreaRoot()
      • isContainedInMarginBox

        public boolean isContainedInMarginBox()
      • getEffectiveWidth

        public int getEffectiveWidth()
      • isInitialContainingBlock

        protected boolean isInitialContainingBlock()
      • isFlowingColumnBox

        public boolean isFlowingColumnBox()