|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.Element
org.jfree.report.TextElement
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
Field Summary | |
static java.lang.String |
CONTENT_TYPE
The content type string. |
Fields inherited from class org.jfree.report.Element |
ANONYMOUS_ELEMENT_PREFIX |
Constructor Summary | |
TextElement()
Creates a new empty text element. |
Method Summary | |
java.lang.Object |
clone()
Clones this element. |
java.lang.String |
getContentType()
Returns the content type, in this case ' text/plain '. |
FontDefinition |
getFont()
Returns the font definition object assigned with this element. |
java.lang.String |
getFontName()
Returns the name of the current font. |
int |
getFontSize()
Returns the font size in points. |
float |
getLineHeight()
Returns the lineheight for the element. |
java.lang.String |
getNullString()
Return the null-value representation for this element. |
java.lang.String |
getReservedLiteral()
Returns the reserved literal for this text element. |
java.lang.Object |
getValue()
Returns the value for this text element. |
boolean |
isBold()
Checks, whether the font should be displayed in bold style. |
boolean |
isItalic()
Checks, whether the font should be displayed in italic style. |
boolean |
isStrikethrough()
Returns whether the text should have the strikethough style applied. |
boolean |
isUnderline()
Returns whether the text should be displayed underlined. |
void |
setBold(boolean bold)
Defines, whether the font should be displayed in bold, false otherwise. |
void |
setFont(FontDefinition font)
Defines all font properties by applying the values from the given font definition object. |
void |
setFontName(java.lang.String fontName)
Defines the font name of the current font. |
void |
setFontSize(int fontSize)
Defines the height of the font in points. |
void |
setItalic(boolean italic)
Defines, whether the font should be displayed in italics. |
void |
setLineHeight(float lineHeight)
Defines the lineheight for the element. |
void |
setNullString(java.lang.String s)
Defines the null value representation for this element. |
void |
setReservedLiteral(java.lang.String reservedLiteral)
Defines the reserved literal for this text element. |
void |
setStrikethrough(boolean strikethrough)
Defines, whether the text should be displayed striked through. |
void |
setUnderline(boolean underline)
Defines, whether the text should be displayed with the underline style applied. |
java.lang.String |
toString()
Returns a string representation of this element, useful for debugging purposes. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String CONTENT_TYPE
Constructor Detail |
public TextElement()
Method Detail |
public java.lang.String getNullString()
setNullString(String)
public void setNullString(java.lang.String s)
s
- the null string.public final java.lang.Object getValue()
Internally, a StringFilter
is used to ensure that the final result is an
instance of String (even though it is returned as an Object.
getValue
in class Element
public java.lang.String toString()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface DataTarget
clone
in class Element
java.lang.CloneNotSupportedException
- this should never happen.public java.lang.String getContentType()
text/plain
'.
getContentType
in class Element
public java.lang.String getFontName()
public void setFontName(java.lang.String fontName)
fontName
- the font namepublic int getFontSize()
public void setFontSize(int fontSize)
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.
fontSize
- the font size in points.public boolean isBold()
public void setBold(boolean bold)
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.
bold
- true, if the font should be displayed in bold, false otherwisepublic boolean isItalic()
public void setItalic(boolean italic)
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.
italic
- true, if the font should be in italic style, false otherwise.public boolean isUnderline()
public void setUnderline(boolean underline)
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.
underline
- true, if the text should be displayed underlined, false
otherwise.public boolean isStrikethrough()
public void setStrikethrough(boolean strikethrough)
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.
strikethrough
- whether to display the text with strikethrough style
appliedpublic FontDefinition getFont()
public void setFont(FontDefinition font)
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.
font
- the font definition for this element.public float getLineHeight()
public void setLineHeight(float lineHeight)
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.
lineHeight
- the defined line height.public java.lang.String getReservedLiteral()
public void setReservedLiteral(java.lang.String reservedLiteral)
reservedLiteral
- the reserved literal.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |