Package net.sf.jasperreports.charts.util
Class JRMeterInterval
- java.lang.Object
-
- net.sf.jasperreports.charts.util.JRMeterInterval
-
- All Implemented Interfaces:
Serializable
,Cloneable
,JRCloneable
public class JRMeterInterval extends Object implements JRCloneable, Serializable
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Double
alpha
Transparency of the interval's color. 1.0 is fully opaque, 0.0 is fully transparent.protected Color
backgroundColor
Color to use to shade in this region on the meter's face.protected JRDataRange
dataRange
The range of this interval.static double
DEFAULT_TRANSPARENCY
protected String
label
The label of this interval.
-
Constructor Summary
Constructors Constructor Description JRMeterInterval()
Construct an empty interval.JRMeterInterval(JRMeterInterval meterInterval, ChartsBaseObjectFactory factory)
Construct a new interval by copying an existing one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Double
getAlpha()
Returns the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.Color
getBackgroundColor()
Returns the color used to shade this interval.JRDataRange
getDataRange()
Returns the range this interval is for.String
getLabel()
The text describing this range.void
setAlpha(Double alpha)
Sets the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.void
setBackgroundColor(Color backgroundColor)
Specifies the color to use to shade this interval.void
setDataRange(JRDataRange dataRange)
Sets the range for this interval.void
setLabel(String label)
Sets the textual description of this range.
-
-
-
Field Detail
-
DEFAULT_TRANSPARENCY
public static final double DEFAULT_TRANSPARENCY
- See Also:
- Constant Field Values
-
dataRange
protected JRDataRange dataRange
The range of this interval. Must be inside the meter's range.
-
label
protected String label
The label of this interval. Only appears in the meter's legend.
-
backgroundColor
protected Color backgroundColor
Color to use to shade in this region on the meter's face.
-
alpha
protected Double alpha
Transparency of the interval's color. 1.0 is fully opaque, 0.0 is fully transparent.
-
-
Constructor Detail
-
JRMeterInterval
public JRMeterInterval()
Construct an empty interval.
-
JRMeterInterval
public JRMeterInterval(JRMeterInterval meterInterval, ChartsBaseObjectFactory factory)
Construct a new interval by copying an existing one.- Parameters:
meterInterval
- the interval to copyfactory
- factory object to register expressions with
-
-
Method Detail
-
getDataRange
public JRDataRange getDataRange()
Returns the range this interval is for.- Returns:
- the range of this interval
-
setDataRange
public void setDataRange(JRDataRange dataRange)
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
public String getLabel()
The text describing this range. This text only appears in the meter's legend.- Returns:
- the text describing this range
-
setLabel
public void setLabel(String label)
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
public Color getBackgroundColor()
Returns the color used to shade this interval.- Returns:
- the color used to shade this interval
-
setBackgroundColor
public void setBackgroundColor(Color backgroundColor)
Specifies the color to use to shade this interval.- Parameters:
backgroundColor
- the color to use to shade this interval
-
getAlpha
public Double getAlpha()
Returns the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.- Returns:
- the transparency
-
setAlpha
public void setAlpha(Double alpha)
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
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classObject
-
-