org.pentaho.reporting.engine.classic.core
Class TextElement

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.Element
      extended by org.pentaho.reporting.engine.classic.core.TextElement
All Implemented Interfaces:
Serializable, Cloneable, DataTarget, ReportElement

Deprecated. This class is no longer used and will be removed in the next version.

public class TextElement
extends Element

The base class for all elements that display text in a report band.

All content is converted to String using the String.valueOf () method. To convert values in a more sophisicated way, add filters to this element. Known filters are for instance the NumberFormatFilter or the SimpleDateFormatFilter.

For more information on filters have a look at the filter package org.pentaho.reporting.engine.classic.core.filter

Author:
David Gilbert, Thomas Morgner
See Also:
Serialized Form

Field Summary
static String CONTENT_TYPE
          Deprecated. No longer used.
 
Fields inherited from class org.pentaho.reporting.engine.classic.core.Element
ANONYMOUS_ELEMENT_PREFIX
 
Constructor Summary
TextElement()
          Deprecated. Creates a new empty text element.
 
Method Summary
 Object clone()
          Deprecated. Clones this element.
 Element derive(boolean preserveElementInstanceIds)
          Deprecated. Creates a deep copy of this element and regenerates all instance-ids.
 FontDefinition getFont()
          Deprecated. Retrieve the required font properties directly from the stylesheet.
 String getFontName()
          Deprecated. Returns the name of the current font.
 int getFontSize()
          Deprecated. Returns the font size in points.
 float getLineHeight()
          Deprecated. Returns the lineheight for the element.
 String getNullString()
          Deprecated. Return the null-value representation for this element.
 String getReservedLiteral()
          Deprecated. Returns the reserved literal for this text element.
 Object getValue(ExpressionRuntime runtime)
          Deprecated. Returns the value for this text element.
 boolean isBold()
          Deprecated. Checks whether the font should be displayed in bold style.
 boolean isItalic()
          Deprecated. Checks whether the font should be displayed in italic style.
 boolean isStrikethrough()
          Deprecated. Returns whether the text should have the strikethough style applied.
 boolean isUnderline()
          Deprecated. Returns whether the text should be displayed underlined.
 void setBold(boolean bold)
          Deprecated. Defines, whether the font should be displayed in bold, false otherwise.
 void setFont(FontDefinition font)
          Deprecated. Set the required font properties directly on the stylesheet.
 void setFontName(String fontName)
          Deprecated. Defines the font name of the current font.
 void setFontSize(int fontSize)
          Deprecated. Defines the height of the font in points.
 void setItalic(boolean italic)
          Deprecated. Defines, whether the font should be displayed in italics.
 void setLineHeight(float lineHeight)
          Deprecated. Defines the lineheight for the element.
 void setNullString(String s)
          Deprecated. Defines the null value representation for this element.
 void setReservedLiteral(String reservedLiteral)
          Deprecated. Defines the reserved literal for this text element.
 void setStrikethrough(boolean strikethrough)
          Deprecated. Defines, whether the text should be displayed striked through.
 void setUnderline(boolean underline)
          Deprecated. Defines, whether the text should be displayed with the underline style applied.
 String toString()
          Deprecated. Returns a string representation of this element, useful for debugging purposes.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.Element
derive, getAttribute, getAttributeExpression, getAttributeExpressionNames, getAttributeExpressionNamespaces, getAttributeNames, getAttributeNamespaces, getAttributes, getChangeTracker, getContentBase, getDataSource, getDefinitionSource, getElementType, getElementTypeName, getHRefTarget, getId, getMetaData, getName, getObjectID, getParent, getParentSection, getReportDefinition, getStyle, getStyleExpression, getStyleExpressions, getTreeLock, isDynamicContent, isVisible, notifyNodeChildAdded, notifyNodeChildRemoved, notifyNodePropertiesChanged, notifyNodePropertiesChanged, notifyNodeStructureChanged, setAttribute, setAttribute, setAttributeExpression, setDataSource, setDynamicContent, setElementType, setHRefTarget, setId, setName, setStyleExpression, setVisible
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTENT_TYPE

public static final String CONTENT_TYPE
Deprecated. No longer used.
The content type string.

See Also:
Constant Field Values
Constructor Detail

TextElement

public TextElement()
Deprecated. 
Creates a new empty text element.

Method Detail

getNullString

public String getNullString()
Deprecated. 
Return the null-value representation for this element. This will never return null, although you may feed a null value into the set method of this property.

Returns:
the null value representation for this element.
See Also:
setNullString(String)

setNullString

public void setNullString(String s)
Deprecated. 
Defines the null value representation for this element. If null is given, the value is set to a reasonable value (this implementation sets the value to the string "-").

Parameters:
s - the null string.

getValue

public final Object getValue(ExpressionRuntime runtime)
Deprecated. 
Returns the value for this text element.

Internally, a StringFilter is used to ensure that the final result is an instance of String (even though it is returned as an Object.

Overrides:
getValue in class Element
Parameters:
runtime - the expression runtime for evaluating inline expression.
Returns:
the value for the element.

toString

public String toString()
Deprecated. 
Returns a string representation of this element, useful for debugging purposes.

Overrides:
toString in class Element
Returns:
a string.

clone

public Object clone()
             throws CloneNotSupportedException
Deprecated. 
Clones this element.

Specified by:
clone in interface DataTarget
Overrides:
clone in class Element
Returns:
a clone of this element.
Throws:
CloneNotSupportedException - this should never happen.

derive

public Element derive(boolean preserveElementInstanceIds)
               throws CloneNotSupportedException
Deprecated. 
Description copied from class: Element
Creates a deep copy of this element and regenerates all instance-ids.

Overrides:
derive in class Element
Parameters:
preserveElementInstanceIds - defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.
Returns:
the copy of the element.
Throws:
CloneNotSupportedException

getFontName

public String getFontName()
Deprecated. 
Returns the name of the current font.

Returns:
the font name

setFontName

public void setFontName(String fontName)
Deprecated. 
Defines the font name of the current font.

Parameters:
fontName - the font name

getFontSize

public int getFontSize()
Deprecated. 
Returns the font size in points.

Returns:
the font size.

setFontSize

public void setFontSize(int fontSize)
Deprecated. 
Defines the height of the font in points.

Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
fontSize - the font size in points.

isBold

public boolean isBold()
Deprecated. 
Checks whether the font should be displayed in bold style.

Returns:
true, if the font should be bold, false otherwise.

setBold

public void setBold(boolean bold)
Deprecated. 
Defines, whether the font should be displayed in bold, false otherwise.

Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
bold - true, if the font should be displayed in bold, false otherwise

isItalic

public boolean isItalic()
Deprecated. 
Checks whether the font should be displayed in italic style.

Returns:
true, if the font should be italic, false otherwise.

setItalic

public void setItalic(boolean italic)
Deprecated. 
Defines, whether the font should be displayed in italics.

Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
italic - true, if the font should be in italic style, false otherwise.

isUnderline

public boolean isUnderline()
Deprecated. 
Returns whether the text should be displayed underlined.

Returns:
true, if the fond should be underlined, false otherwise.

setUnderline

public void setUnderline(boolean underline)
Deprecated. 
Defines, whether the text should be displayed with the underline style applied.

Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
underline - true, if the text should be displayed underlined, false otherwise.

isStrikethrough

public boolean isStrikethrough()
Deprecated. 
Returns whether the text should have the strikethough style applied.

Returns:
true, if the font should be striked through, false otherwise.

setStrikethrough

public void setStrikethrough(boolean strikethrough)
Deprecated. 
Defines, whether the text should be displayed striked through.

Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
strikethrough - whether to display the text with strikethrough style applied

getFont

public FontDefinition getFont()
Deprecated. Retrieve the required font properties directly from the stylesheet.

Returns the font definition object assigned with this element. Never null.

Returns:
the font definition for this element.

setFont

public void setFont(FontDefinition font)
Deprecated. Set the required font properties directly on the stylesheet.

Defines all font properties by applying the values from the given font definition object.

Calling this function with either parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
font - the font definition for this element.

getLineHeight

public float getLineHeight()
Deprecated. 
Returns the lineheight for the element. The lineheight can be used to extend the space between two text lines, the effective lineheight will be the maximum of this property and the font height.

Returns:
the defined line height.

setLineHeight

public void setLineHeight(float lineHeight)
Deprecated. 
Defines the lineheight for the element. The lineheight can be used to extend the space between two text lines, the effective lineheight will be the maximum of this property and the font height.

Calling this function with any parameter will override any previously defined value for the layoutcachable attribute. The value can no longer be inherited from parent stylesheets.

Parameters:
lineHeight - the defined line height.

getReservedLiteral

public String getReservedLiteral()
Deprecated. 
Returns the reserved literal for this text element. This literal is appended, whenever the text from tne content does not fully fit into the element's bounds.

Returns:
the reserved literal.

setReservedLiteral

public void setReservedLiteral(String reservedLiteral)
Deprecated. 
Defines the reserved literal for this text element. This literal is appended, whenever the text from tne content does not fully fit into the element's bounds.

Parameters:
reservedLiteral - the reserved literal.