Class JRDesignMeterPlot
- java.lang.Object
-
- net.sf.jasperreports.charts.base.JRBaseChartPlot
-
- net.sf.jasperreports.charts.base.JRBaseMeterPlot
-
- net.sf.jasperreports.charts.design.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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
JRBaseChartPlot.JRBaseSeriesColor
-
Nested classes/interfaces inherited from interface net.sf.jasperreports.charts.JRChartPlot
JRChartPlot.JRSeriesColor
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROPERTY_DATA_RANGE
static String
PROPERTY_INTERVALS
static String
PROPERTY_METER_ANGLE
static String
PROPERTY_METER_BACKGROUND_COLOR
static String
PROPERTY_NEEDLE_COLOR
static String
PROPERTY_SHAPE
static String
PROPERTY_TICK_COLOR
static String
PROPERTY_TICK_COUNT
static String
PROPERTY_TICK_INTERVAL
static String
PROPERTY_TICK_LABEL_FONT
static String
PROPERTY_UNITS
static String
PROPERTY_VALUE_DISPLAY
-
Fields inherited from class net.sf.jasperreports.charts.base.JRBaseMeterPlot
dataRange, intervals, meterAngle, meterBackgroundColor, needleColor, shape, tickColor, tickCount, tickInterval, tickLabelFont, units, valueDisplay
-
Fields inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
backcolor, backgroundAlpha, chart, foregroundAlpha, labelRotation, orientation, PROPERTY_BACKCOLOR, PROPERTY_BACKGROUND_ALPHA, PROPERTY_FOREGROUND_ALPHA, PROPERTY_LABEL_ROTATION, PROPERTY_ORIENTATION, PROPERTY_SERIES_COLORS, seriesColors
-
-
Constructor Summary
Constructors Constructor Description JRDesignMeterPlot(JRChartPlot plot, JRChart chart)
Construct a new meter plot by copying an existing one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(Collection<JRMeterInterval> intervals)
Sets the meter intervals.void
setMeterAngle(Integer meterAngle)
Sets the size of the meter face in degrees.void
setMeterBackgroundColor(Color meterBackgroundColor)
Sets the color to use for the meter face.void
setNeedleColor(Color needleColor)
Sets the color to use for the meter pointer.void
setShape(MeterShapeEnum shape)
Sets the shape of the meter.void
setTickColor(Color tickColor)
Sets the color to use when drawing tick marks on the meter.void
setTickCount(Integer tickCount)
Sets the number of major tick marks on the meter scale.void
setTickInterval(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(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, getMeterAngle, getMeterBackgroundColor, getNeedleColor, getShape, getTickColor, getTickCount, getTickInterval, getTickLabelFont, getUnits, getValueDisplay
-
Methods inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
addSeriesColor, clearSeriesColors, clone, getBackcolor, getBackgroundAlpha, getChart, getEventSupport, getForegroundAlpha, getLabelRotation, getOrientation, getOwnBackcolor, getSeriesColors, getStyleResolver, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, 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.charts.JRChartPlot
addSeriesColor, clearSeriesColors, getBackcolor, getBackgroundAlpha, getChart, getForegroundAlpha, getLabelRotation, getOrientation, getOwnBackcolor, getSeriesColors, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, setOrientation, setSeriesColors
-
Methods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
-
-
-
-
Field Detail
-
PROPERTY_DATA_RANGE
public static final String PROPERTY_DATA_RANGE
- See Also:
- Constant Field Values
-
PROPERTY_METER_ANGLE
public static final String PROPERTY_METER_ANGLE
- See Also:
- Constant Field Values
-
PROPERTY_METER_BACKGROUND_COLOR
public static final String PROPERTY_METER_BACKGROUND_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_NEEDLE_COLOR
public static final String PROPERTY_NEEDLE_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_SHAPE
public static final String PROPERTY_SHAPE
- See Also:
- Constant Field Values
-
PROPERTY_TICK_COLOR
public static final String PROPERTY_TICK_COLOR
- See Also:
- Constant Field Values
-
PROPERTY_TICK_COUNT
public static final String PROPERTY_TICK_COUNT
- See Also:
- Constant Field Values
-
PROPERTY_TICK_INTERVAL
public static final String PROPERTY_TICK_INTERVAL
- See Also:
- Constant Field Values
-
PROPERTY_UNITS
public static final String PROPERTY_UNITS
- See Also:
- Constant Field Values
-
PROPERTY_VALUE_DISPLAY
public static final String PROPERTY_VALUE_DISPLAY
- See Also:
- Constant Field Values
-
PROPERTY_INTERVALS
public static final String PROPERTY_INTERVALS
- See Also:
- Constant Field Values
-
PROPERTY_TICK_LABEL_FONT
public static final 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.- 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:
addInterval(JRMeterInterval)
-
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
-
-