org.jfree.layouting.renderer.model

Class RenderBox

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

Field Summary
static booleanLOG_PRUNE
Constructor Summary
RenderBox(BoxDefinition boxDefinition)
Method Summary
voidaddChild(RenderNode child)
voidaddChilds(RenderNode[] nodes)
voidaddGeneratedChild(RenderNode child)
voidappyStyle(LayoutContext context, OutputProcessorMetaData metaData)
voidclear()
Removes all children.
Objectclone()
Clones this node.
voidclose()
RenderNodederive(boolean deepDerive)
Derive creates a disconnected node that shares all the properties of the original node.
RenderNodederiveFrozen(boolean deepDerive)
Derive creates a disconnected node that shares all the properties of the original node.
RenderNodefindNodeById(Object instanceId)
voidfreeze()
ExtendedBaselineInfogetBaselineInfo()
BordergetBorder()
BoxDefinitiongetBoxDefinition()
BoxLayoutPropertiesgetBoxLayoutProperties()
longgetContentAreaX1()
longgetContentAreaX2()
CSSValuegetDominantBaseline()
longgetEffectiveMarginBottom()
longgetEffectiveMarginTop()
RenderNodegetFirstChild()
RenderBoxgetInsertationPoint()
RenderNodegetLastChild()
intgetLineCount()
ExtendedBaselineInfogetNominalBaselineInfo()
intgetOrphans()
longgetOrphansSize()
PageContextgetPageContext()
StaticBoxLayoutPropertiesgetStaticBoxLayoutProperties()
RenderNodegetVisibleFirst()
RenderNodegetVisibleLast()
intgetWidows()
longgetWidowsSize()
RenderNodehibernate()
Derive creates a disconnected node that shares all the properties of the original node.
protected voidinsertAfter(RenderNode node, RenderNode target)
Inserts the given target after the specified node.
protected voidinsertBefore(RenderNode node, RenderNode target)
Inserts the given target directly before the the specified node.
booleanisAppendable()
booleanisAvoidPagebreakInside()
booleanisDiscardable()
booleanisEmpty()
booleanisOpen()
booleanisPreserveSpace()
voidremove(RenderNode child)
voidreplaceChild(RenderNode old, RenderNode replacement)
voidreplaceChilds(RenderNode old, RenderNode[] replacement)
voidsetBaselineInfo(ExtendedBaselineInfo baselineInfo)
voidsetContentAreaX1(long contentAreaX1)
voidsetContentAreaX2(long contentAreaX2)
protected voidsetFirstChild(RenderNode firstChild)
protected voidsetLastChild(RenderNode lastChild)
voidsetLineCount(int lineCount)
voidsetOrphansSize(long orphansSize)
voidsetPageContext(PageContext pageContext)
voidsetWidowsSize(long widowsSize)
RenderBoxsplit(int axis)
Performs a simple split.

Field Detail

LOG_PRUNE

public static final boolean LOG_PRUNE

Constructor Detail

RenderBox

public RenderBox(BoxDefinition boxDefinition)

Method Detail

addChild

public void addChild(RenderNode child)

addChilds

public void addChilds(RenderNode[] nodes)

addGeneratedChild

public void addGeneratedChild(RenderNode child)

appyStyle

public void appyStyle(LayoutContext context, OutputProcessorMetaData metaData)

clear

public void clear()
Removes all children.

clone

public 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.

Returns:

close

public void close()

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.

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.

Returns:

findNodeById

public RenderNode findNodeById(Object instanceId)

freeze

public void freeze()

getBaselineInfo

public ExtendedBaselineInfo getBaselineInfo()

getBorder

public Border getBorder()

getBoxDefinition

public BoxDefinition getBoxDefinition()

getBoxLayoutProperties

public BoxLayoutProperties getBoxLayoutProperties()

getContentAreaX1

public long getContentAreaX1()

getContentAreaX2

public long getContentAreaX2()

getDominantBaseline

public CSSValue getDominantBaseline()

getEffectiveMarginBottom

public long getEffectiveMarginBottom()

getEffectiveMarginTop

public long getEffectiveMarginTop()

getFirstChild

public RenderNode getFirstChild()

getInsertationPoint

public RenderBox getInsertationPoint()

getLastChild

public RenderNode getLastChild()

getLineCount

public int getLineCount()

getNominalBaselineInfo

public ExtendedBaselineInfo getNominalBaselineInfo()

getOrphans

public int getOrphans()

getOrphansSize

public long getOrphansSize()

getPageContext

public PageContext getPageContext()

getStaticBoxLayoutProperties

public StaticBoxLayoutProperties getStaticBoxLayoutProperties()

getVisibleFirst

public RenderNode getVisibleFirst()

getVisibleLast

public RenderNode getVisibleLast()

getWidows

public int getWidows()

getWidowsSize

public long getWidowsSize()

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.

Returns:

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

isAppendable

public boolean isAppendable()

isAvoidPagebreakInside

public boolean isAvoidPagebreakInside()

isDiscardable

public boolean isDiscardable()

isEmpty

public boolean isEmpty()

isOpen

public boolean isOpen()

isPreserveSpace

public boolean isPreserveSpace()

remove

public void remove(RenderNode child)

replaceChild

public void replaceChild(RenderNode old, RenderNode replacement)

replaceChilds

public void replaceChilds(RenderNode old, RenderNode[] replacement)

setBaselineInfo

public void setBaselineInfo(ExtendedBaselineInfo baselineInfo)

setContentAreaX1

public void setContentAreaX1(long contentAreaX1)

setContentAreaX2

public void setContentAreaX2(long contentAreaX2)

setFirstChild

protected void setFirstChild(RenderNode firstChild)

setLastChild

protected void setLastChild(RenderNode lastChild)

setLineCount

public void setLineCount(int lineCount)

setOrphansSize

public void setOrphansSize(long orphansSize)

setPageContext

public void setPageContext(PageContext pageContext)

setWidowsSize

public void setWidowsSize(long widowsSize)

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: