org.jfree.chart.plot

Class ThermometerPlot

Implemented Interfaces:
Cloneable, EventListener, Serializable, AxisChangeListener, DatasetChangeListener, LegendItemSource, MarkerChangeListener, PublicCloneable, Serializable, ValueAxisPlot, Zoomable

public class ThermometerPlot
extends Plot
implements ValueAxisPlot, Zoomable, Cloneable, Serializable

A plot that displays a single value (from a ValueDataset) in a thermometer type display.

This plot supports a number of options:

  1. three sub-ranges which could be viewed as 'Normal', 'Warning' and 'Critical' ranges.
  2. the thermometer can be run in two modes:
    • fixed range, or
    • range adjusts to current sub-range.
    • settable units to be displayed.
    • settable display location for the value text.

    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
    Deprecated. As of 1.0.7, use getBulbDiameter().
    protected static int
    BULB_RADIUS
    Deprecated. As of 1.0.7, use getBulbRadius().
    protected static int
    COLUMN_DIAMETER
    Deprecated. As of 1.0.7, use getColumnDiameter().
    protected static int
    COLUMN_RADIUS
    Deprecated. As of 1.0.7, use getColumnRadius().
    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
    Deprecated. As of 1.0.7, use getGap() times two.
    protected static int
    GAP_RADIUS
    Deprecated. As of 1.0.7, use getGap().
    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.
    protected static ResourceBundle
    localizationResources
    The resourceBundle for the localization.

    Fields inherited from class org.jfree.chart.plot.Plot

    DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_LEGEND_ITEM_BOX, DEFAULT_LEGEND_ITEM_CIRCLE, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO

    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()
    Deprecated. This method is not used.
    Paint
    getMercuryPaint()
    Returns the default mercury paint.
    Number
    getMinimumVerticalDataValue()
    Deprecated. This method is not used.
    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()
    Deprecated. This flag doesn't do anything useful/visible.
    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)
    Deprecated. This flag doesn't do anything useful/visible.
    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(String u)
    Deprecated. Use setUnits(int) instead.
    void
    setUnits(int u)
    Sets the units to be displayed in the thermometer.
    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 lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
    This method 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
    zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)
    Zooms the range axes.
    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.

    Methods inherited from class org.jfree.chart.plot.Plot

    addChangeListener, axisChanged, clone, datasetChanged, draw, drawBackground, drawBackgroundImage, drawNoDataMessage, drawOutline, equals, fillBackground, fillBackground, fireChangeEvent, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getLegendItems, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getPlotType, getRectX, getRectY, getRootPlot, handleClick, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setDatasetGroup, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent, zoom

    Field Details

    AXIS_GAP

    protected static final int AXIS_GAP
    The axis gap.
    Field Value:
    10

    BULB

    public static final int BULB
    A constant for the value label position (in the thermometer bulb).
    Field Value:
    3

    BULB_DIAMETER

    protected static final int BULB_DIAMETER

    Deprecated. As of 1.0.7, use getBulbDiameter().

    The bulb diameter.
    Field Value:
    80

    BULB_RADIUS

    protected static final int BULB_RADIUS

    Deprecated. As of 1.0.7, use getBulbRadius().

    The bulb radius.
    Field Value:
    40

    COLUMN_DIAMETER

    protected static final int COLUMN_DIAMETER

    Deprecated. As of 1.0.7, use getColumnDiameter().

    The column diameter.
    Field Value:
    40

    COLUMN_RADIUS

    protected static final int COLUMN_RADIUS

    Deprecated. As of 1.0.7, use getColumnRadius().

    The column radius.
    Field Value:
    20

    CRITICAL

    public static final int CRITICAL
    A constant for the 'critical' range.
    Field Value:
    2

    DEFAULT_BULB_RADIUS

    protected static final int DEFAULT_BULB_RADIUS
    The default bulb radius.
    Field Value:
    40
    Since:
    1.0.7

    DEFAULT_COLUMN_RADIUS

    protected static final int DEFAULT_COLUMN_RADIUS
    The default column radius.
    Field Value:
    20
    Since:
    1.0.7

    DEFAULT_GAP

    protected static final int DEFAULT_GAP
    The default gap between the outlines representing the thermometer.
    Field Value:
    5
    Since:
    1.0.7

    DEFAULT_LOWER_BOUND

    protected static final double DEFAULT_LOWER_BOUND
    The default lower bound.
    Field Value:
    0.0

    DEFAULT_UPPER_BOUND

    protected static final double DEFAULT_UPPER_BOUND
    The default upper bound.
    Field Value:
    100.0

    DISPLAY_HIGH

    protected static final int DISPLAY_HIGH
    Index for display high value in subrangeInfo matrix.
    Field Value:
    3

    DISPLAY_LOW

    protected static final int DISPLAY_LOW
    Index for display low value in subrangeInfo matrix.
    Field Value:
    2

    GAP_DIAMETER

    protected static final int GAP_DIAMETER

    Deprecated. As of 1.0.7, use getGap() times two.

    The gap diameter.
    Field Value:
    10

    GAP_RADIUS

    protected static final int GAP_RADIUS

    Deprecated. As of 1.0.7, use getGap().

    The gap radius.
    Field Value:
    5

    LEFT

    public static final int LEFT
    A constant for the value label position (left of the thermometer).
    Field Value:
    2

    NONE

    public static final int NONE
    A constant for the value label position (no label).
    Field Value:
    0

    NORMAL

    public static final int NORMAL
    A constant for the 'normal' range.
    Field Value:
    0

    RANGE_HIGH

    protected static final int RANGE_HIGH
    Index for high value in subrangeInfo matrix.
    Field Value:
    1

    RANGE_LOW

    protected static final int RANGE_LOW
    Index for low value in subrangeInfo matrix.
    Field Value:
    0

    RIGHT

    public static final int RIGHT
    A constant for the value label position (right of the thermometer).
    Field Value:
    1

    UNITS

    protected static final String[] UNITS
    The unit strings.

    UNITS_CELCIUS

    public static final int UNITS_CELCIUS
    A constant for unit type 'Celcius'.
    Field Value:
    2

    UNITS_FAHRENHEIT

    public static final int UNITS_FAHRENHEIT
    A constant for unit type 'Fahrenheit'.
    Field Value:
    1

    UNITS_KELVIN

    public static final int UNITS_KELVIN
    A constant for unit type 'Kelvin'.
    Field Value:
    3

    UNITS_NONE

    public static final int UNITS_NONE
    A constant for unit type 'None'.
    Field Value:
    0

    WARNING

    public static final int WARNING
    A constant for the 'warning' range.
    Field Value:
    1

    localizationResources

    protected static ResourceBundle localizationResources
    The resourceBundle for the localization.

    Constructor Details

    ThermometerPlot

    public ThermometerPlot()
    Creates a new thermometer plot.

    ThermometerPlot

    public ThermometerPlot(ValueDataset dataset)
    Creates a new thermometer plot, using default attributes where necessary.
    Parameters:
    dataset - the data set.

    Method Details

    clone

    public Object clone()
                throws CloneNotSupportedException
    Returns a clone of the plot.
    Overrides:
    clone in interface Plot
    Returns:
    A clone.

    datasetChanged

    public void datasetChanged(DatasetChangeEvent event)
    Checks to see if a new value means the axis range needs adjusting.
    Specified by:
    datasetChanged in interface DatasetChangeListener
    Overrides:
    datasetChanged in interface Plot
    Parameters:
    event - the dataset change event.

    draw

    public 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).
    Overrides:
    draw in interface Plot
    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.

    equals

    public boolean equals(Object obj)
    Tests this plot for equality with another object. The plot's dataset is not considered in the test.
    Overrides:
    equals in interface Plot
    Parameters:
    obj - the object (null permitted).
    Returns:
    true or false.

    getAxisLocation

    public int getAxisLocation()
    Returns the axis location.
    Returns:
    The location (one of NONE, LEFT and RIGHT).

    getBulbDiameter

    public int getBulbDiameter()
    Returns the bulb diameter, which is always twice the value returned by getBulbRadius().
    Returns:
    The bulb diameter.
    Since:
    1.0.7

    getBulbRadius

    public int getBulbRadius()
    Returns the bulb radius, in Java2D units.
    Returns:
    The bulb radius.
    Since:
    1.0.7

    getColumnDiameter

    public int getColumnDiameter()
    Returns the column diameter, which is always twice the value returned by getColumnRadius().
    Returns:
    The column diameter.
    Since:
    1.0.7

    getColumnRadius

    public int getColumnRadius()
    Returns the column radius, in Java2D units.
    Returns:
    The column radius.
    Since:
    1.0.7

    getDataRange

    public Range getDataRange(ValueAxis axis)
    Returns the data range.
    Specified by:
    getDataRange in interface ValueAxisPlot
    Parameters:
    axis - the axis.
    Returns:
    The range of data displayed.

    getDataset

    public ValueDataset getDataset()
    Returns the dataset for the plot.
    Returns:
    The dataset (possibly null).

    getFollowDataInSubranges

    public boolean getFollowDataInSubranges()
    Returns a flag that controls whether or not the thermometer axis zooms to display the subrange within which the data value falls.
    Returns:
    The flag.

    getGap

    public int getGap()
    Returns the gap, in Java2D units, between the two outlines that represent the thermometer.
    Returns:
    The gap.
    Since:
    1.0.7
    See Also:
    setGap(int)

    getLegendItems

    public LegendItemCollection getLegendItems()
    Returns the legend items for the plot.
    Specified by:
    getLegendItems in interface LegendItemSource
    Overrides:
    getLegendItems in interface Plot
    Returns:
    null.

    getLowerBound

    public double getLowerBound()
    Returns the lower bound for the thermometer. The data value can be set lower than this, but it will not be shown in the thermometer.
    Returns:
    The lower bound.

    getMaximumVerticalDataValue

    public Number getMaximumVerticalDataValue()

    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

    getMercuryPaint

    public Paint getMercuryPaint()
    Returns the default mercury paint.
    Returns:
    The paint (never null).

    getMinimumVerticalDataValue

    public Number getMinimumVerticalDataValue()

    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.

    getOrientation

    public PlotOrientation getOrientation()
    Returns the orientation of the plot.
    Specified by:
    getOrientation in interface Zoomable
    Returns:
    The orientation (always PlotOrientation.VERTICAL).

    getPadding

    public RectangleInsets getPadding()
    Returns the padding for the thermometer. This is the space inside the plot area.
    Returns:
    The padding (never null).

    getPlotType

    public String getPlotType()
    Returns a short string describing the type of plot.
    Overrides:
    getPlotType in interface Plot
    Returns:
    A short string describing the type of plot.

    getRangeAxis

    public ValueAxis getRangeAxis()
    Returns the range axis.
    Returns:
    The range axis (never null).

    getShowValueLines

    public boolean getShowValueLines()

    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.

    getSubrangePaint

    public Paint getSubrangePaint(int range)
    Gets the paint used for a particular subrange.
    Parameters:
    range - the range (.
    Returns:
    The paint.

    getThermometerPaint

    public Paint getThermometerPaint()
    Returns the paint used to draw the thermometer outline.
    Returns:
    The paint (never null).

    getThermometerStroke

    public Stroke getThermometerStroke()
    Returns the stroke used to draw the thermometer outline.
    Returns:
    The stroke (never null).

    getUnits

    public int getUnits()
    Returns a code indicating the unit display type. This is one of UNITS_NONE, UNITS_FAHRENHEIT, UNITS_CELCIUS and UNITS_KELVIN.
    Returns:
    The units type.
    See Also:
    setUnits(int)

    getUpperBound

    public double getUpperBound()
    Returns the upper bound for the thermometer. The data value can be set higher than this, but it will not be shown in the thermometer.
    Returns:
    The upper bound.

    getUseSubrangePaint

    public boolean getUseSubrangePaint()
    Returns a flag that controls whether or not the mercury color changes for each subrange.
    Returns:
    The flag.

    getValueFont

    public Font getValueFont()
    Gets the font used to display the current value.
    Returns:
    The font.

    getValueLocation

    public int getValueLocation()
    Returns a code indicating the location at which the value label is displayed.
    Returns:
    The location (one of NONE, RIGHT, LEFT and BULB.).

    getValuePaint

    public Paint getValuePaint()
    Gets the paint used to display the current value.
    Returns:
    The paint.

    isDomainZoomable

    public boolean isDomainZoomable()
    Returns false.
    Specified by:
    isDomainZoomable in interface Zoomable
    Returns:
    A boolean.

    isRangeZoomable

    public boolean isRangeZoomable()
    Returns true.
    Specified by:
    isRangeZoomable in interface Zoomable
    Returns:
    A boolean.

    isValidNumber

    protected static boolean isValidNumber(double d)
    Determine whether a number is valid and finite.
    Parameters:
    d - the number to be tested.
    Returns:
    true if the number is valid and finite, and false otherwise.

    setAxisLocation

    public 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.
    Parameters:
    location - the location (one of NONE, LEFT and RIGHT).

    setAxisRange

    protected void setAxisRange()
    Sets the axis range to the current values in the rangeInfo array.

    setBulbRadius

    public void setBulbRadius(int r)
    Sets the bulb radius (in Java2D units) and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    r - the new radius (in Java2D units).
    Since:
    1.0.7

    setColumnRadius

    public void setColumnRadius(int r)
    Sets the column radius (in Java2D units) and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    r - the new radius.
    Since:
    1.0.7

    setDataset

    public 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.
    Parameters:
    dataset - the dataset (null permitted).
    See Also:
    getDataset()

    setDisplayRange

    public void setDisplayRange(int range,
                                double low,
                                double high)
    Sets the displayed bounds for a sub range.
    Parameters:
    range - the range type.
    low - the low value.
    high - the high value.

    setFollowDataInSubranges

    public 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.
    Parameters:
    flag - the flag.

    setGap

    public 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.
    Parameters:
    gap - the new gap.
    Since:
    1.0.7
    See Also:
    getGap()

    setLowerBound

    public void setLowerBound(double lower)
    Sets the lower bound for the thermometer.
    Parameters:
    lower - the lower bound.

    setMercuryPaint

    public void setMercuryPaint(Paint paint)
    Sets the default mercury paint and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    paint - the new paint (null not permitted).

    setPadding

    public void setPadding(RectangleInsets padding)
    Sets the padding for the thermometer and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    padding - the padding (null not permitted).
    See Also:
    getPadding()

    setRange

    public void setRange(double lower,
                         double upper)
    Sets the lower and upper bounds for the thermometer.
    Parameters:
    lower - the lower bound.
    upper - the upper bound.

    setRangeAxis

    public void setRangeAxis(ValueAxis axis)
    Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    axis - the new axis (null not permitted).

    setShowValueLines

    public void setShowValueLines(boolean b)

    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

    setSubrange

    public void setSubrange(int range,
                            double low,
                            double high)
    Sets the bounds for a subrange.
    Parameters:
    range - the range type.
    low - the low value.
    high - the high value.

    setSubrangeInfo

    public void setSubrangeInfo(int range,
                                double low,
                                double hi)
    Sets information for a particular range.
    Parameters:
    range - the range to specify information about.
    low - the low value for the range
    hi - the high value for the range

    setSubrangeInfo

    public void setSubrangeInfo(int range,
                                double rangeLow,
                                double rangeHigh,
                                double displayLow,
                                double displayHigh)
    Sets the subrangeInfo attribute of the ThermometerPlot object
    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

    setSubrangePaint

    public void setSubrangePaint(int range,
                                 Paint paint)
    Sets the paint to be used for a subrange and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    range - the range (0, 1 or 2).
    paint - the paint to be applied (null not permitted).

    setThermometerPaint

    public void setThermometerPaint(Paint paint)
    Sets the paint used to draw the thermometer outline and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    paint - the new paint (null ignored).

    setThermometerStroke

    public void setThermometerStroke(Stroke s)
    Sets the stroke used to draw the thermometer outline and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    s - the new stroke (null ignored).

    setUnits

    public void setUnits(String u)

    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).

    setUnits

    public void setUnits(int u)
    Sets the units to be displayed in the thermometer. Use one of the following constants:
    • UNITS_NONE : no units displayed.
    • UNITS_FAHRENHEIT : units displayed in Fahrenheit.
    • UNITS_CELCIUS : units displayed in Celcius.
    • UNITS_KELVIN : units displayed in Kelvin.
    Parameters:
    u - the new unit type.
    See Also:
    getUnits()

    setUpperBound

    public void setUpperBound(double upper)
    Sets the upper bound for the thermometer.
    Parameters:
    upper - the upper bound.

    setUseSubrangePaint

    public void setUseSubrangePaint(boolean flag)
    Sets the range colour change option.
    Parameters:
    flag - the new range colour change option

    setValueFont

    public void setValueFont(Font f)
    Sets the font used to display the current value.
    Parameters:
    f - the new font (null not permitted).

    setValueFormat

    public void setValueFormat(NumberFormat formatter)
    Sets the formatter for the value label and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    formatter - the new formatter (null not permitted).

    setValueLocation

    public void setValueLocation(int location)
    Sets the location at which the current value is displayed and sends a PlotChangeEvent to all registered listeners.

    The location can be one of the constants: NONE, RIGHT LEFT and BULB.

    Parameters:
    location - the location.

    setValuePaint

    public void setValuePaint(Paint paint)
    Sets the paint used to display the current value and sends a PlotChangeEvent to all registered listeners.
    Parameters:
    paint - the new paint (null not permitted).

    zoom

    public void zoom(double percent)
    A zoom method that does nothing. Plots are required to support the zoom operation. In the case of a thermometer chart, it doesn't make sense to zoom in or out, so the method is empty.
    Overrides:
    zoom in interface Plot
    Parameters:
    percent - the zoom percentage.

    zoomDomainAxes

    public void zoomDomainAxes(double lowerPercent,
                               double upperPercent,
                               PlotRenderingInfo state,
                               Point2D source)
    This method does nothing.
    Specified by:
    zoomDomainAxes in interface Zoomable
    Parameters:
    lowerPercent - the lower percent.
    upperPercent - the upper percent.
    state - the plot state.
    source - the source point.

    zoomDomainAxes

    public void zoomDomainAxes(double factor,
                               PlotRenderingInfo state,
                               Point2D source)
    Multiplies the range on the domain axis/axes by the specified factor.
    Specified by:
    zoomDomainAxes in interface Zoomable
    Parameters:
    factor - the zoom factor.
    state - the plot state.
    source - the source point.

    zoomDomainAxes

    public void zoomDomainAxes(double factor,
                               PlotRenderingInfo state,
                               Point2D source,
                               boolean useAnchor)
    Multiplies the range on the domain axis/axes by the specified factor.
    Specified by:
    zoomDomainAxes in interface Zoomable
    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

    zoomRangeAxes

    public void zoomRangeAxes(double lowerPercent,
                              double upperPercent,
                              PlotRenderingInfo state,
                              Point2D source)
    Zooms the range axes.
    Specified by:
    zoomRangeAxes in interface Zoomable
    Parameters:
    lowerPercent - the lower percent.
    upperPercent - the upper percent.
    state - the plot state.
    source - the source point.

    zoomRangeAxes

    public void zoomRangeAxes(double factor,
                              PlotRenderingInfo state,
                              Point2D source)
    Multiplies the range on the range axis/axes by the specified factor.
    Specified by:
    zoomRangeAxes in interface Zoomable
    Parameters:
    factor - the zoom factor.
    state - the plot state.
    source - the source point.

    zoomRangeAxes

    public void zoomRangeAxes(double factor,
                              PlotRenderingInfo state,
                              Point2D source,
                              boolean useAnchor)
    Multiplies the range on the range axis/axes by the specified factor.
    Specified by:
    zoomRangeAxes in interface Zoomable
    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