|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
org.pentaho.reporting.engine.classic.core.function.AbstractFunction
org.pentaho.reporting.engine.classic.core.function.AbstractElementFormatFunction
org.pentaho.reporting.engine.classic.core.function.ElementTrafficLightFunction
public class ElementTrafficLightFunction
A function that performs basic traffic lighting based on a range of values and a given set of colors to use. The default colors are for red for values smaller than 50, yellow for values smaller than 75 and green for all values greater than 75. The default behaviour will be applied if no other limits and colors are defined. This function respects absolute values when flagged.
By default the given limits specify the lower boundary of an range. That means a value lower than the first given limit will return the default color, a value lower than the second value will return the first color and so on. That logic can be inversed using the 'useOppositeLogic' flag. In that case the limits specify an upper boundary. If the value read from the datarow is greater than the last limit specified, the default is returned. If the value is greater than the second last limit, the last color is used, and so on.
Constructor Summary | |
---|---|
ElementTrafficLightFunction()
Deprecated. Default constructor. |
Method Summary | |
---|---|
Color[] |
getColor()
Deprecated. Returns all colors defined in this function mapped to their respective position. |
Color |
getColor(int index)
Deprecated. Returns the color at the given index in the list of LightDefinition entries. |
int |
getColorCount()
Deprecated. Returns the number of LightDefinitions defined in this function. |
Color |
getDefaultColor()
Deprecated. Returns the default color that is used if none of the limits applies. |
String |
getField()
Deprecated. Returns the field used by the function. |
Expression |
getInstance()
Deprecated. Return a completly separated copy of this function. |
Number[] |
getLimit()
Deprecated. Returns all numerical limits defined in this function mapped to their respective position. |
Number |
getLimit(int index)
Deprecated. Returns the numerical limit at the given index in the list of LightDefinition entries. |
int |
getLimitCount()
Deprecated. Returns the number of LightDefinitions defined in this function. |
boolean |
isDefineBackground()
Deprecated. Returns whether the computed color is applied to the foreground or background of the element. |
boolean |
isUseAbsoluteValue()
Deprecated. Defines, whether all negative limits should be made positive, by calling 'Math.abs'. |
boolean |
isUseOppositeLogic()
Deprecated. Returns whether limits specify the lower or the upper boundary of a range. |
void |
setColor(Color[] colors)
Deprecated. Updates all colors defined in this function mapped to their respective position. |
void |
setColor(int index,
Color color)
Deprecated. Updates the color at the given index in the list of LightDefinition entries. |
void |
setDefaultColor(Color defaultColor)
Deprecated. Defines the default color that is used if none of the limits applies. |
void |
setDefineBackground(boolean defineBackground)
Deprecated. Defines whether the computed color is applied to the foreground or background of the element. |
void |
setField(String field)
Deprecated. Sets the field name for the function. |
void |
setLimit(int index,
Number value)
Deprecated. Updates the numerical limit at the given index in the list of LightDefinition entries. |
void |
setLimit(Number[] limits)
Deprecated. Updates all numerical limits defined in this function mapped to their respective position. |
void |
setUseAbsoluteValue(boolean useAbsoluteValue)
Deprecated. Defines, whether all negative limits should be made positive, by calling 'Math.abs'. |
void |
setUseOppositeLogic(boolean useOppositeLogic)
Deprecated. Defines whether limits specify the lower or the upper boundary of a range. |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractElementFormatFunction |
---|
getElement, getValue, groupFinished, groupStarted, itemsAdvanced, itemsFinished, itemsStarted, pageFinished, pageStarted, reportFinished, reportInitialized, reportStarted, setElement |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction |
---|
reportDone |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression |
---|
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.pentaho.reporting.engine.classic.core.event.ReportListener |
---|
reportDone |
Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression |
---|
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime |
Constructor Detail |
---|
public ElementTrafficLightFunction()
Method Detail |
---|
public boolean isUseAbsoluteValue()
public void setUseAbsoluteValue(boolean useAbsoluteValue)
useAbsoluteValue
- The useAbsoluteValue to set.public boolean isUseOppositeLogic()
public void setUseOppositeLogic(boolean useOppositeLogic)
useOppositeLogic
- true, if limits specify the upper boundaries, false otherwise.public void setColor(int index, Color color)
index
- the position of the entry that should be updated.color
- the new color.public Color getColor(int index)
index
- the position of the entry that should be queried.
public int getColorCount()
public Color[] getColor()
public void setColor(Color[] colors)
colors
- the colors as array.public void setLimit(int index, Number value)
index
- the position of the entry that should be updated.value
- the new numerical limit.public Number getLimit(int index)
index
- the position of the entry that should be queried.
public int getLimitCount()
public Number[] getLimit()
public void setLimit(Number[] limits)
limits
- the numerical limits as array.public Color getDefaultColor()
public void setDefaultColor(Color defaultColor)
defaultColor
- the default color.public boolean isDefineBackground()
public void setDefineBackground(boolean defineBackground)
defineBackground
- true, if the color is applied as background, false if the color is applied as foreground.public String getField()
public void setField(String field)
field
- the field name.public Expression getInstance()
getInstance
in interface Expression
getInstance
in class AbstractExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |