org.jfree.layouting.renderer.model

Class RenderNode

public abstract class RenderNode extends Object implements Cloneable

A node of the rendering model. The renderer model keeps track of the rendering state - what has already been rendered, what is pending, etc. Things that have been rendered completely get removed from the model.

The default model makes some assumptions about the node processing:

Finished nodes can be removed as soon as they have been physically rendered.

In case a node cannot be rendered right now (think of tables, which need all cells before a row or in some cases even the columns can be computed), a cell receives the 'pending' flag. If a cell is added to a parent which is pending, the cell is pending as well. The pending state must be resolved by the outer-most element. An element cannot be finished or removed unless it resolved the pending state.

Author: Thomas Morgner

Field Summary
static intHORIZONTAL_AXIS
static intVERTICAL_AXIS
Constructor Summary
RenderNode()
Method Summary
voidappyStyle(LayoutContext context, OutputProcessorMetaData metaData)
Objectclone()
Clones this node.
RenderNodederive(boolean deep)
Derive creates a disconnected node that shares all the properties of the original node.
RenderNodederiveFrozen(boolean deep)
RenderNodefindNodeById(Object instanceId)
voidfreeze()
CSSValuegetAlignmentAdjust()
RenderLengthgetAlignmentAdjustResolved()
CSSValuegetAlignmentBaseline()
CSSValuegetBaselineShift()
RenderLengthgetBaselineShiftResolved()
longgetChangeTracker()
ComputedLayoutPropertiesgetComputedLayoutProperties()
longgetDimension(int axis)
longgetEffectiveMarginBottom()
longgetEffectiveMarginTop()
longgetHeight()
ObjectgetInstanceId()
LayoutContextgetLayoutContext()
LogicalPageBoxgetLogicalPage()
intgetMajorAxis()
longgetMaximumBoxWidth()
longgetMinimumChunkWidth()
intgetMinorAxis()
StringgetNamespace()
RenderNodegetNext()
NodeLayoutPropertiesgetNodeLayoutProperties()
Returns the baseline info for the given node.
NormalFlowRenderBoxgetNormalFlow()
PageContextgetPageContext()
RenderBoxgetParent()
RenderBoxgetParentBlockContext()
longgetPosition(int axis)
RenderNodegetPrev()
longgetStickyMarker()
StringgetTagName()
CSSValuegetVerticalAlignment()
RenderNodegetVisibleNext()
RenderNodegetVisiblePrev()
longgetWidth()
longgetX()
longgetY()
RenderNodehibernate()
Derives an hibernation copy.
booleanisDirectionLTR()
booleanisDirty()
booleanisDiscardable()
booleanisEmpty()
booleanisFrozen()
booleanisHibernated()
booleanisIcmMetricsFinished()
booleanisIgnorableForRendering()
If that method returns true, the element will not be used for rendering.
booleanisOpen()
protected CSSValuenormalizeAlignment(CSSValue verticalAlignment)
voidsetComputedLayoutProperties(ComputedLayoutProperties clp)
voidsetDimension(int axis, long value)
voidsetDirty(boolean dirty)
voidsetHeight(long height)
protected voidsetHibernated(boolean hibernated)
voidsetIcmMetricsFinished(boolean icmMetricsFinished)
protected voidsetMajorAxis(int majorAxis)
voidsetMaximumBoxWidth(long maximumBoxWidth)
voidsetMinimumChunkWidth(long minimumChunkWidth)
protected voidsetMinorAxis(int minorAxis)
protected voidsetNext(RenderNode next)
protected voidsetParent(RenderBox parent)
voidsetPosition(int axis, long value)
protected voidsetPrev(RenderNode prev)
voidsetStickyMarker(long stickyMarker)
voidsetWidth(long width)
voidsetX(long x)
voidsetY(long y)
voidupdateChangeTracker()

Field Detail

HORIZONTAL_AXIS

public static final int HORIZONTAL_AXIS

VERTICAL_AXIS

public static final int VERTICAL_AXIS

Constructor Detail

RenderNode

public RenderNode()

Method Detail

appyStyle

public void appyStyle(LayoutContext context, OutputProcessorMetaData metaData)

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:

derive

public RenderNode derive(boolean deep)
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 deep)

findNodeById

public RenderNode findNodeById(Object instanceId)

