| java.lang.Object org.jfree.report.Element org.jfree.report.TextElement
TextElement | public class TextElement extends Element (Code) | | 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.jfree.report.filter author: David Gilbert author: Thomas Morgner |
Constructor Summary | |
public | TextElement() Creates a new empty text element. |
Method Summary | |
public Object | clone() Clones this element. | public String | getContentType() Returns the content type, in this case 'text/plain '. | public FontDefinition | getFont() Returns the font definition object assigned with this element. | public String | getFontName() Returns the name of the current font. | public int | getFontSize() Returns the font size in points. | public float | getLineHeight() Returns the lineheight for the element. | public String | getNullString() Return the null-value representation for this element. | public String | getReservedLiteral() Returns the reserved literal for this text element. | final public Object | getValue(ExpressionRuntime runtime) 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.
Parameters: runtime - the expression runtime for evaluating inline expression. | public boolean | isBold() Checks, whether the font should be displayed in bold style. | public boolean | isItalic() Checks, whether the font should be displayed in italic style. | public boolean | isStrikethrough() Returns whether the text should have the strikethough style applied. | public boolean | isUnderline() Returns whether the text should be displayed underlined. | public void | setBold(boolean bold) 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. | public void | setFont(FontDefinition font) 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. | public void | setFontName(String fontName) Defines the font name of the current font. | public void | setFontSize(int fontSize) Defines the height of the font in points.
Calling this function with either parameter will override any previously defined
value for the layoutcachable attribute. | public void | setItalic(boolean italic) 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. | public void | setLineHeight(float lineHeight) Defines the lineheight for the element. | public void | setNullString(String s) Defines the null value representation for this element. | public void | setReservedLiteral(String reservedLiteral) Defines the reserved literal for this text element. | public void | setStrikethrough(boolean strikethrough) 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. | public void | setUnderline(boolean underline) 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. | public String | toString() Returns a string representation of this element, useful for debugging purposes. |
CONTENT_TYPE | final public static String CONTENT_TYPE(Code) | | The content type string.
|
TextElement | public TextElement()(Code) | | Creates a new empty text element.
|
getContentType | public String getContentType()(Code) | | Returns the content type, in this case 'text/plain '.
the content type. |
getFont | public FontDefinition getFont()(Code) | | Returns the font definition object assigned with this element. Never null.
the font definition for this element. |
getFontName | public String getFontName()(Code) | | Returns the name of the current font.
the font name |
getFontSize | public int getFontSize()(Code) | | Returns the font size in points.
the font size. |
getLineHeight | public float getLineHeight()(Code) | | 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.
the defined line height. |
getNullString | public String getNullString()(Code) | | 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.
the null value representation for this element. See Also: TextElement.setNullString(String) |
getReservedLiteral | public String getReservedLiteral()(Code) | | 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.
the reserved literal. |
getValue | final public Object getValue(ExpressionRuntime runtime)(Code) | | 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.
Parameters: runtime - the expression runtime for evaluating inline expression. the value for the element. |
isBold | public boolean isBold()(Code) | | Checks, whether the font should be displayed in bold style.
true, if the font should be bold, false otherwise. |
isItalic | public boolean isItalic()(Code) | | Checks, whether the font should be displayed in italic style.
true, if the font should be italic, false otherwise. |
isStrikethrough | public boolean isStrikethrough()(Code) | | Returns whether the text should have the strikethough style applied.
true, if the font should be striked through, false otherwise. |
isUnderline | public boolean isUnderline()(Code) | | Returns whether the text should be displayed underlined.
true, if the fond should be underlined, false otherwise. |
setBold | public void setBold(boolean bold)(Code) | | 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 |
setFont | public void setFont(FontDefinition font)(Code) | | 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. |
setFontName | public void setFontName(String fontName)(Code) | | Defines the font name of the current font.
Parameters: fontName - the font name |
setFontSize | public void setFontSize(int fontSize)(Code) | | 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. |
setItalic | public void setItalic(boolean italic)(Code) | | 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. |
setLineHeight | public void setLineHeight(float lineHeight)(Code) | | 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. |
setNullString | public void setNullString(String s)(Code) | | 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. |
setReservedLiteral | public void setReservedLiteral(String reservedLiteral)(Code) | | 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. |
setStrikethrough | public void setStrikethrough(boolean strikethrough)(Code) | | 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 |
setUnderline | public void setUnderline(boolean underline)(Code) | | 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. |
toString | public String toString()(Code) | | Returns a string representation of this element, useful for debugging purposes.
a string. |
Fields inherited from org.jfree.report.Element | final public static String ANONYMOUS_ELEMENT_PREFIX(Code)(Java Doc)
|
|
|