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:
  • Field Details

    • DEFAULT_TRANSPARENCY

      public static final double DEFAULT_TRANSPARENCY
      See Also:
    • 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 Details

    • 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 copy
      factory - factory object to register expressions with
  • Method Details

    • 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 interface JRCloneable
      Overrides:
      clone in class Object