freeze

public void freeze()

getAlignmentAdjust

public CSSValue getAlignmentAdjust()

getAlignmentAdjustResolved

public RenderLength getAlignmentAdjustResolved()

getAlignmentBaseline

public CSSValue getAlignmentBaseline()

getBaselineShift

public CSSValue getBaselineShift()

getBaselineShiftResolved

public RenderLength getBaselineShiftResolved()

getChangeTracker

public long getChangeTracker()

getComputedLayoutProperties

public ComputedLayoutProperties getComputedLayoutProperties()

getDimension

public final long getDimension(int axis)

getEffectiveMarginBottom

public long getEffectiveMarginBottom()

getEffectiveMarginTop

public long getEffectiveMarginTop()

getHeight

public long getHeight()

getInstanceId

public Object getInstanceId()

getLayoutContext

public LayoutContext getLayoutContext()

getLogicalPage

public LogicalPageBox getLogicalPage()

getMajorAxis

public int getMajorAxis()

getMaximumBoxWidth

public long getMaximumBoxWidth()

getMinimumChunkWidth

public long getMinimumChunkWidth()

getMinorAxis

public int getMinorAxis()

getNamespace

public String getNamespace()

getNext

public RenderNode getNext()

getNodeLayoutProperties

public NodeLayoutProperties getNodeLayoutProperties()
Returns the baseline info for the given node. This can be null, if the node does not have any baseline info at all. If the element has more than one set of baselines, the baseline of the first element is returned.

Returns:

getNormalFlow

public NormalFlowRenderBox getNormalFlow()

getPageContext

public PageContext getPageContext()

getParent

public RenderBox getParent()

getParentBlockContext

public RenderBox getParentBlockContext()

getPosition

public final long getPosition(int axis)

getPrev

public RenderNode getPrev()

getStickyMarker

public long getStickyMarker()

getTagName

public String getTagName()

getVerticalAlignment

public CSSValue getVerticalAlignment()

getVisibleNext

public RenderNode getVisibleNext()

getVisiblePrev

public RenderNode getVisiblePrev()

getWidth

public long getWidth()

getX

public long getX()

getY

public long getY()

hibernate

public RenderNode hibernate()
Derives an hibernation copy. The resulting object should get stripped of all unnecessary caching information and all objects, which will be regenerated when the layouting restarts. Size does matter here.

Returns:

isDirectionLTR

public boolean isDirectionLTR()

isDirty

public boolean isDirty()

isDiscardable

public boolean isDiscardable()

isEmpty

public boolean isEmpty()

isFrozen

public boolean isFrozen()

isHibernated

public boolean isHibernated()

isIcmMetricsFinished

public boolean isIcmMetricsFinished()

isIgnorableForRendering

public boolean isIgnorableForRendering()
If that method returns true, the element will not be used for rendering. For the purpose of computing sizes or performing the layouting (in the validate() step), this element will treated as if it is not there.

If the element reports itself as non-empty, however, it will affect the margin computation.

Returns:

isOpen

public boolean isOpen()

normalizeAlignment

protected CSSValue normalizeAlignment(CSSValue verticalAlignment)

setComputedLayoutProperties

public void setComputedLayoutProperties(ComputedLayoutProperties clp)

setDimension

public final void setDimension(int axis, long value)

setDirty

public void setDirty(boolean dirty)

setHeight

public void setHeight(long height)

setHibernated

protected void setHibernated(boolean hibernated)

setIcmMetricsFinished

public void setIcmMetricsFinished(boolean icmMetricsFinished)

setMajorAxis

protected void setMajorAxis(int majorAxis)

setMaximumBoxWidth

public void setMaximumBoxWidth(long maximumBoxWidth)

setMinimumChunkWidth

public void setMinimumChunkWidth(long minimumChunkWidth)

setMinorAxis

protected void setMinorAxis(int minorAxis)

setNext

protected void setNext(RenderNode next)

setParent

protected void setParent(RenderBox parent)

setPosition

public final void setPosition(int axis, long value)

setPrev

protected void setPrev(RenderNode prev)

setStickyMarker

public void setStickyMarker(long stickyMarker)

setWidth

public void setWidth(long width)

setX

public void setX(long x)

setY

public void setY(long y)

updateChangeTracker

public void updateChangeTracker()