net.sf.jasperreports.charts.design
Class JRDesignMeterPlot

java.lang.Object
  extended by net.sf.jasperreports.engine.base.JRBaseChartPlot
      extended by net.sf.jasperreports.charts.base.JRBaseMeterPlot
          extended by net.sf.jasperreports.charts.design.JRDesignMeterPlot
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, JRMeterPlot, JRChangeEventsSupport, JRChartPlot, 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.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jasperreports.engine.base.JRBaseChartPlot
JRBaseChartPlot.JRBaseSeriesColor
 
Nested classes/interfaces inherited from interface net.sf.jasperreports.engine.JRChartPlot
JRChartPlot.JRSeriesColor
 
Field Summary
static java.lang.String PROPERTY_DATA_RANGE
           
static java.lang.String PROPERTY_INTERVALS
           
static java.lang.String PROPERTY_METER_ANGLE
           
static java.lang.String PROPERTY_METER_BACKGROUND_COLOR
           
static java.lang.String PROPERTY_NEEDLE_COLOR
           
static java.lang.String PROPERTY_SHAPE
           
static java.lang.String PROPERTY_TICK_COLOR
           
static java.lang.String PROPERTY_TICK_COUNT
           
static java.lang.String PROPERTY_TICK_INTERVAL
           
static java.lang.String PROPERTY_TICK_LABEL_FONT
           
static java.lang.String PROPERTY_UNITS
           
static java.lang.String PROPERTY_VALUE_DISPLAY
           
 
Fields inherited from class net.sf.jasperreports.charts.base.JRBaseMeterPlot
dataRange, intervals, meterAngleInteger, meterBackgroundColor, needleColor, shapeValue, tickColor, tickCount, tickIntervalDouble, tickLabelFont, units, valueDisplay
 
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseChartPlot
backcolor, backgroundAlphaFloat, chart, foregroundAlphaFloat, labelRotationDouble, orientationValue, PROPERTY_BACKCOLOR, PROPERTY_BACKGROUND_ALPHA, PROPERTY_FOREGROUND_ALPHA, PROPERTY_LABEL_ROTATION, PROPERTY_ORIENTATION, PROPERTY_SERIES_COLORS, seriesColors
 
Constructor Summary
JRDesignMeterPlot(JRChartPlot plot, JRChart chart)
          Construct a new meter plot by copying an existing one.
 
Method Summary
 void addInterval(JRMeterInterval interval)
          Adds an interval to the meter.
 void clearIntervals()
          Removes all the intervals for the meter.
 void setDataRange(JRDataRange dataRange)
          Sets the range of values that the meter can display.
 void setIntervals(java.util.Collection<JRMeterInterval> intervals)
          Sets the meter intervals.
 void setMeterAngle(java.lang.Integer meterAngle)
          Sets the size of the meter face in degrees.
 void setMeterBackgroundColor(java.awt.Color meterBackgroundColor)
          Sets the color to use for the meter face.
 void setNeedleColor(java.awt.Color needleColor)
          Sets the color to use for the meter pointer.
 void setShape(MeterShapeEnum shape)
          Sets the shape of the meter.
 void setTickColor(java.awt.Color tickColor)
          Sets the color to use when drawing tick marks on the meter.
 void setTickCount(java.lang.Integer tickCount)
          Sets the number of major tick marks on the meter scale.
 void setTickInterval(java.lang.Double tickInterval)
          Sets the space between tick marks on the face of the meter.
 void setTickLabelFont(JRFont tickLabelFont)
          Sets the font to use when displaying the tick label.
 void setUnits(java.lang.String units)
          Sets the units string to use.
 void setValueDisplay(JRValueDisplay valueDisplay)
          Sets the value display formatting options.
 
Methods inherited from class net.sf.jasperreports.charts.base.JRBaseMeterPlot
clone, collectExpressions, getDataRange, getIntervals, getMeterAngleInteger, getMeterBackgroundColor, getNeedleColor, getShapeValue, getTickColor, getTickCount, getTickIntervalDouble, getTickLabelFont, getUnits, getValueDisplay
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseChartPlot
addSeriesColor, clearSeriesColors, clone, getBackcolor, getBackgroundAlphaFloat, getChart, getEventSupport, getForegroundAlphaFloat, getLabelRotationDouble, getOrientation, getOrientationValue, getOwnBackcolor, getSeriesColors, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, setOrientation, setOrientation, setSeriesColors
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jasperreports.engine.JRChartPlot
addSeriesColor, clearSeriesColors, getBackcolor, getBackgroundAlphaFloat, getChart, getForegroundAlphaFloat, getLabelRotationDouble, getOrientation, getOrientationValue, getOwnBackcolor, getSeriesColors, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, setOrientation, setOrientation, setSeriesColors
 
Methods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
 

Field Detail

PROPERTY_DATA_RANGE

public static final java.lang.String PROPERTY_DATA_RANGE
See Also:
Constant Field Values

PROPERTY_METER_ANGLE

public static final java.lang.String PROPERTY_METER_ANGLE
See Also:
Constant Field Values

PROPERTY_METER_BACKGROUND_COLOR

public static final java.lang.String PROPERTY_METER_BACKGROUND_COLOR
See Also:
Constant Field Values

PROPERTY_NEEDLE_COLOR

public static final java.lang.String PROPERTY_NEEDLE_COLOR
See Also:
Constant Field Values

PROPERTY_SHAPE

public static final java.lang.String PROPERTY_SHAPE
See Also:
Constant Field Values

PROPERTY_TICK_COLOR

public static final java.lang.String PROPERTY_TICK_COLOR
See Also:
Constant Field Values

PROPERTY_TICK_COUNT

public static final java.lang.String PROPERTY_TICK_COUNT
See Also:
Constant Field Values

PROPERTY_TICK_INTERVAL

public static final java.lang.String PROPERTY_TICK_INTERVAL
See Also:
Constant Field Values

PROPERTY_UNITS

public static final java.lang.String PROPERTY_UNITS
See Also:
Constant Field Values

PROPERTY_VALUE_DISPLAY

public static final java.lang.String PROPERTY_VALUE_DISPLAY
See Also:
Constant Field Values

PROPERTY_INTERVALS

public static final java.lang.String PROPERTY_INTERVALS
See Also:
Constant Field Values

PROPERTY_TICK_LABEL_FONT

public static final java.lang.String PROPERTY_TICK_LABEL_FONT
See Also:
Constant Field Values
Constructor Detail

JRDesignMeterPlot

public JRDesignMeterPlot(JRChartPlot plot,
                         JRChart chart)
Construct a new meter plot by copying an existing one.

Parameters:
plot - the plot to copy
Method Detail

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. Must be one of MeterShapeEnum.CHORD, MeterShapeEnum.CIRCLE, MeterShapeEnum.PIE or MeterShapeEnum.DIAL.

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(java.util.Collection<JRMeterInterval> intervals)
Sets the meter intervals.

Parameters:
intervals - the list of meter intervals (JRMeterInterval instances)
See Also:
addInterval(JRMeterInterval)

setMeterAngle

public void setMeterAngle(java.lang.Integer meterAngle)
Sets the size of the meter face in degrees.

Parameters:
meterAngle - the size of the meter in degrees

setUnits

public void setUnits(java.lang.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(java.lang.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(java.awt.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(java.awt.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(java.awt.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(java.lang.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


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com