|
||||||||||
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.function.ElementVisibilitySwitchFunction
A function that alternates between true and false for each item within a group. The functions value affects a defined elements visibility. If the function evaluates to true, the named element is visible, else the element is invisible.
Elements in JFreeReport do not define their own background color attribute. To create a background, you would place a rectangle shape element behind the element.
The ElementVisibilitySwitchFunction is used to trigger the visibility of an named element. If the element is your background, you will get the alternating effect.
The ElementVisibilitySwitchFunction defines two parameters:
The name of the element in the itemband that should be modified. The element must be named using the "name" attribute, only the first occurence of that named element will be modfied.
The initial state of the function. (true or false) defaults to false. This is the revers of the element's visiblity (set to false to start with an visible element, set to true to hide the element in the first itemrow).
Field Summary | |
static java.lang.String |
ELEMENT_PROPERTY
the Property key for the name of the ItemBand element. |
static java.lang.String |
INITIAL_STATE_PROPERTY
The initial state property key. |
Fields inherited from interface org.jfree.report.function.Expression |
AUTOACTIVATE_PROPERTY |
Constructor Summary | |
ElementVisibilitySwitchFunction()
Default constructor. |
Method Summary | |
java.lang.String |
getElement()
Returns the element name. |
boolean |
getInitialTriggerValue()
Gets the initial value for the visible trigger, either "true" or "false". |
java.lang.Object |
getValue()
Returns the defined visibility of the element. |
void |
initialize()
Checks that the function has been correctly initialized. |
void |
itemsAdvanced(ReportEvent event)
Triggers the visibility of an element. |
void |
itemsStarted(ReportEvent event)
Receives notification that the items are being processed. |
void |
pageCanceled(ReportEvent event)
Receives notification that a page was canceled by the ReportProcessor. |
void |
pageFinished(ReportEvent event)
Receives notification that a page is completed. |
void |
pageStarted(ReportEvent event)
Receives notification that a page has started. |
void |
setElement(java.lang.String name)
Sets the element name. |
Methods inherited from class org.jfree.report.function.AbstractFunction |
clone, getDataRow, getDependencyLevel, getInstance, getName, getProperties, getProperty, getProperty, groupFinished, groupStarted, isActive, itemsFinished, 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 |
Field Detail |
public static final java.lang.String ELEMENT_PROPERTY
public static final java.lang.String INITIAL_STATE_PROPERTY
Constructor Detail |
public ElementVisibilitySwitchFunction()
Method Detail |
public void pageStarted(ReportEvent event)
pageStarted
in interface PageEventListener
event
- the event.public void pageCanceled(ReportEvent event)
pageCanceled
in interface PageEventListener
event
- The event.public void pageFinished(ReportEvent event)
pageFinished
in interface PageEventListener
event
- The event.public void itemsStarted(ReportEvent event)
Following this event, there will be a sequence of itemsAdvanced events until the itemsFinished event is raised.
itemsStarted
in interface ReportListener
itemsStarted
in class AbstractFunction
event
- Information about the event.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 required parameters were missing and initialisation
cannot be performed.public boolean getInitialTriggerValue()
public void setElement(java.lang.String name)
name
- The element name.Band.getElement(String)
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 |