Class JRDesignMeterPlot

All Implemented Interfaces:
Serializable, Cloneable, JRChartPlot, JRMeterPlot, JRChangeEventsSupport, JRCloneable

public class JRDesignMeterPlot extends JRBaseMeterPlot
A meter plot that displays a single value against a range of values. The range can be further subdivided into multiple color coded regions.
Author:
Barry Klawans (bklawans@users.sourceforge.net)
See Also:
  • Field Details

  • Constructor Details

    • JRDesignMeterPlot

      public JRDesignMeterPlot(JRChartPlot plot, JRChart chart)
      Construct a new meter plot by copying an existing one.
      Parameters:
      plot - the plot to copy
  • Method Details

    • setDataRange

      public void setDataRange(JRDataRange dataRange) throws JRException
      Sets the range of values that the meter can display. Before changing this for an existing meter you should clear any existing intervals to ensure that you don't end up with intervals that are outside of the new range.
      Parameters:
      dataRange - the range of values that the meter can display
      Throws:
      JRException
    • setValueDisplay

      public void setValueDisplay(JRValueDisplay valueDisplay)
      Sets the value display formatting options.
      Parameters:
      valueDisplay - how to show the textual representation of the value
    • setShape

      public void setShape(MeterShapeEnum shape) throws JRException
      Sets the shape of the meter.
      Parameters:
      shape - the shape of the meter
      Throws:
      JRException - invalid shape was specified
    • addInterval

      public void addInterval(JRMeterInterval interval)
      Adds an interval to the meter. An interval is used to indicate a section of the meter.
      Parameters:
      interval - the interval to add to the meter
    • clearIntervals

      public void clearIntervals()
      Removes all the intervals for the meter.
    • setIntervals

      public void setIntervals(Collection<JRMeterInterval> intervals)
      Sets the meter intervals.
      Parameters:
      intervals - the list of meter intervals (JRMeterInterval instances)
      See Also:
    • setMeterAngle

      public void setMeterAngle(Integer meterAngle)
      Sets the size of the meter face in degrees.
      Parameters:
      meterAngle - the size of the meter in degrees
    • setUnits

      public void setUnits(String units)
      Sets the units string to use. This string is appended to the value when it is displayed.
      Parameters:
      units - the units string to use
    • setTickInterval

      public void setTickInterval(Double tickInterval)
      Sets the space between tick marks on the face of the meter. The spacing is relative to the range of the meter. If the meter is displaying the range 100 to 200 and the tick interval is 20, four tick marks will be shown, one each at 120, 140, 160 and 180.
      Parameters:
      tickInterval - the space between tick marks on the meter
    • setMeterBackgroundColor

      public void setMeterBackgroundColor(Color meterBackgroundColor)
      Sets the color to use for the meter face.
      Parameters:
      meterBackgroundColor - the color to use for the meter face
    • setNeedleColor

      public void setNeedleColor(Color needleColor)
      Sets the color to use for the meter pointer.
      Parameters:
      needleColor - the color to use for the meter pointer
    • setTickColor

      public void setTickColor(Color tickColor)
      Sets the color to use when drawing tick marks on the meter.
      Parameters:
      tickColor - the color to use when drawing tick marks
    • setTickCount

      public void setTickCount(Integer tickCount)
      Sets the number of major tick marks on the meter scale.
      Parameters:
      tickCount - the number of major tick marks
    • setTickLabelFont

      public void setTickLabelFont(JRFont tickLabelFont)
      Sets the font to use when displaying the tick label.
      Parameters:
      tickLabelFont - the font to use when displaying the tick label