Class RenderBox

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    BlockRenderBox, InlineRenderBox, TableColumnGroupNode

    public abstract class RenderBox
    extends RenderNode
    A render-box corresponds to elements in a DOM tree.

    Each box has a size, paddings, margins and borders. Boxes may have one or more childs.

    While all nodes may have a position or dimensions, boxes are special, as they can have borders, margins and paddings. Borders, paddings and margins can have percentages, the margins can additionally be 'auto'.

    The StrictInset variables for these properties contain the resolved values, while the box-definition contain the unresolved values. The resolve values are not valid unless the object has been validated to least least 'LAYOUTING'.

    Author:
    Thomas Morgner
    • Constructor Detail

    • Method Detail

      • getWidowsSize

        public long getWidowsSize()
      • setWidowsSize

        public void setWidowsSize​(long widowsSize)
      • getOrphansSize

        public long getOrphansSize()
      • setOrphansSize

        public void setOrphansSize​(long orphansSize)
      • getLineCount

        public int getLineCount()
      • setLineCount

        public void setLineCount​(int lineCount)
      • getWidows

        public int getWidows()
      • getOrphans

        public int getOrphans()
      • isAvoidPagebreakInside

        public boolean isAvoidPagebreakInside()
      • getDominantBaseline

        public CSSValue getDominantBaseline()
      • isPreserveSpace

        public boolean isPreserveSpace()
      • getFirstChild

        public RenderNode getFirstChild()
      • setFirstChild

        protected void setFirstChild​(RenderNode firstChild)
      • setLastChild

        protected void setLastChild​(RenderNode lastChild)
      • addGeneratedChild

        public void addGeneratedChild​(RenderNode child)
      • addChild

        public void addChild​(RenderNode child)
      • insertAfter

        protected void insertAfter​(RenderNode node,
                                   RenderNode target)
        Inserts the given target after the specified node. If the node is null, the target is inserted as first node.
        Parameters:
        node -
        target -
      • insertBefore

        protected void insertBefore​(RenderNode node,
                                    RenderNode target)
        Inserts the given target directly before the the specified node. If the node is null, the element is inserted at the last position.
        Parameters:
        node -
        target -
      • clone

        public java.lang.Object clone()
        Clones this node. Be aware that cloning can get you into deep trouble, as the relations this node has may no longer be valid.
        Overrides:
        clone in class RenderNode
        Returns:
      • derive

        public RenderNode derive​(boolean deepDerive)
        Derive creates a disconnected node that shares all the properties of the original node. The derived node will no longer have any parent, silbling, child or any other relationships with other nodes.
        Overrides:
        derive in class RenderNode
        Returns:
      • hibernate

        public RenderNode hibernate()
        Derive creates a disconnected node that shares all the properties of the original node. The derived node will no longer have any parent, silbling, child or any other relationships with other nodes.
        Overrides:
        hibernate in class RenderNode
        Returns:
      • deriveFrozen

        public RenderNode deriveFrozen​(boolean deepDerive)
        Derive creates a disconnected node that shares all the properties of the original node. The derived node will no longer have any parent, silbling, child or any other relationships with other nodes.
        Overrides:
        deriveFrozen in class RenderNode
        Returns:
      • addChilds

        public void addChilds​(RenderNode[] nodes)
      • isAppendable

        public boolean isAppendable()
      • getInsertationPoint

        public RenderBox getInsertationPoint()
      • getBorder

        public Border getBorder()
      • clear

        public void clear()
        Removes all children.
      • getVisibleFirst

        public RenderNode getVisibleFirst()
      • getVisibleLast

        public RenderNode getVisibleLast()
      • close

        public void close()
      • remove

        public void remove​(RenderNode child)
      • setPageContext

        public void setPageContext​(PageContext pageContext)
      • getContentAreaX1

        public long getContentAreaX1()
      • setContentAreaX1

        public void setContentAreaX1​(long contentAreaX1)
      • getContentAreaX2

        public long getContentAreaX2()
      • setContentAreaX2

        public void setContentAreaX2​(long contentAreaX2)
      • split

        public RenderBox split​(int axis)
        Performs a simple split. This box will be altered to form the left/top side of the split, and a derived empty box will be returned, which makes up the right/bottom side.

        A split will only happen on inline-boxes during the line-break-step. In the ordinary layouting, splitting is not necesary.

        Parameters:
        axis -
        Returns: