org.jfree.report.elementfactory
Class TextElementFactory

java.lang.Object
  extended byorg.jfree.report.elementfactory.ElementFactory
      extended byorg.jfree.report.elementfactory.TextElementFactory
Direct Known Subclasses:
LabelElementFactory, ResourceLabelElementFactory, TextFieldElementFactory

public abstract class TextElementFactory
extends ElementFactory

The text element factory is the abstract base class for all text element factory implementations. It provides common properties shared among all text elements.

Author:
Thomas Morgner

Constructor Summary
TextElementFactory()
          Default Constructor.
 
Method Summary
protected  void applyStyle(ElementStyleSheet style)
          Applies the defined element style to the given stylesheet.
 java.lang.Boolean getBold()
          Returns the state of the bold flag for the font.
 java.awt.Color getColor()
          Returns the text color for the new element.
 java.lang.Boolean getEmbedFont()
          Returns the font embedding flag for the new text elements.
 java.lang.String getEncoding()
          Returns the font encoding used to write the text.
 java.lang.String getFontName()
          Returns the name of the font that should be used to print the text.
 java.lang.Integer getFontSize()
          Returns the font size in points.
 ElementAlignment getHorizontalAlignment()
          Returns the horizontal alignment for the content of this text element.
 java.lang.Boolean getItalic()
          Returns the state of the italic flag for the font.
 java.lang.Float getLineHeight()
          Returns the lineheight defined for the text element.
 java.lang.String getReservedLiteral()
          Returns the defined reserved literal, which should be appended to the text to signal text, which was not completly printed.
 java.lang.Boolean getStrikethrough()
          Returns the state of the strike through flag for the font.
 java.lang.Boolean getTrimTextContent()
          Returns, whether the text lines should be trimmed.
 java.lang.Boolean getUnderline()
          Returns the state of the underline flag for the font.
 ElementAlignment getVerticalAlignment()
          Returns the vertical alignment for the content of this text element.
 void setBold(java.lang.Boolean bold)
          Defines the state of the bold flag for the font.
 void setColor(java.awt.Color color)
          Defines the text color for the new element.
 void setEmbedFont(java.lang.Boolean embedFont)
          Defines that the font should be embedded if possible.
 void setEncoding(java.lang.String encoding)
          Defines the font encoding used to write the text.
 void setFontName(java.lang.String fontName)
          Defines the name of the font that should be used to print the text.
 void setFontSize(java.lang.Integer fontSize)
          Returns the font size in points.
 void setHorizontalAlignment(ElementAlignment horizontalAlignment)
          Defines the horizontal alignment for the content of this text element.
 void setItalic(java.lang.Boolean italic)
          Defines the state of the italic flag for the font.
 void setLineHeight(java.lang.Float lineHeight)
          Defines the lineheight defined for the text element.
 void setReservedLiteral(java.lang.String reservedLiteral)
          Defines the defined reserved literal, which should be appended to the text to signal text, which was not completly printed.
 void setStrikethrough(java.lang.Boolean strikethrough)
          Defines the state of the strike through flag for the font.
 void setTrimTextContent(java.lang.Boolean trimTextContent)
          Defines, whether the text lines should be trimmed.
 void setUnderline(java.lang.Boolean underline)
          Defines the state of the underline flag for the font.
 void setVerticalAlignment(ElementAlignment verticalAlignment)
          Defines the vertical alignment for the content of this text element.
 
Methods inherited from class org.jfree.report.elementfactory.ElementFactory
applyElementName, createElement, getAbsolutePosition, getDynamicHeight, getMaximumSize, getMinimumSize, getName, getPreferredSize, setAbsolutePosition, setDynamicHeight, setMaximumSize, setMinimumSize, setName, setPreferredSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextElementFactory

public TextElementFactory()
Default Constructor.

Method Detail

getEmbedFont

public java.lang.Boolean getEmbedFont()
Returns the font embedding flag for the new text elements. Font embedding is only used in some output targets.

Returns:
the font embedding flag.

setEmbedFont

public void setEmbedFont(java.lang.Boolean embedFont)
Defines that the font should be embedded if possible.

Parameters:
embedFont - embedds the font if possible.

getFontName

public java.lang.String getFontName()
Returns the name of the font that should be used to print the text.

Returns:
the font name.

setFontName

public void setFontName(java.lang.String fontName)
Defines the name of the font that should be used to print the text.

Parameters:
fontName - the name of the font.

getBold

public java.lang.Boolean getBold()
Returns the state of the bold flag for the font. This method may return null to indicate that that value should be inherited from the parents.

Returns:
the bold-flag.

setBold

