|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.report.function.AbstractFunction
org.jfree.report.demo.helper.FontChangeFunction
This is a function used in report4-demo. The function demonstrates how to alter an elements property during the report generation. The elements font is changed base on the data provided in the reports datasource.
For every new item row in the report, the font for that row is changed to the fontname specified in the second column of the report data source.
Parameters:
The function expects the name of a field in the item band in the parameter "element".
This functions value will always be null.
Field Summary |
Fields inherited from interface org.jfree.report.function.Expression |
AUTOACTIVATE_PROPERTY |
Constructor Summary | |
FontChangeFunction()
DefaultConstructor. |
Method Summary | |
java.lang.String |
getElement()
Returns the name of the element that should get the font set. |
java.lang.Object |
getValue()
Returns the value calculated by this function. |
void |
initialize()
Performs the functions initialisation. |
void |
itemsAdvanced(ReportEvent event)
Before an ItemBand is printed, the report generator will call itemsAdvanced for all functions in the function collection. |
void |
setElement(java.lang.String name)
Defines the name of the text element that gets its font altered. |
Methods inherited from class org.jfree.report.function.AbstractFunction |
clone, getDataRow, getDependencyLevel, getInstance, getName, getProperties, getProperty, getProperty, groupFinished, groupStarted, isActive, itemsFinished, itemsStarted, reportDone, reportFinished, reportInitialized, reportStarted, setDataRow, setDependencyLevel, setName, setProperties, setProperty |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FontChangeFunction()
Method Detail |
public void itemsAdvanced(ReportEvent event)
itemsAdvanced
in interface ReportListener
itemsAdvanced
in class AbstractFunction
event
- the report event.public void initialize() throws FunctionInitializeException
initialize
in interface Expression
initialize
in class AbstractFunction
FunctionInitializeException
- if the element name has not been specified.setElement(java.lang.String)
public void setElement(java.lang.String name)
This functions property is reachable by using the key "element" on getProperty.
name
- the element name.public java.lang.String getElement()
public java.lang.Object getValue()
getValue
in interface Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |