org.jfree.layouting.renderer.model
Class RenderNode

java.lang.Object
  extended by org.jfree.layouting.renderer.model.RenderNode
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
FinishedRenderNode, PlaceholderRenderNode, RenderableReplacedContent, RenderableText, RenderBox, SpacerRenderNode

public abstract class RenderNode
extends java.lang.Object
implements java.lang.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)
           
 java.lang.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(java.lang.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()
           
 java.lang.Object getInstanceId()
           
 LayoutContext getLayoutContext()
           
 LogicalPageBox getLogicalPage()
           
 int getMajorAxis()
           
 long getMaximumBoxWidth()
           
 long getMinimumChunkWidth()
           
 int getMinorAxis()
           
 java.lang.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()
           
 java.lang.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()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL_AXIS

public static final int HORIZONTAL_AXIS
See Also:
Constant Field Values

VERTICAL_AXIS

public static final int VERTICAL_AXIS
See Also:
Constant Field Values
Constructor Detail

RenderNode

public RenderNode()
Method Detail

appyStyle

public void appyStyle(LayoutContext context,
                      OutputProcessorMetaData metaData)

getComputedLayoutProperties

public ComputedLayoutProperties getComputedLayoutProperties()

setComputedLayoutProperties

public void setComputedLayoutProperties(ComputedLayoutProperties clp)

getLayoutContext

public LayoutContext getLayoutContext()

isDirty

public boolean isDirty()

setDirty

public void setDirty(boolean dirty)

getNamespace

public java.lang.String getNamespace()

getTagName

public java.lang.String getTagName()

normalizeAlignment

protected CSSValue normalizeAlignment(CSSValue verticalAlignment)

getVerticalAlignment

public CSSValue getVerticalAlignment()

getBaselineShiftResolved

public RenderLength getBaselineShiftResolved()

getAlignmentBaseline

public CSSValue getAlignmentBaseline()

getBaselineShift

public CSSValue getBaselineShift()

getAlignmentAdjust

public CSSValue getAlignmentAdjust()

getAlignmentAdjustResolved

public RenderLength getAlignmentAdjustResolved()

getPageContext

public PageContext getPageContext()

getInstanceId

public java.lang.Object getInstanceId()

getMajorAxis

public int getMajorAxis()

setMajorAxis

protected void setMajorAxis(int majorAxis)

getMinorAxis

public int getMinorAxis()

setMinorAxis

protected void setMinorAxis(int minorAxis)

setWidth

public void setWidth(long width)

getWidth

public long getWidth()

setHeight

public void setHeight(long height)

getHeight

public long getHeight()

getX

public long getX()

setX

public void setX(long x)

setPosition

public final void setPosition(int axis,
                              long value)

getPosition

public final long getPosition(int axis)

setDimension

public final void setDimension(int axis,
                               long value)

getDimension

public final long getDimension(int axis)

getY

public long getY()

setY

public void setY(long y)

getParent

public RenderBox getParent()

setParent

protected void setParent(RenderBox parent)

getVisiblePrev

public RenderNode getVisiblePrev()

getPrev

public RenderNode getPrev()

setPrev

protected void setPrev(RenderNode prev)

getVisibleNext

public RenderNode getVisibleNext()

getNext

public RenderNode getNext()

setNext

protected void setNext(RenderNode next)

getLogicalPage

public LogicalPageBox getLogicalPage()

getNormalFlow

public NormalFlowRenderBox getNormalFlow()

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 java.lang.Object
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:

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:

deriveFrozen

public RenderNode deriveFrozen(boolean deep)

isFrozen

public boolean isFrozen()

isHibernated

public boolean isHibernated()

setHibernated

protected void setHibernated(boolean hibernated)

findNodeById

public RenderNode findNodeById(java.lang.Object instanceId)

isOpen

public boolean isOpen()

isEmpty

public boolean isEmpty()

getParentBlockContext

public RenderBox getParentBlockContext()

isDiscardable

public boolean isDiscardable()

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:

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:

freeze

public void freeze()

isDirectionLTR

public boolean isDirectionLTR()

updateChangeTracker

public void updateChangeTracker()

getChangeTracker

public long getChangeTracker()

getStickyMarker

public long getStickyMarker()

setStickyMarker

public void setStickyMarker(long stickyMarker)

getEffectiveMarginTop

public long getEffectiveMarginTop()

getEffectiveMarginBottom

public long getEffectiveMarginBottom()

getMaximumBoxWidth

public long getMaximumBoxWidth()

setMaximumBoxWidth

public void setMaximumBoxWidth(long maximumBoxWidth)

getMinimumChunkWidth

public long getMinimumChunkWidth()

setMinimumChunkWidth

public void setMinimumChunkWidth(long minimumChunkWidth)

isIcmMetricsFinished

public boolean isIcmMetricsFinished()

setIcmMetricsFinished

public void setIcmMetricsFinished(boolean icmMetricsFinished)