org.jfree.layouting.renderer.model

Class RenderNode

Implemented Interfaces:
Cloneable
Known Direct Subclasses:
FinishedRenderNode, PlaceholderRenderNode, RenderableReplacedContent, RenderableText, RenderBox, SpacerRenderNode

public abstract class RenderNode
extends java.lang.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 int
HORIZONTAL_AXIS
static int
VERTICAL_AXIS

Constructor Summary

RenderNode()

Method Summary

void
appyStyle(LayoutContext context, OutputProcessorMetaData metaData)
Object
clone()
Clones this node.
RenderNode
derive(boolean deep)
Derive creates a disconnected node that shares all the properties of the original node.
RenderNode
deriveFrozen(boolean deep)
RenderNode
findNodeById(Object instanceId)
void
freeze()
CSSValue
getAlignmentAdjust()
RenderLength
getAlignmentAdjustResolved()
CSSValue
getAlignmentBaseline()
CSSValue
getBaselineShift()
RenderLength
getBaselineShiftResolved()
long
getChangeTracker()
ComputedLayoutProperties
getComputedLayoutProperties()
long
getDimension(int axis)
long
getEffectiveMarginBottom()
long
getEffectiveMarginTop()
long
getHeight()
Object
getInstanceId()
LayoutContext
getLayoutContext()
LogicalPageBox
getLogicalPage()
int
getMajorAxis()
long
getMaximumBoxWidth()
long
getMinimumChunkWidth()
int
getMinorAxis()
String
getNamespace()
RenderNode
getNext()
NodeLayoutProperties
getNodeLayoutProperties()
Returns the baseline info for the given node.
NormalFlowRenderBox
getNormalFlow()
PageContext
getPageContext()
RenderBox
getParent()
RenderBox
getParentBlockContext()
long
getPosition(int axis)
RenderNode
getPrev()
long
getStickyMarker()
String
getTagName()
CSSValue
getVerticalAlignment()
RenderNode
getVisibleNext()
RenderNode
getVisiblePrev()
long
getWidth()
long
getX()
long
getY()
RenderNode
hibernate()
Derives an hibernation copy.
boolean
isDirectionLTR()
boolean
isDirty()
boolean
isDiscardable()
boolean
isEmpty()
boolean
isFrozen()
boolean
isHibernated()
boolean
isIcmMetricsFinished()
boolean
isIgnorableForRendering()
If that method returns true, the element will not be used for rendering.
boolean
isOpen()
protected CSSValue
normalizeAlignment(CSSValue verticalAlignment)
void
setComputedLayoutProperties(ComputedLayoutProperties clp)
void
setDimension(int axis, long value)
void
setDirty(boolean dirty)
void
setHeight(long height)
protected void
setHibernated(boolean hibernated)
void
setIcmMetricsFinished(boolean icmMetricsFinished)
protected void
setMajorAxis(int majorAxis)
void
setMaximumBoxWidth(long maximumBoxWidth)
void
setMinimumChunkWidth(long minimumChunkWidth)
protected void
setMinorAxis(int minorAxis)
protected void
setNext(RenderNode next)
protected void
setParent(RenderBox parent)
void
setPosition(int axis, long value)
protected void
setPrev(RenderNode prev)
void
setStickyMarker(long stickyMarker)
void
setWidth(long width)
void
setX(long x)
void
setY(long y)
void
updateChangeTracker()

Field Details

HORIZONTAL_AXIS

public static final int HORIZONTAL_AXIS
Field Value:
0

VERTICAL_AXIS

public static final int VERTICAL_AXIS
Field Value:
1

Constructor Details

RenderNode

public RenderNode()

Method Details

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()