Class RenderBox
- java.lang.Object
-
- org.jfree.layouting.renderer.model.RenderNode
-
- org.jfree.layouting.renderer.model.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
-
-
Field Summary
Fields Modifier and Type Field Description static booleanLOG_PRUNE-
Fields inherited from class org.jfree.layouting.renderer.model.RenderNode
HORIZONTAL_AXIS, VERTICAL_AXIS
-
-
Constructor Summary
Constructors Constructor Description RenderBox(BoxDefinition boxDefinition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(RenderNode child)voidaddChilds(RenderNode[] nodes)voidaddGeneratedChild(RenderNode child)voidappyStyle(LayoutContext context, OutputProcessorMetaData metaData)voidclear()Removes all children.java.lang.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(java.lang.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.-
Methods inherited from class org.jfree.layouting.renderer.model.RenderNode
getAlignmentAdjust, getAlignmentAdjustResolved, getAlignmentBaseline, getBaselineShift, getBaselineShiftResolved, getChangeTracker, getComputedLayoutProperties, getDimension, getHeight, getInstanceId, getLayoutContext, getLogicalPage, getMajorAxis, getMaximumBoxWidth, getMinimumChunkWidth, getMinorAxis, getNamespace, getNext, getNodeLayoutProperties, getNormalFlow, getParent, getParentBlockContext, getPosition, getPrev, getStickyMarker, getTagName, getVerticalAlignment, getVisibleNext, getVisiblePrev, getWidth, getX, getY, isDirectionLTR, isDirty, isFrozen, isHibernated, isIcmMetricsFinished, isIgnorableForRendering, normalizeAlignment, setComputedLayoutProperties, setDimension, setDirty, setHeight, setHibernated, setIcmMetricsFinished, setMajorAxis, setMaximumBoxWidth, setMinimumChunkWidth, setMinorAxis, setNext, setParent, setPosition, setPrev, setStickyMarker, setWidth, setX, setY, updateChangeTracker
-
-
-
-
Field Detail
-
LOG_PRUNE
public static final boolean LOG_PRUNE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RenderBox
public RenderBox(BoxDefinition boxDefinition)
-
-
Method Detail
-
getStaticBoxLayoutProperties
public StaticBoxLayoutProperties getStaticBoxLayoutProperties()
-
appyStyle
public void appyStyle(LayoutContext context, OutputProcessorMetaData metaData)
- Overrides:
appyStylein classRenderNode
-
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()
-
getBaselineInfo
public ExtendedBaselineInfo getBaselineInfo()
-
setBaselineInfo
public void setBaselineInfo(ExtendedBaselineInfo baselineInfo)
-
getNominalBaselineInfo
public ExtendedBaselineInfo getNominalBaselineInfo()
-
getDominantBaseline
public CSSValue getDominantBaseline()
-
isPreserveSpace
public boolean isPreserveSpace()
-
getBoxDefinition
public BoxDefinition getBoxDefinition()
-
getFirstChild
public RenderNode getFirstChild()
-
setFirstChild
protected void setFirstChild(RenderNode firstChild)
-
getLastChild
public RenderNode getLastChild()
-
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-
-
replaceChild
public void replaceChild(RenderNode old, RenderNode replacement)
-
replaceChilds
public void replaceChilds(RenderNode old, RenderNode[] replacement)
-
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:
clonein classRenderNode- 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:
derivein classRenderNode- 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:
hibernatein classRenderNode- 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:
deriveFrozenin classRenderNode- Returns:
-
addChilds
public void addChilds(RenderNode[] nodes)
-
findNodeById
public RenderNode findNodeById(java.lang.Object instanceId)
- Overrides:
findNodeByIdin classRenderNode
-
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()
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmptyin classRenderNode
-
isDiscardable
public boolean isDiscardable()
- Overrides:
isDiscardablein classRenderNode
-
close
public void close()
-
remove
public void remove(RenderNode child)
-
isOpen
public boolean isOpen()
- Overrides:
isOpenin classRenderNode
-
getPageContext
public PageContext getPageContext()
- Overrides:
getPageContextin classRenderNode
-
setPageContext
public void setPageContext(PageContext pageContext)
-
freeze
public void freeze()
- Overrides:
freezein classRenderNode
-
getBoxLayoutProperties
public BoxLayoutProperties getBoxLayoutProperties()
-
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:
-
getEffectiveMarginTop
public long getEffectiveMarginTop()
- Overrides:
getEffectiveMarginTopin classRenderNode
-
getEffectiveMarginBottom
public long getEffectiveMarginBottom()
- Overrides:
getEffectiveMarginBottomin classRenderNode
-
-