|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.report.function.AbstractFunction | +--com.jrefinery.report.function.ElementColorFunction
A function that alternates between true and false for each item within a group. The functions value affects a defined elements color. If the function evaluates to true, the named element is painted with the elementColorTrue, else the element is painted with elementColorFalse.
Use the property element
to name an element contained in the ItemBand whose
color should be affected by this function. All colors have the color 'black' by default.
Field Summary | |
static java.lang.String |
ELEMENT_PROPERTY
the Property key for the name of the ItemBand element. |
static java.lang.String |
FIELD_PROPERTY
Literal text for the 'field' property. |
Fields inherited from interface com.jrefinery.report.function.Expression |
AUTOACTIVATE_PROPERTY |
Constructor Summary | |
ElementColorFunction()
Default constructor. |
Method Summary | |
java.lang.String |
getElement()
Returns the element name. |
java.awt.Color |
getElementColorFalse()
Returns the color for false values. |
java.awt.Color |
getElementColorTrue()
Returns the color for true values. |
java.lang.String |
getField()
Returns the field used by the function. |
java.lang.Object |
getValue()
Return the current expression value. |
void |
initialize()
Checks that the function has been correctly initialized. |
void |
itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed. |
void |
setElement(java.lang.String name)
Sets the element name. |
void |
setElementColorFalse(java.awt.Color elementColorFalse)
Sets the color for false values. |
void |
setElementColorTrue(java.awt.Color elementColorTrue)
Sets the color for true values. |
void |
setField(java.lang.String field)
Sets the field name for the function. |
Methods inherited from class com.jrefinery.report.function.AbstractFunction |
clone, getDataRow, getDependencyLevel, getInstance, getName, getProperties, getProperty, getProperty, groupFinished, groupStarted, isActive, itemsFinished, itemsStarted, pageFinished, pageStarted, 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 FIELD_PROPERTY
Constructor Detail |
public ElementColorFunction()
Method Detail |
public void setElement(java.lang.String name)
name
- The element name.Band.getElement(String)
public java.lang.String getElement()
public java.lang.String getField()
The field name corresponds to a column name in the report's TableModel.
public void setField(java.lang.String field)
The field name corresponds to a column name in the report's TableModel.
field
- the field name (null not permitted).public void initialize() throws FunctionInitializeException
The only check performed at present is to make sure the name is not null
.
initialize
in interface Expression
initialize
in class AbstractFunction
FunctionInitializeException
- in case the function is not initialized properly.public void setElementColorTrue(java.awt.Color elementColorTrue)
elementColorTrue
- the color.public void setElementColorFalse(java.awt.Color elementColorFalse)
elementColorFalse
- the color.public java.awt.Color getElementColorTrue()
public java.awt.Color getElementColorFalse()
public void itemsAdvanced(ReportEvent event)
itemsAdvanced
in interface ReportListener
itemsAdvanced
in class AbstractFunction
event
- the event.public java.lang.Object getValue()
The value depends (obviously) on the expression implementation.
getValue
in interface Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |