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 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.
|
Range | getDataRange(ValueAxis axis)
Returns the data range.
|
ValueDataset | getDataset()
Returns the primary 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.
|
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 the unit display type (none/Fahrenheit/Celcius/Kelvin).
|
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 the value location.
|
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 with reference to the
bulb.
|
protected void | setAxisRange()
Sets the axis range to the current values in the rangeInfo array. |
void | setDataset(ValueDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there
is one.
|
void | setDisplayRange(int range, double low, double high)
Sets the display 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 | setLowerBound(double lower)
Sets the lower bound for the thermometer.
|
void | setMercuryPaint(Paint paint)
Sets the default mercury paint.
|
void | setPadding(RectangleInsets padding)
Sets the padding for the thermometer.
|
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.
|
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 range.
|
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 range.
|
void | setThermometerPaint(Paint paint)
Sets the paint used to draw the thermometer outline.
|
void | setThermometerStroke(Stroke s)
Sets the stroke used to draw the thermometer outline.
|
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.
|
void | setValueLocation(int location)
Sets the location at which the current value is displayed.
|
void | setValuePaint(Paint p)
Sets the paint used to display the current value.
|
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 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 lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
Zooms the range axes.
|
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.
Parameters: axis the axis.
Returns: The range of data displayed.
Returns: The primary dataset (possibly null
).
Returns: The flag.
Returns: null
.
Returns: The lower bound.
Returns: The maximum value in either the domain or the range
Returns: The paint.
Returns: The minimum value in either the domain or the range.
Returns: The orientation (always VERTICAL).
Returns: The padding.
Returns: A short string describing the type of plot.
Returns: The range axis.
Returns: The flag.
Parameters: range the range.
Returns: The paint.
Returns: The paint.
Returns: The stroke.
Returns: The units type.
Returns: The upper bound.
Returns: The flag.
Returns: The font.
Returns: The location.
Returns: The paint.
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.
The location can be one of the constants:
NONE
,
RIGHT
and
LEFT
.
Parameters: location the location.
Parameters: dataset the dataset (null
permitted).
Parameters: range the range type. low the low value. high the high value.
Parameters: flag the flag.
Parameters: lower the lower bound.
Parameters: paint the new paint.
Parameters: padding the padding.
Parameters: lower the lower bound. upper the upper bound.
Parameters: axis the new axis.
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. paint the paint to be applied.
Parameters: paint the new paint (null ignored).
Parameters: s the new stroke (null ignored).
Use one of the following constants:
Parameters: u the new unit type.
Parameters: u the unit type (null ignored).
Parameters: upper the upper bound.
Parameters: flag The new range colour change option
Parameters: f the new font.
Parameters: formatter the new formatter.
The location can be one of the constants:
NONE
,
RIGHT
LEFT
and
BULB
.
Parameters: location the location.
Parameters: p the new paint.
Parameters: percent the zoom percentage.
Parameters: factor the zoom factor. state the plot state. source the source point.
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: lowerPercent the lower percent. upperPercent the upper percent. state the plot state. source the source point.