Package net.sf.jasperreports.charts.util
Class JRMeterInterval
- java.lang.Object
-
- net.sf.jasperreports.charts.util.JRMeterInterval
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,JRCloneable
public class JRMeterInterval extends java.lang.Object implements JRCloneable, java.io.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 java.lang.DoublealphaDoubleTransparency of the interval's color.protected java.awt.ColorbackgroundColorColor to use to shade in this region on the meter's face.protected JRDataRangedataRangeThe range of this interval.static doubleDEFAULT_TRANSPARENCYprotected java.lang.StringlabelThe label of this interval.
-
Constructor Summary
Constructors Constructor Description JRMeterInterval()Construct an empty interval.JRMeterInterval(JRMeterInterval meterInterval, JRBaseObjectFactory factory)Construct a new interval by copying an existing one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()java.lang.DoublegetAlphaDouble()Returns the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.java.awt.ColorgetBackgroundColor()Returns the color used to shade this interval.JRDataRangegetDataRange()Returns the range this interval is for.java.lang.StringgetLabel()The text describing this range.voidsetAlpha(java.lang.Double alpha)Sets the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.voidsetBackgroundColor(java.awt.Color backgroundColor)Specifies the color to use to shade this interval.voidsetDataRange(JRDataRange dataRange)Sets the range for this interval.voidsetLabel(java.lang.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 java.lang.String label
The label of this interval. Only appears in the meter's legend.
-
backgroundColor
protected java.awt.Color backgroundColor
Color to use to shade in this region on the meter's face.
-
alphaDouble
protected java.lang.Double alphaDouble
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, JRBaseObjectFactory 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 java.lang.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(java.lang.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 java.awt.Color getBackgroundColor()
Returns the color used to shade this interval.- Returns:
- the color used to shade this interval
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color backgroundColor)
Specifies the color to use to shade this interval.- Parameters:
backgroundColor- the color to use to shade this interval
-
getAlphaDouble
public java.lang.Double getAlphaDouble()
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(java.lang.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 java.lang.Object clone()
- Specified by:
clonein interfaceJRCloneable- Overrides:
clonein classjava.lang.Object
-
-