public void setBold(java.lang.Boolean bold)
Defines the state of the bold flag for the font. This value may be set to null to indicate that that value should be inherited from the parents.

Parameters:
bold - the bold-flag.

getItalic

public java.lang.Boolean getItalic()
Returns the state of the italic flag for the font. This method may return null to indicate that that value should be inherited from the parents.

Returns:
the italic-flag.

setItalic

public void setItalic(java.lang.Boolean italic)
Defines the state of the italic flag for the font. This value may be set to null to indicate that that value should be inherited from the parents.

Parameters:
italic - the italic-flag.

getUnderline

public java.lang.Boolean getUnderline()
Returns the state of the underline flag for the font. This method may return null to indicate that that value should be inherited from the parents.

Returns:
the underline-flag.

setUnderline

public void setUnderline(java.lang.Boolean underline)
Defines the state of the underline flag for the font. This value may be set to null to indicate that that value should be inherited from the parents.

Parameters:
underline - the underline-flag.

getStrikethrough

public java.lang.Boolean getStrikethrough()
Returns the state of the strike through flag for the font. This method may return null to indicate that that value should be inherited from the parents.

Returns:
the strike-through-flag.

setStrikethrough

public void setStrikethrough(java.lang.Boolean strikethrough)
Defines the state of the strike through flag for the font. This value may be set to null to indicate that that value should be inherited from the parents.

Parameters:
strikethrough - the strikethrough-flag.

getFontSize

public java.lang.Integer getFontSize()
Returns the font size in points.

Returns:
the font size.

setFontSize

public void setFontSize(java.lang.Integer fontSize)
Returns the font size in points.

Parameters:
fontSize - the font size.

getLineHeight

public java.lang.Float getLineHeight()
Returns the lineheight defined for the text element. The lineheight must be greater than the font size, or this value will be ignored.

Returns:
the line height.

setLineHeight

public void setLineHeight(java.lang.Float lineHeight)
Defines the lineheight defined for the text element. The lineheight must be greater than the font size, or this value will be ignored.

Parameters:
lineHeight - the line height.

getColor

public java.awt.Color getColor()
Returns the text color for the new element.

Returns:
the text color.

setColor

public void setColor(java.awt.Color color)
Defines the text color for the new element.

Parameters:
color - the text color.

getEncoding

public java.lang.String getEncoding()
Returns the font encoding used to write the text. This parameter is only used by some output targets and will be ignored otherwise.

Returns:
the font encoding.

setEncoding

public void setEncoding(java.lang.String encoding)
Defines the font encoding used to write the text. This parameter is only used by some output targets and will be ignored otherwise.

Parameters:
encoding - the font encoding.

getVerticalAlignment

public ElementAlignment getVerticalAlignment()
Returns the vertical alignment for the content of this text element.

Returns:
the vertical alignment.

setVerticalAlignment

public void setVerticalAlignment(ElementAlignment verticalAlignment)
Defines the vertical alignment for the content of this text element.

Parameters:
verticalAlignment - the vertical alignment.

getHorizontalAlignment

public ElementAlignment getHorizontalAlignment()
Returns the horizontal alignment for the content of this text element.

Returns:
the horizontal alignment.

setHorizontalAlignment

public void setHorizontalAlignment(ElementAlignment horizontalAlignment)
Defines the horizontal alignment for the content of this text element.

Parameters:
horizontalAlignment - the vertical alignment.

getReservedLiteral

public java.lang.String getReservedLiteral()
Returns the defined reserved literal, which should be appended to the text to signal text, which was not completly printed.

Returns:
the reserved literal.

setReservedLiteral

public void setReservedLiteral(java.lang.String reservedLiteral)
Defines the defined reserved literal, which should be appended to the text to signal text, which was not completly printed.

Parameters:
reservedLiteral - the reserved literal.

getTrimTextContent

public java.lang.Boolean getTrimTextContent()
Returns, whether the text lines should be trimmed.

Returns:
Boolean.TRUE, if the text should be trimmed, Boolean.FALSE if the text should never be trimmed or null, if the default should be applied.

setTrimTextContent

public void setTrimTextContent(java.lang.Boolean trimTextContent)
Defines, whether the text lines should be trimmed.

Parameters:
trimTextContent - Boolean.TRUE, if the text should be trimmed, Boolean.FALSE if the text should never be trimmed or null, if the default should be applied.

applyStyle

protected void applyStyle(ElementStyleSheet style)
Applies the defined element style to the given stylesheet. This is a helper function to reduce the code size of the implementors.

Overrides:
applyStyle in class ElementFactory
Parameters:
style - the stlyesheet.