Package net.sf.jasperreports.charts.util
Class JRMeterInterval
java.lang.Object
net.sf.jasperreports.charts.util.JRMeterInterval
- All Implemented Interfaces:
Serializable,Cloneable,JRCloneable
Defines a subsection of a meter chart. This section has its own range,
a label, and can shade a section of the meter face with its own color.
Common usages are to show "critical", "warning" and "good" ranges.
- Author:
- Barry Klawans (barry@users.sourceforge.net)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DoubleTransparency of the interval's color.protected ColorColor to use to shade in this region on the meter's face.protected JRDataRangeThe range of this interval.static final doubleprotected StringThe label of this interval. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty interval.JRMeterInterval(JRMeterInterval meterInterval, ChartsBaseObjectFactory factory) Construct a new interval by copying an existing one. -
Method Summary
Modifier and TypeMethodDescriptionclone()getAlpha()Returns the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.Returns the color used to shade this interval.Returns the range this interval is for.getLabel()The text describing this range.voidSets the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.voidsetBackgroundColor(Color backgroundColor) Specifies the color to use to shade this interval.voidsetDataRange(JRDataRange dataRange) Sets the range for this interval.voidSets the textual description of this range.
-
Field Details
-
DEFAULT_TRANSPARENCY
public static final double DEFAULT_TRANSPARENCY- See Also:
-
dataRange
The range of this interval. Must be inside the meter's range. -
label
The label of this interval. Only appears in the meter's legend. -
backgroundColor
Color to use to shade in this region on the meter's face. -
alpha
Transparency of the interval's color. 1.0 is fully opaque, 0.0 is fully transparent.
-
-
Constructor Details
-
JRMeterInterval
public JRMeterInterval()Construct an empty interval. -
JRMeterInterval
Construct a new interval by copying an existing one.- Parameters:
meterInterval- the interval to copyfactory- factory object to register expressions with
-
-
Method Details
-
getDataRange
Returns the range this interval is for.- Returns:
- the range of this interval
-
setDataRange
Sets the range for this interval. The range must be inside the range of the meter we are going to add the interval to.- Parameters:
dataRange- the range of this interval
-
getLabel
The text describing this range. This text only appears in the meter's legend.- Returns:
- the text describing this range
-
setLabel
Sets the textual description of this range. This text only appears in the meter's legend.- Parameters:
label- the textual description of this range
-
getBackgroundColor
Returns the color used to shade this interval.- Returns:
- the color used to shade this interval
-
setBackgroundColor
Specifies the color to use to shade this interval.- Parameters:
backgroundColor- the color to use to shade this interval
-
getAlpha
Returns the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.- Returns:
- the transparency
-
setAlpha
Sets the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.- Parameters:
alpha- the transparency of the interval color
-
clone
- Specified by:
clonein interfaceJRCloneable- Overrides:
clonein classObject
-