Class RenderNode
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.layout.model.RenderNode
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
FinishedRenderNode
,RenderableComplexText
,RenderableText
,RenderBox
,SpacerRenderNode
public abstract class RenderNode extends Object implements Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RenderNode.CacheState
-
Field Summary
Fields Modifier and Type Field Description static RenderNode.CacheState
CACHE_CLEAN
static RenderNode.CacheState
CACHE_DEEP_DIRTY
static RenderNode.CacheState
CACHE_DIRTY
static int
HORIZONTAL_AXIS
static int
VERTICAL_AXIS
-
Constructor Summary
Constructors Modifier Constructor Description protected
RenderNode(int majorAxis, int minorAxis, StyleSheet styleSheet, InstanceID instanceID, ElementType elementType, ReportAttributeMap<Object> attributes)
protected
RenderNode(NodeLayoutProperties nodeLayoutProperties)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
apply()
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(InstanceID instanceId)
void
freeze()
RenderNode.CacheState
getApplyState()
ReportAttributeMap<Object>
getAttributes()
long
getCachedAge()
long
getCachedHeight()
long
getCachedWidth()
long
getCachedX()
Returns the cached y position.long
getCachedX2()
long
getCachedY()
Returns the cached y position.long
getCachedY2()
RenderNode.CacheState
getCacheState()
long
getChangeTracker()
int
getChildCount()
int
getContentRefCount()
The content-ref-count counts inline-subreports.int
getDescendantCount()
long
getEffectiveMarginBottom()
long
getEffectiveMarginTop()
long
getEffectiveMinimumChunkSize()
ElementType
getElementType()
long
getHeight()
InstanceID
getInstanceId()
int
getLayoutNodeType()
RenderBox
getLayoutParent()
long
getLinebreakAge()
LogicalPageBox
getLogicalPage()
int
getMajorAxis()
long
getMaximumBoxWidth()
long
getMinimumChunkWidth()
int
getMinorAxis()
String
getName()
RenderNode
getNext()
NodeLayoutProperties
getNodeLayoutProperties()
abstract int
getNodeType()
int
getOrphanLeafCount()
long
getOverflowAreaHeight()
long
getOverflowAreaWidth()
RenderBox
getParent()
RenderNode
getPrev()
RenderBox.RestrictFinishClearOut
getRestrictFinishedClearOut()
int
getRowIndex()
ReportStateKey
getStateKey()
StyleSheet
getStyleSheet()
int
getTableRefCount()
long
getValidateModelAge()
VerticalTextAlign
getVerticalTextAlignment()
int
getWidowLeafCount()
long
getWidth()
long
getX()
long
getY()
long
getY2()
boolean
isBoxOverflowX()
boolean
isBoxOverflowY()
boolean
isBoxVisible(long x, long y, long width, long height)
boolean
isBoxVisible(StrictBounds drawArea)
boolean
isBreakAfter()
boolean
isCacheValid()
boolean
isContainsReservedContent()
boolean
isDeepFinishedTable()
boolean
isDiscardable()
boolean
isEmpty()
boolean
isFinishedPaginate()
Checks whether this node can be removed.boolean
isFinishedTable()
protected boolean
isFlag(int flag)
boolean
isFrozen()
boolean
isIgnorableForRendering()
If that method returns true, the element will not be used for rendering.boolean
isLinebreakCacheValid()
boolean
isNodeVisible(long drawAreaX0, long drawAreaY0, long drawAreaWidth, long drawAreaHeight)
boolean
isNodeVisible(long drawAreaX0, long drawAreaY0, long drawAreaWidth, long drawAreaHeight, boolean overflowX, boolean overflowY)
boolean
isNodeVisible(StrictBounds drawArea)
boolean
isNodeVisible(StrictBounds drawArea, boolean overflowX, boolean overflowY)
boolean
isOpen()
boolean
isOrphanLeaf()
static boolean
isParanoidModelChecks()
boolean
isRenderBox()
boolean
isSizeSpecifiesBorderBox()
boolean
isValidateModelCacheValid()
ValidationResult
isValidateModelResult()
boolean
isVirtualNode()
boolean
isVisible()
boolean
isWidowBox()
void
markApplyStateDirty()
protected void
reinit(StyleSheet styleSheet, ElementType elementType, ReportAttributeMap<Object> attributes, InstanceID instanceId)
protected void
resetValidateModelResult()
protected void
setCachedAge(long cachedAge)
void
setCachedHeight(long cachedHeight)
void
setCachedWidth(long cachedWidth)
void
setCachedX(long cachedX)
Defines the cached x position.void
setCachedY(long cachedY)
Defines the cached y position.void
setFinishedPaginate(boolean finished)
void
setFinishedTable(boolean finished)
protected void
setFlag(int flag, boolean value)
void
setHeight(long height)
void
setLinebreakAge(long linebreakAge)
void
setMaximumBoxWidth(long maximumBoxWidth)
protected void
setMinimumChunkWidth(long minimumChunkWidth)
protected void
setNext(RenderNode next)
protected void
setNextUnchecked(RenderNode next)
protected void
setParent(RenderBox parent)
protected void
setPrev(RenderNode prev)
protected void
setPrevUnchecked(RenderNode prev)
void
setValidateModelResult(ValidationResult result)
void
setVirtualNode(boolean virtualNode)
void
setWidowBox(boolean widowBox)
void
setWidth(long width)
void
setX(long x)
void
setY(long y)
void
shift(long amount)
void
shiftCached(long amount)
protected void
updateCacheState(RenderNode.CacheState state)
protected void
updateChangeTracker()
-
-
-
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
-
CACHE_CLEAN
public static final RenderNode.CacheState CACHE_CLEAN
-
CACHE_DIRTY
public static final RenderNode.CacheState CACHE_DIRTY
-
CACHE_DEEP_DIRTY
public static final RenderNode.CacheState CACHE_DEEP_DIRTY
-
-
Constructor Detail
-
RenderNode
protected RenderNode(int majorAxis, int minorAxis, StyleSheet styleSheet, InstanceID instanceID, ElementType elementType, ReportAttributeMap<Object> attributes)
-
RenderNode
protected RenderNode(NodeLayoutProperties nodeLayoutProperties)
-
-
Method Detail
-
isParanoidModelChecks
public static boolean isParanoidModelChecks()
-
reinit
protected void reinit(StyleSheet styleSheet, ElementType elementType, ReportAttributeMap<Object> attributes, InstanceID instanceId)
-
getElementType
public ElementType getElementType()
-
getAttributes
public ReportAttributeMap<Object> getAttributes()
-
getContentRefCount
public int getContentRefCount()
The content-ref-count counts inline-subreports.
-
getTableRefCount
public int getTableRefCount()
-
getDescendantCount
public int getDescendantCount()
-
isSizeSpecifiesBorderBox
public boolean isSizeSpecifiesBorderBox()
-
getNodeType
public abstract int getNodeType()
-
getLayoutNodeType
public int getLayoutNodeType()
-
getMinorAxis
public int getMinorAxis()
-
getMajorAxis
public int getMajorAxis()
-
getNodeLayoutProperties
public final NodeLayoutProperties getNodeLayoutProperties()
-
getX
public final long getX()
-
setX
public final void setX(long x)
-
getY
public final long getY()
-
shift
public void shift(long amount)
-
setY
public void setY(long y)
-
updateCacheState
protected final void updateCacheState(RenderNode.CacheState state)
-
getWidth
public final long getWidth()
-
setWidth
public final void setWidth(long width)
-
getHeight
public final long getHeight()
-
setHeight
public void setHeight(long height)
-
getStyleSheet
public final StyleSheet getStyleSheet()
-
getInstanceId
public InstanceID getInstanceId()
-
updateChangeTracker
protected void updateChangeTracker()
-
getChangeTracker
public final long getChangeTracker()
-
getParent
public final RenderBox getParent()
-
getLayoutParent
public RenderBox getLayoutParent()
-
setParent
protected final void setParent(RenderBox parent)
-
getPrev
public final RenderNode getPrev()
-
setPrevUnchecked
protected final void setPrevUnchecked(RenderNode prev)
-
setPrev
protected final void setPrev(RenderNode prev)
-
getNext
public final RenderNode getNext()
-
setNextUnchecked
protected final void setNextUnchecked(RenderNode next)
-
setNext
protected final void setNext(RenderNode next)
-
getLogicalPage
public LogicalPageBox getLogicalPage()
-
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.
-
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.- Parameters:
deep
-- Returns:
-
deriveFrozen
public RenderNode deriveFrozen(boolean deep)
-
isFrozen
public boolean isFrozen()
-
findNodeById
public RenderNode findNodeById(InstanceID instanceId)
-
isOpen
public boolean isOpen()
-
isEmpty
public boolean isEmpty()
-
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:
-
freeze
public void freeze()
-
getMaximumBoxWidth
public long getMaximumBoxWidth()
-
setMaximumBoxWidth
public void setMaximumBoxWidth(long maximumBoxWidth)
-
getMinimumChunkWidth
public long getMinimumChunkWidth()
-
setMinimumChunkWidth
protected void setMinimumChunkWidth(long minimumChunkWidth)
-
getEffectiveMarginTop
public long getEffectiveMarginTop()
-
getEffectiveMarginBottom
public long getEffectiveMarginBottom()
-
getVerticalTextAlignment
public VerticalTextAlign getVerticalTextAlignment()
-
getName
public String getName()
-
isBreakAfter
public boolean isBreakAfter()
-
getValidateModelAge
public long getValidateModelAge()
-
resetValidateModelResult
protected void resetValidateModelResult()
-
setValidateModelResult
public void setValidateModelResult(ValidationResult result)
-
isValidateModelResult
public ValidationResult isValidateModelResult()
-
getLinebreakAge
public long getLinebreakAge()
-
setLinebreakAge
public void setLinebreakAge(long linebreakAge)
-
getCachedX
public final long getCachedX()
Returns the cached y position. This position is known after all layouting steps have been finished. In most cases the layouter tries to reuse the cached values instead of recomputing everything from scratch on each iteration. The cached positions always specify the border-box. If the user specified sizes as content-box sizes, the layouter converts them into border-box sizes before filling the cache.- Returns:
- the cached x position
-
setCachedX
public void setCachedX(long cachedX)
Defines the cached x position. This position is known after all layouting steps have been finished. In most cases the layouter tries to reuse the cached values instead of recomputing everything from scratch on each iteration. The cached positions always specify the border-box. If the user specified sizes as content-box sizes, the layouter converts them into border-box sizes before filling the cache.- Parameters:
cachedX
- the cached x position
-
getCachedY
public final long getCachedY()
Returns the cached y position. This position is known after all layouting steps have been finished. In most cases the layouter tries to reuse the cached values instead of recomputing everything from scratch on each iteration. The cached positions always specify the border-box. If the user specified sizes as content-box sizes, the layouter converts them into border-box sizes before filling the cache.- Returns:
- the cached y position
-
getCachedY2
public final long getCachedY2()
-
setCachedY
public void setCachedY(long cachedY)
Defines the cached y position. This position is known after all layouting steps have been finished. In most cases the layouter tries to reuse the cached values instead of recomputing everything from scratch on each iteration. The cached positions always specify the border-box. If the user specified sizes as content-box sizes, the layouter converts them into border-box sizes before filling the cache.- Parameters:
cachedY
- the cached y position
-
shiftCached
public void shiftCached(long amount)
-
getCachedWidth
public final long getCachedWidth()
-
getCachedX2
public final long getCachedX2()
-
setCachedWidth
public void setCachedWidth(long cachedWidth)
-
getCachedHeight
public final long getCachedHeight()
-
setCachedHeight
public void setCachedHeight(long cachedHeight)
-
apply
public void apply()
-
isLinebreakCacheValid
public final boolean isLinebreakCacheValid()
-
isValidateModelCacheValid
public final boolean isValidateModelCacheValid()
-
isFinishedPaginate
public boolean isFinishedPaginate()
Checks whether this node can be removed. This flag is used by iterative streaming output targets to mark nodes that have been fully processed.- Returns:
-
setFinishedPaginate
public void setFinishedPaginate(boolean finished)
-
isFinishedTable
public boolean isFinishedTable()
-
setFinishedTable
public void setFinishedTable(boolean finished)
-
isDeepFinishedTable
public boolean isDeepFinishedTable()
-
getCacheState
public RenderNode.CacheState getCacheState()
-
getStateKey
public ReportStateKey getStateKey()
-
isBoxOverflowX
public boolean isBoxOverflowX()
-
isBoxOverflowY
public boolean isBoxOverflowY()
-
isNodeVisible
public final boolean isNodeVisible(StrictBounds drawArea, boolean overflowX, boolean overflowY)
-
isNodeVisible
public final boolean isNodeVisible(StrictBounds drawArea)
-
isNodeVisible
public final boolean isNodeVisible(long drawAreaX0, long drawAreaY0, long drawAreaWidth, long drawAreaHeight)
-
isNodeVisible
public final boolean isNodeVisible(long drawAreaX0, long drawAreaY0, long drawAreaWidth, long drawAreaHeight, boolean overflowX, boolean overflowY)
-
isVirtualNode
public boolean isVirtualNode()
-
setVirtualNode
public void setVirtualNode(boolean virtualNode)
-
setFlag
protected void setFlag(int flag, boolean value)
-
isFlag
protected boolean isFlag(int flag)
-
isBoxVisible
public final boolean isBoxVisible(StrictBounds drawArea)
-
isBoxVisible
public final boolean isBoxVisible(long x, long y, long width, long height)
-
getOverflowAreaHeight
public long getOverflowAreaHeight()
-
getOverflowAreaWidth
public long getOverflowAreaWidth()
-
getEffectiveMinimumChunkSize
public long getEffectiveMinimumChunkSize()
-
getChildCount
public int getChildCount()
-
isWidowBox
public boolean isWidowBox()
-
setWidowBox
public void setWidowBox(boolean widowBox)
-
isOrphanLeaf
public boolean isOrphanLeaf()
-
getRestrictFinishedClearOut
public RenderBox.RestrictFinishClearOut getRestrictFinishedClearOut()
-
getCachedAge
public long getCachedAge()
-
isCacheValid
public boolean isCacheValid()
-
setCachedAge
protected final void setCachedAge(long cachedAge)
-
getY2
public final long getY2()
-
isVisible
public boolean isVisible()
-
isContainsReservedContent
public boolean isContainsReservedContent()
-
markApplyStateDirty
public void markApplyStateDirty()
-
getApplyState
public RenderNode.CacheState getApplyState()
-
getRowIndex
public int getRowIndex()
-
isRenderBox
public boolean isRenderBox()
-
getWidowLeafCount
public int getWidowLeafCount()
-
getOrphanLeafCount
public int getOrphanLeafCount()
-
-