Ontimize 5.2072EN

com.ontimize.report
Class ElementBooleanSwitchFunction

java.lang.Object
  extended byorg.jfree.report.function.AbstractFunction
      extended bycom.ontimize.report.ElementBooleanSwitchFunction
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, org.jfree.report.function.Expression, org.jfree.report.function.Function, org.jfree.report.event.PageEventListener, org.jfree.report.event.ReportListener, java.io.Serializable

public class ElementBooleanSwitchFunction
extends org.jfree.report.function.AbstractFunction
implements java.io.Serializable, org.jfree.report.event.PageEventListener

See Also:
Serialized Form

Field Summary
static java.lang.String ELEMENT_PROPERTY
          the Property key for the name of the ItemBand element.
static java.lang.String GROUP_PROPERTY
          Literal text for the 'group' property.
static java.lang.String INITIAL_STATE_PROPERTY
          The initial state property key.
static java.lang.String TRIGGER_PROPERTY
           
 
Fields inherited from interface org.jfree.report.function.Expression
AUTOACTIVATE_PROPERTY
 
Constructor Summary
ElementBooleanSwitchFunction()
          Default constructor.
 
Method Summary
 java.lang.String getElement()
          Returns the element name.
 java.lang.String getGroup()
          Returns the group name.
 boolean getInitialTriggerValue()
          Gets the initial value for the visible trigger, either "true" or "false".
 java.lang.String getTrigger()
           
 java.lang.Object getValue()
          Returns the defined visibility of the element.
 void groupStarted(org.jfree.report.event.ReportEvent event)
           
 void initialize()
          Checks that the function has been correctly initialized.
 void itemsAdvanced(org.jfree.report.event.ReportEvent event)
          Triggers the visibility of an element.
 void itemsStarted(org.jfree.report.event.ReportEvent event)
          Receives notification that the items are being processed.
 void pageCanceled(org.jfree.report.event.ReportEvent event)
          Receives notification that a page was canceled by the ReportProcessor.
 void pageFinished(org.jfree.report.event.ReportEvent event)
          Receives notification that a page is completed.
 void pageStarted(org.jfree.report.event.ReportEvent event)
          Receives notification that a page has started.
 void setElement(java.lang.String name)
          Sets the element name.
 void setGroup(java.lang.String name)
          Sets the group name.
 
Methods inherited from class org.jfree.report.function.AbstractFunction
clone, getDataRow, getDependencyLevel, getInstance, getName, getProperties, getProperty, getProperty, groupFinished, 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

ELEMENT_PROPERTY

public static final java.lang.String ELEMENT_PROPERTY
the Property key for the name of the ItemBand element.

See Also:
Constant Field Values

TRIGGER_PROPERTY

public static final java.lang.String TRIGGER_PROPERTY
See Also:
Constant Field Values

GROUP_PROPERTY

public static final java.lang.String GROUP_PROPERTY
Literal text for the 'group' property.

See Also:
Constant Field Values

INITIAL_STATE_PROPERTY

public static final java.lang.String INITIAL_STATE_PROPERTY
The initial state property key.

See Also:
Constant Field Values
Constructor Detail

ElementBooleanSwitchFunction

public ElementBooleanSwitchFunction()
Default constructor.

Method Detail

pageStarted

public void pageStarted(org.jfree.report.event.ReportEvent event)
Receives notification that a page has started.

Specified by:
pageStarted in interface org.jfree.report.event.PageEventListener
Parameters:
event - the event.

groupStarted

public void groupStarted(org.jfree.report.event.ReportEvent event)
Specified by:
groupStarted in interface org.jfree.report.event.ReportListener

getGroup

public java.lang.String getGroup()
Returns the group name.

Returns:
The group name.

setGroup

public void setGroup(java.lang.String name)
Sets the group name.

If a group is defined, the minimum value is reset to zero at the start of every instance of this group.

Parameters:
name - The group name (null permitted).

pageCanceled

public void pageCanceled(org.jfree.report.event.ReportEvent event)
Receives notification that a page was canceled by the ReportProcessor. This method is called, when a page was removed from the report after it was generated.

Specified by:
pageCanceled in interface org.jfree.report.event.PageEventListener
Parameters:
event - The event.

pageFinished

public void pageFinished(org.jfree.report.event.ReportEvent event)
Receives notification that a page is completed.

Specified by:
pageFinished in interface org.jfree.report.event.PageEventListener
Parameters:
event - The event.

itemsStarted

public void itemsStarted(org.jfree.report.event.ReportEvent event)
Receives notification that the items are being processed. Sets the function value to false.

Following this event, there will be a sequence of itemsAdvanced events until the itemsFinished event is raised.

Specified by:
itemsStarted in interface org.jfree.report.event.ReportListener
Parameters:
event - Information about the event.

itemsAdvanced

public void itemsAdvanced(org.jfree.report.event.ReportEvent event)
Triggers the visibility of an element. If the named element was visible at the last itemsAdvanced call, it gets now invisible and vice versa. This creates the effect, that an element is printed every other line.

Specified by:
itemsAdvanced in interface org.jfree.report.event.ReportListener
Parameters:
event - the report event.

initialize

public void initialize()
                throws org.jfree.report.function.FunctionInitializeException
Checks that the function has been correctly initialized. The functions name or the elements name have not been set, and FunctionInitializeException is thrown.

Specified by:
initialize in interface org.jfree.report.function.Expression
Throws:
org.jfree.report.function.FunctionInitializeException - if required parameters were missing and initialisation cannot be performed.

getInitialTriggerValue

public boolean getInitialTriggerValue()
Gets the initial value for the visible trigger, either "true" or "false".

Returns:
the initial value for the trigger.

setElement

public void setElement(java.lang.String name)
Sets the element name. The name denotes an element within the item band. The element will be retrieved using the getElement(String) function.

Parameters:
name - The element name.
See Also:
Band.getElement(String)

getElement

public java.lang.String getElement()
Returns the element name.

Returns:
The element name.

getTrigger

public java.lang.String getTrigger()

getValue

public java.lang.Object getValue()
Returns the defined visibility of the element. Returns either true or false as java.lang.Boolean.

Specified by:
getValue in interface org.jfree.report.function.Expression
Returns:
the visibility of the element, either Boolean.TRUE or Boolean.FALSE.

Ontimize