org.jfree.chart.plot
public class ThermometerPlot extends Plot implements ValueAxisPlot, Zoomable, Cloneable, Serializable
This plot supports a number of options:
Field Summary | |
---|---|
protected static int | AXIS_GAP The axis gap. |
static int | BULB A constant for the value label position (in the thermometer bulb). |
protected static int | BULB_DIAMETER
The bulb diameter.
|
protected static int | BULB_RADIUS
The bulb radius.
|
protected static int | COLUMN_DIAMETER
The column diameter.
|
protected static int | COLUMN_RADIUS
The column radius.
|
static int | CRITICAL A constant for the 'critical' range. |
protected static int | DEFAULT_BULB_RADIUS
The default bulb radius.
|
protected static int | DEFAULT_COLUMN_RADIUS
The default column radius.
|
protected static int | DEFAULT_GAP
The default gap between the outlines representing the thermometer.
|
protected static double | DEFAULT_LOWER_BOUND The default lower bound. |
protected static double | DEFAULT_UPPER_BOUND The default upper bound. |
protected static int | DISPLAY_HIGH Index for display high value in subrangeInfo matrix. |
protected static int | DISPLAY_LOW Index for display low value in subrangeInfo matrix. |
protected static int | GAP_DIAMETER
The gap diameter.
|
protected static int | GAP_RADIUS
The gap radius.
|
protected static ResourceBundle | localizationResources The resourceBundle for the localization. |
static int | LEFT A constant for the value label position (left of the thermometer). |
static int | NONE A constant for the value label position (no label). |
static int | NORMAL A constant for the 'normal' range. |
protected static int | RANGE_HIGH Index for high value in subrangeInfo matrix. |
protected static int | RANGE_LOW Index for low value in subrangeInfo matrix. |
static int | RIGHT A constant for the value label position (right of the thermometer). |
protected static String[] | UNITS The unit strings. |
static int | UNITS_CELCIUS A constant for unit type 'Celcius'. |
static int | UNITS_FAHRENHEIT A constant for unit type 'Fahrenheit'. |
static int | UNITS_KELVIN A constant for unit type 'Kelvin'. |
static int | UNITS_NONE A constant for unit type 'None'. |
static int | WARNING A constant for the 'warning' range. |
Constructor Summary | |
---|---|
ThermometerPlot()
Creates a new thermometer plot. | |
ThermometerPlot(ValueDataset dataset)
Creates a new thermometer plot, using default attributes where necessary.
|
Method Summary | |
---|---|
Object | clone()
Returns a clone of the plot.
|
void | datasetChanged(DatasetChangeEvent event)
Checks to see if a new value means the axis range needs adjusting.
|
void | draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a
printer).
|
boolean | equals(Object obj)
Tests this plot for equality with another object. |
int | getAxisLocation()
Returns the axis location.
|
int | getBulbDiameter()
Returns the bulb diameter, which is always twice the value returned
by getBulbRadius.
|
int | getBulbRadius()
Returns the bulb radius, in Java2D units. |
int | getColumnDiameter()
Returns the column diameter, which is always twice the value returned
by getColumnRadius.
|
int | getColumnRadius()
Returns the column radius, in Java2D units.
|
Range | getDataRange(ValueAxis axis)
Returns the data range.
|
ValueDataset | getDataset()
Returns the dataset for the plot.
|
boolean | getFollowDataInSubranges()
Returns a flag that controls whether or not the thermometer axis zooms
to display the subrange within which the data value falls.
|
int | getGap()
Returns the gap, in Java2D units, between the two outlines that
represent the thermometer.
|
LegendItemCollection | getLegendItems()
Returns the legend items for the plot.
|
double | getLowerBound()
Returns the lower bound for the thermometer. |
Number | getMaximumVerticalDataValue()
Returns the maximum value in either the domain or the range, whichever
is displayed against the vertical axis for the particular type of plot
implementing this interface.
|
Paint | getMercuryPaint()
Returns the default mercury paint.
|
Number | getMinimumVerticalDataValue()
Returns the minimum value in either the domain or the range, whichever
is displayed against the vertical axis for the particular type of plot
implementing this interface.
|
PlotOrientation | getOrientation()
Returns the orientation of the plot.
|
RectangleInsets | getPadding()
Returns the padding for the thermometer. |
String | getPlotType()
Returns a short string describing the type of plot.
|
ValueAxis | getRangeAxis()
Returns the range axis.
|
boolean | getShowValueLines()
Returns the flag that controls whether not value lines are displayed.
|
Paint | getSubrangePaint(int range)
Gets the paint used for a particular subrange.
|
Paint | getThermometerPaint()
Returns the paint used to draw the thermometer outline.
|
Stroke | getThermometerStroke()
Returns the stroke used to draw the thermometer outline.
|
int | getUnits()
Returns a code indicating the unit display type. |
double | getUpperBound()
Returns the upper bound for the thermometer. |
boolean | getUseSubrangePaint()
Returns a flag that controls whether or not the mercury color changes
for each subrange.
|
Font | getValueFont()
Gets the font used to display the current value.
|
int | getValueLocation()
Returns a code indicating the location at which the value label is
displayed.
|
Paint | getValuePaint()
Gets the paint used to display the current value.
|
boolean | isDomainZoomable()
Returns false .
|
boolean | isRangeZoomable()
Returns true .
|
protected static boolean | isValidNumber(double d)
Determine whether a number is valid and finite.
|
void | setAxisLocation(int location)
Sets the location at which the axis is displayed relative to the
thermometer, and sends a PlotChangeEvent to all registered
listeners.
|
protected void | setAxisRange()
Sets the axis range to the current values in the rangeInfo array. |
void | setBulbRadius(int r)
Sets the bulb radius (in Java2D units) and sends a
PlotChangeEvent to all registered listeners.
|
void | setColumnRadius(int r)
Sets the column radius (in Java2D units) and sends a
PlotChangeEvent to all registered listeners.
|
void | setDataset(ValueDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there
is one, and sends a PlotChangeEvent to all registered listeners.
|
void | setDisplayRange(int range, double low, double high)
Sets the displayed bounds for a sub range.
|
void | setFollowDataInSubranges(boolean flag)
Sets the flag that controls whether or not the thermometer axis zooms
to display the subrange within which the data value falls.
|
void | setGap(int gap)
Sets the gap (in Java2D units) between the two outlines that represent
the thermometer, and sends a PlotChangeEvent to all registered
listeners.
|
void | setLowerBound(double lower)
Sets the lower bound for the thermometer.
|
void | setMercuryPaint(Paint paint)
Sets the default mercury paint and sends a PlotChangeEvent to
all registered listeners.
|
void | setPadding(RectangleInsets padding)
Sets the padding for the thermometer and sends a PlotChangeEvent
to all registered listeners.
|
void | setRange(double lower, double upper)
Sets the lower and upper bounds for the thermometer.
|
void | setRangeAxis(ValueAxis axis)
Sets the range axis for the plot and sends a PlotChangeEvent to
all registered listeners.
|
void | setShowValueLines(boolean b)
Sets the display as to whether to show value lines in the output.
|
void | setSubrange(int range, double low, double high)
Sets the bounds for a subrange.
|
void | setSubrangeInfo(int range, double low, double hi)
Sets information for a particular range.
|
void | setSubrangeInfo(int range, double rangeLow, double rangeHigh, double displayLow, double displayHigh)
Sets the subrangeInfo attribute of the ThermometerPlot object
|
void | setSubrangePaint(int range, Paint paint)
Sets the paint to be used for a subrange and sends a
PlotChangeEvent to all registered listeners.
|
void | setThermometerPaint(Paint paint)
Sets the paint used to draw the thermometer outline and sends a
PlotChangeEvent to all registered listeners.
|
void | setThermometerStroke(Stroke s)
Sets the stroke used to draw the thermometer outline and sends a
PlotChangeEvent to all registered listeners.
|
void | setUnits(int u)
Sets the units to be displayed in the thermometer. |
void | setUnits(String u)
Sets the unit type.
|
void | setUpperBound(double upper)
Sets the upper bound for the thermometer.
|
void | setUseSubrangePaint(boolean flag)
Sets the range colour change option.
|
void | setValueFont(Font f)
Sets the font used to display the current value.
|
void | setValueFormat(NumberFormat formatter)
Sets the formatter for the value label and sends a
PlotChangeEvent to all registered listeners.
|
void | setValueLocation(int location)
Sets the location at which the current value is displayed and sends a
PlotChangeEvent to all registered listeners.
|
void | setValuePaint(Paint paint)
Sets the paint used to display the current value and sends a
PlotChangeEvent to all registered listeners.
|
void | zoom(double percent)
A zoom method that does nothing. |
void | zoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source)
Multiplies the range on the domain axis/axes by the specified factor.
|
void | zoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source, boolean useAnchor)
Multiplies the range on the domain axis/axes by the specified factor.
|
void | zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
This method does nothing.
|
void | zoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source)
Multiplies the range on the range axis/axes by the specified factor.
|
void | zoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source, boolean useAnchor)
Multiplies the range on the range axis/axes by the specified factor.
|
void | zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
Zooms the range axes.
|
Deprecated: As of 1.0.7, use getBulbDiameter.
The bulb diameter.Deprecated: As of 1.0.7, use getBulbRadius.
The bulb radius.Deprecated: As of 1.0.7, use getColumnDiameter.
The column diameter.Deprecated: As of 1.0.7, use getColumnRadius.
The column radius.Since: 1.0.7
Since: 1.0.7
Since: 1.0.7
Deprecated: As of 1.0.7, use getGap times two.
The gap diameter.Deprecated: As of 1.0.7, use getGap.
The gap radius.Parameters: dataset the data set.
Returns: A clone.
Throws: CloneNotSupportedException if the plot cannot be cloned.
Parameters: event the dataset change event.
Parameters: g2 the graphics device. area the area within which the plot should be drawn. anchor the anchor point (null
permitted). parentState the state from the parent plot, if there is one. info collects info about the drawing.
Parameters: obj the object (null
permitted).
Returns: true
or false
.
Returns: The location (one of NONE, LEFT and RIGHT).
See Also: ThermometerPlot
Returns: The bulb diameter.
Since: 1.0.7
Returns: The bulb radius.
Since: 1.0.7
Returns: The column diameter.
Since: 1.0.7
Parameters: axis the axis.
Returns: The range of data displayed.
Returns: The dataset (possibly null
).
See Also: setDataset
Returns: The flag.
Returns: The gap.
Since: 1.0.7
Returns: null
.
Returns: The lower bound.
See Also: ThermometerPlot
Deprecated: This method is not used. Officially deprecated in version 1.0.6.
Returns the maximum value in either the domain or the range, whichever is displayed against the vertical axis for the particular type of plot implementing this interface.Returns: The maximum value in either the domain or the range
Returns: The paint (never null
).
See Also: setMercuryPaint
Deprecated: This method is not used. Officially deprecated in version 1.0.6.
Returns the minimum value in either the domain or the range, whichever is displayed against the vertical axis for the particular type of plot implementing this interface.Returns: The minimum value in either the domain or the range.
Returns: The orientation (always VERTICAL).
Returns: The padding (never null
).
See Also: setPadding
Returns: A short string describing the type of plot.
Returns: The range axis (never null
).
See Also: setRangeAxis
Deprecated: This flag doesn't do anything useful/visible. Deprecated as of version 1.0.6.
Returns the flag that controls whether not value lines are displayed.Returns: The flag.
Parameters: range the range (.
Returns: The paint.
See Also: ThermometerPlot
Returns: The paint (never null
).
See Also: setThermometerPaint getThermometerStroke
Returns: The stroke (never null
).
See Also: setThermometerStroke getThermometerPaint
Returns: The units type.
See Also: ThermometerPlot
Returns: The upper bound.
See Also: ThermometerPlot
Returns: The flag.
See Also: ThermometerPlot
Returns: The font.
See Also: setValueFont
Returns: The paint.
See Also: setValuePaint
false
.
Returns: A boolean.
true
.
Returns: A boolean.
Parameters: d the number to be tested.
Returns: true
if the number is valid and finite, and
false
otherwise.
Parameters: location the location (one of NONE, LEFT and RIGHT).
See Also: getAxisLocation
Parameters: r the new radius (in Java2D units).
Since: 1.0.7
Parameters: r the new radius.
Since: 1.0.7
Parameters: dataset the dataset (null
permitted).
See Also: getDataset
Parameters: range the range type. low the low value. high the high value.
Parameters: flag the flag.
Parameters: gap the new gap.
Since: 1.0.7
Parameters: lower the lower bound.
See Also: getLowerBound
Parameters: paint the new paint (null
not permitted).
See Also: getMercuryPaint
Parameters: padding the padding (null
not permitted).
See Also: getPadding
Parameters: lower the lower bound. upper the upper bound.
Parameters: axis the new axis (null
not permitted).
See Also: getRangeAxis
Deprecated: This flag doesn't do anything useful/visible. Deprecated as of version 1.0.6.
Sets the display as to whether to show value lines in the output.Parameters: b Whether to show value lines in the thermometer
Parameters: range the range type. low the low value. high the high value.
Parameters: range the range to specify information about. low the low value for the range hi the high value for the range
Parameters: range the new rangeInfo value. rangeLow the new rangeInfo value rangeHigh the new rangeInfo value displayLow the new rangeInfo value displayHigh the new rangeInfo value
Parameters: range the range (0, 1 or 2). paint the paint to be applied (null
not permitted).
See Also: ThermometerPlot
Parameters: paint the new paint (null
ignored).
See Also: getThermometerPaint
Parameters: s the new stroke (null
ignored).
See Also: getThermometerStroke
Parameters: u the new unit type.
See Also: getUnits
Deprecated: Use setUnits(int) instead. Deprecated as of version 1.0.6, because this method is a little obscure and redundant anyway.
Sets the unit type.Parameters: u the unit type (null
ignored).
Parameters: upper the upper bound.
See Also: getUpperBound
Parameters: flag the new range colour change option
See Also: getUseSubrangePaint
Parameters: f the new font (null
not permitted).
See Also: getValueFont
Parameters: formatter the new formatter (null
not permitted).
The location can be one of the constants:
NONE
,
RIGHT
LEFT
and
BULB
.
Parameters: location the location.
Parameters: paint the new paint (null
not permitted).
See Also: getValuePaint
Parameters: percent the zoom percentage.
Parameters: factor the zoom factor. state the plot state. source the source point.
Parameters: factor the zoom factor. state the plot state. source the source point. useAnchor a flag that controls whether or not the source point is used for the zoom anchor.
Since: 1.0.7
Parameters: lowerPercent the lower percent. upperPercent the upper percent. state the plot state. source the source point.
Parameters: factor the zoom factor. state the plot state. source the source point.
Parameters: factor the zoom factor. state the plot state. source the source point. useAnchor a flag that controls whether or not the source point is used for the zoom anchor.
Since: 1.0.7
Parameters: lowerPercent the lower percent. upperPercent the upper percent. state the plot state. source the source point.