net.sf.jasperreports.charts.util
Class JRMeterInterval

java.lang.Object
  extended by 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.

Version:
$Id: JRMeterInterval.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Barry Klawans (barry@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  java.lang.Double alphaDouble
          Transparency of the interval's color. 1.0 is fully opaque, 0.0 is fully transparent.
protected  java.awt.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  java.lang.String label
          The label of this interval.
 
Constructor Summary
JRMeterInterval()
          Construct an empty interval.
JRMeterInterval(JRMeterInterval meterInterval, JRBaseObjectFactory factory)
          Construct a new interval by copying an existing one.
 
Method Summary
 java.lang.Object clone()
           
 java.lang.Double getAlphaDouble()
          Returns the transparency of the interval color, with 0.0 being fully transparent and 1.0 being fully opaque.
 java.awt.Color getBackgroundColor()
          Returns the color used to shade this interval.
 JRDataRange getDataRange()
          Returns the range this interval is for.
 java.lang.String getLabel()
          The text describing this range.
 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.
 void setBackgroundColor(java.awt.Color backgroundColor)
          Specifies the color to use to shade this interval.
 void setDataRange(JRDataRange dataRange)
          Sets the range for this interval.
 void setLabel(java.lang.String label)
          Sets the textual description of this range.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 copy
factory - 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:
clone in interface JRCloneable
Overrides:
clone in class java.lang.Object


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com