Package net.sf.jasperreports.charts.base
Class JRBaseMeterPlot
java.lang.Object
net.sf.jasperreports.charts.base.JRBaseChartPlot
net.sf.jasperreports.charts.base.JRBaseMeterPlot
- All Implemented Interfaces:
Serializable,Cloneable,JRChartPlot,JRMeterPlot,JRChangeEventsSupport,JRCloneable
- Direct Known Subclasses:
JRDesignMeterPlot
An immutable representation of the layout of a Meter chart.
- Author:
- Barry Klawans (bklawans@users.sourceforge.net)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.jasperreports.charts.base.JRBaseChartPlot
JRBaseChartPlot.JRBaseSeriesColorNested classes/interfaces inherited from interface net.sf.jasperreports.charts.JRChartPlot
JRChartPlot.JRSeriesColor -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JRDataRangeThe range displayed by the Meter.protected List<JRMeterInterval> The defined intervals for the Meter.protected IntegerThe extend of the meter face in degrees.protected ColorThe color to use for the face of the meter.protected ColorThe color to use for the pointer on the meter.protected MeterShapeEnumThe shape to use when drawing the Meter.protected ColorThe color to use for each tick on the face of the meter.protected IntegerThe number of major ticks on the meter scale.protected DoubleHow often to draw ticks around the face of the meter.protected JRFontThe font to use when writing tick labels.protected StringOptional description of what the meter is displaying.protected JRValueDisplayFormatting information for the textual display of the value.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
ConstructorsConstructorDescriptionJRBaseMeterPlot(JRChartPlot plot, JRChart chart) Constructs a copy of an existing meter.JRBaseMeterPlot(JRMeterPlot meterPlot, ChartsBaseObjectFactory factory) Constructs a copy of an existing meter and registers all expressions maintained by the meter plot with a factory. -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectExpressions(ChartsExpressionCollector collector) Adds all the expression used by this plot with the specified collector.Returns the range of values that the Meter can display.Returns a list of all the intervals contained in this Meter.Returns the size of the Meter face in degrees.Returns the background color of the meter.Returns the color used when drawing the meter's pointer.getShape()Returns the shape of the Meter.Returns the color used when drawing tick marks on the meter.Returns the number of major ticks on the meter scale.Returns the spacing between the ticks on the face of the meter.Returns the font used to write tick labels on the meter.getUnits()Returns the name of the units that the Meter is displaying.Returns a description of how the value of the Meter is displayed.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, setSeriesColorsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.jasperreports.charts.JRChartPlot
addSeriesColor, clearSeriesColors, getBackcolor, getBackgroundAlpha, getChart, getForegroundAlpha, getLabelRotation, getOrientation, getOwnBackcolor, getSeriesColors, setBackcolor, setBackgroundAlpha, setForegroundAlpha, setLabelRotation, setOrientation, setSeriesColorsMethods inherited from interface net.sf.jasperreports.engine.JRCloneable
clone
-
Field Details
-
dataRange
The range displayed by the Meter. -
valueDisplay
Formatting information for the textual display of the value. -
shape
The shape to use when drawing the Meter. Only applied if the meter is over 180 degrees wide and less than a full circle. -
intervals
The defined intervals for the Meter. Each interval indicates a subsection of the meter and a color to use for that section. -
meterAngle
The extend of the meter face in degrees. It will always be centered around the straight up position. -
units
Optional description of what the meter is displaying. It will be appended to the textual representation of the value. -
tickInterval
How often to draw ticks around the face of the meter. The interval is relative to the meter range - if the meter displays 100 to 200 and the tickInterval is 20, there will be 4 ticks at 120, 140, 160 and 180. -
meterBackgroundColor
The color to use for the face of the meter. -
needleColor
The color to use for the pointer on the meter. -
tickColor
The color to use for each tick on the face of the meter. -
tickCount
The number of major ticks on the meter scale. -
tickLabelFont
The font to use when writing tick labels.
-
-
Constructor Details
-
JRBaseMeterPlot
Constructs a copy of an existing meter.- Parameters:
plot- the plot to copy
-
JRBaseMeterPlot
Constructs a copy of an existing meter and registers all expressions maintained by the meter plot with a factory.- Parameters:
meterPlot- the meter to copyfactory- the factory to register expressions with
-
-
Method Details
-
getDataRange
Description copied from interface:JRMeterPlotReturns the range of values that the Meter can display.- Specified by:
getDataRangein interfaceJRMeterPlot- Returns:
- the range of values that the Meter can display
-
getValueDisplay
Description copied from interface:JRMeterPlotReturns a description of how the value of the Meter is displayed. This includes any font and color information, the location of the value, a formatting mask and an optional "units" string to append to the value.- Specified by:
getValueDisplayin interfaceJRMeterPlot- Returns:
- a description of how the value of the Meter is displayed.
-
getShape
Description copied from interface:JRMeterPlotReturns the shape of the Meter. The shape is only relevant if the Meter face is over 180 degrees wide, and controls how the portion of the circle described by the Meter but outside of the Meter is drawn. (If the meter is 240 degrees wide the shape setting controls how the remaining 120 degrees is displayed.)
The value returned is one of the shape constants defined inMeterShapeEnum.- Specified by:
getShapein interfaceJRMeterPlot- Returns:
- a description of how the value of the Meter is displayed.
-
getIntervals
Description copied from interface:JRMeterPlotReturns a list of all the intervals contained in this Meter. The return value is nevernullbut can be an empty list. Each element in the list is aJRMeterInterval- Specified by:
getIntervalsin interfaceJRMeterPlot- Returns:
- a list of all the intervals contained in this Meter
-
getMeterAngle
Description copied from interface:JRMeterPlotReturns the size of the Meter face in degrees. By default the meter dial is a semicircle.- Specified by:
getMeterAnglein interfaceJRMeterPlot- Returns:
- the size of the Meter face in degrees
-
getUnits
Description copied from interface:JRMeterPlotReturns the name of the units that the Meter is displaying. This value will be appended to the value when displayed.- Specified by:
getUnitsin interfaceJRMeterPlot- Returns:
- the name of the units that the Meter is displaying
-
getTickInterval
Description copied from interface:JRMeterPlotReturns the spacing between the ticks on the face of the meter. The spacing is relative to the range that the meter is displaying - if the range is 0 to 500 and the tick interval is 50 then 10 ticks will be displayed.- Specified by:
getTickIntervalin interfaceJRMeterPlot- Returns:
- the spacing between the ticks on the face of the meter
-
getMeterBackgroundColor
Description copied from interface:JRMeterPlotReturns the background color of the meter. This is the color of the meter's face.- Specified by:
getMeterBackgroundColorin interfaceJRMeterPlot- Returns:
- the background color of the meter.
-
getNeedleColor
Description copied from interface:JRMeterPlotReturns the color used when drawing the meter's pointer.- Specified by:
getNeedleColorin interfaceJRMeterPlot- Returns:
- the color used when drawing the meter's pointer
-
getTickColor
Description copied from interface:JRMeterPlotReturns the color used when drawing tick marks on the meter.- Specified by:
getTickColorin interfaceJRMeterPlot- Returns:
- the color used when drawing tick marks on the meter
-
getTickCount
Description copied from interface:JRMeterPlotReturns the number of major ticks on the meter scale.- Specified by:
getTickCountin interfaceJRMeterPlot- Returns:
- the spacing between the ticks on the face of the meter
-
getTickLabelFont
Description copied from interface:JRMeterPlotReturns the font used to write tick labels on the meter.- Specified by:
getTickLabelFontin interfaceJRMeterPlot- Returns:
- the font used to write tick labels on the meter
-
collectExpressions
Adds all the expression used by this plot with the specified collector. All collected expression that are also registered with a factory will be included with the report is compiled.- Specified by:
collectExpressionsin interfaceJRChartPlot- Parameters:
collector- the expression collector to use
-
clone
- Specified by:
clonein interfaceJRChartPlot- Overrides:
clonein classJRBaseChartPlot
-