org.pentaho.reporting.engine.classic.core.layout.model
Class RenderableText

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.layout.model.RenderNode
      extended by org.pentaho.reporting.engine.classic.core.layout.model.RenderableText
All Implemented Interfaces:
Cloneable

public final class RenderableText
extends RenderNode

The renderable text is a text chunk, enriched with layouting information, such as break opportunities, character sizes, kerning information and spacing information.

Text is given as codepoints. Break opportunities are given as integer values, where zero forbids breaking, and higher values denote better breaks. Spacing and glyph sizes and kerning is given in micro-points; Spacing is the 'added' space between codepoints if text-justification is enabled.

The text is computed as grapheme clusters; this means that several unicode codepoints may result in a single /virtual/ glyph/codepoint/character. (Example: 'A' + accent symbols). If the font supports Lithurges, these lithurges may also be represented as a single grapheme cluster (and thus behave unbreakable).

Grapheme clusters with more than one unicode char have the size of that char added to the first codepoint, all subsequence codepoints of the same cluster have a size/kerning/etc of zero and are unbreakable.

This text chunk is perfectly suitable for horizontal text, going either from left-to-right or right-to-left. (Breaking mixed text is up to the textfactory).

Author:
Thomas Morgner

Field Summary
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.layout.model.RenderNode
CACHE_CLEAN, CACHE_DEEP_DIRTY, CACHE_DIRTY, HORIZONTAL_AXIS, VERTICAL_AXIS
 
Constructor Summary
RenderableText(StyleSheet layoutContext, ElementType elementType, InstanceID instanceID, ReportAttributeMap attributes, ExtendedBaselineInfo baselineInfo, GlyphList glyphs, int offset, int length, int script, boolean forceLinebreak)
           
 
Method Summary
 int computeMaximumTextSize(long contentX2)
           
static long convert(long fontMetricsValue)
           
 ExtendedBaselineInfo getBaselineInfo()
          Returns the baseline info for the given node.
 GlyphList getGlyphs()
           
 int getLength()
           
 long getMinimumWidth()
           
 int getNodeType()
           
 int getOffset()
           
 long getPreferredWidth()
           
 String getRawText()
           
 int getScript()
           
 boolean isDiscardable()
           
 boolean isEmpty()
           
 boolean isForceLinebreak()
           
 boolean isLtr()
           
 boolean isNormalTextSpacing()
           
 String toString()
           
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.layout.model.RenderNode
apply, clone, derive, deriveFrozen, findNodeById, freeze, getAttributes, getCachedAge, getCachedHeight, getCachedParentWidth, getCachedWidth, getCachedX, getCachedY, getCacheState, getChangeTracker, getComputedWidth, getContentRefCount, getEffectiveMarginBottom, getEffectiveMarginTop, getElementType, getHeight, getInstanceId, getLogicalPage, getMajorAxis, getMaximumBoxWidth, getMinimumChunkWidth, getMinorAxis, getName, getNext, getNodeLayoutProperties, getParent, getPrev, getStateKey, getStyleSheet, getVerticalTextAlignment, getWidth, getX, getY, hibernate, isBoxOverflowX, isBoxOverflowY, isBoxVisible, isBoxVisible, isBreakAfter, isCacheValid, isFinishedPaginate, isFinishedTable, isFrozen, isHibernated, isIgnorableForRendering, isNodeVisible, isNodeVisible, isNodeVisible, isNodeVisible, isOpen, isSizeSpecifiesBorderBox, isVirtualNode, markCacheClean, setCachedAge, setCachedHeight, setCachedParentWidth, setCachedWidth, setCachedX, setCachedY, setFinishedPaginate, setFinishedTable, setHeight, setMaximumBoxWidth, setVirtualNode, setWidth, setX, setY, shift, shiftCached
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RenderableText

public RenderableText(StyleSheet layoutContext,
                      ElementType elementType,
                      InstanceID instanceID,
                      ReportAttributeMap attributes,
                      ExtendedBaselineInfo baselineInfo,
                      GlyphList glyphs,
                      int offset,
                      int length,
                      int script,
                      boolean forceLinebreak)
Method Detail

getNodeType

public int getNodeType()
Specified by:
getNodeType in class RenderNode

isNormalTextSpacing

public boolean isNormalTextSpacing()

isForceLinebreak

public boolean isForceLinebreak()

isLtr

public boolean isLtr()

getGlyphs

public GlyphList getGlyphs()

getOffset

public int getOffset()

getLength

public int getLength()

getRawText

public String getRawText()

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class RenderNode

isDiscardable

public boolean isDiscardable()
Overrides:
isDiscardable in class RenderNode

getBaselineInfo

public ExtendedBaselineInfo getBaselineInfo()
Returns the baseline info for the given node. This can be null, if the node does not have any baseline info.

Returns:

getScript

public int getScript()

getMinimumWidth

public long getMinimumWidth()

getPreferredWidth

public long getPreferredWidth()

toString

public String toString()
Overrides:
toString in class Object

convert

public static long convert(long fontMetricsValue)

computeMaximumTextSize

public int computeMaximumTextSize(long contentX2)