Class ThermometerPlot

    • Constructor Detail

      • 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 Detail

      • 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()
      • 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.
        See Also:
        setLowerBound(double)
      • setLowerBound

        public void setLowerBound​(double lower)
        Sets the lower bound for the thermometer.
        Parameters:
        lower - the lower bound.
        See Also:
        getLowerBound()
      • 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.
        See Also:
        setUpperBound(double)
      • setUpperBound

        public void setUpperBound​(double upper)
        Sets the upper bound for the thermometer.
        Parameters:
        upper - the upper bound.
        See Also:
        getUpperBound()
      • 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.
      • getPadding

        public org.jfree.ui.RectangleInsets getPadding()
        Returns the padding for the thermometer. This is the space inside the plot area.
        Returns:
        The padding (never null).
        See Also:
        setPadding(RectangleInsets)
      • setPadding

        public void setPadding​(org.jfree.ui.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()
      • 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()
      • setUnits

        public void setUnits​(java.lang.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).
      • 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.).
      • 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.
      • setValueFont

        public void setValueFont​(java.awt.Font f)
        Sets the font used to display the current value.
        Parameters:
        f - the new font (null not permitted).
        See Also:
        getValueFont()
      • setValuePaint

        public void setValuePaint​(java.awt.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).
        See Also:
        getValuePaint()
      • setValueFormat

        public void setValueFormat​(java.text.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).
      • setMercuryPaint

        public void setMercuryPaint​(java.awt.Paint paint)
        Sets the default mercury paint and sends a PlotChangeEvent to all registered listeners.
        Parameters:
        paint - the new paint (null not permitted).
        See Also:
        getMercuryPaint()
      • 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.
        See Also:
        setShowValueLines(boolean)
      • 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
        See Also:
        getShowValueLines()
      • 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
      • 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.
      • 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.
      • setSubrangePaint

        public void setSubrangePaint​(int range,
                                     java.awt.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).
        See Also:
        getSubrangePaint(int)
      • 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.
      • 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.
      • getBulbRadius

        public int getBulbRadius()
        Returns the bulb radius, in Java2D units.
        Returns:
        The bulb radius.
        Since:
        1.0.7
      • 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
        See Also:
        getBulbRadius()
      • 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
      • 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
      • 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)
      • 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()
      • draw

        public void draw​(java.awt.Graphics2D g2,
                         java.awt.geom.Rectangle2D area,
                         java.awt.geom.Point2D anchor,
                         PlotState parentState,
                         PlotRenderingInfo info)
        Draws the plot on a Java 2D graphics device (such as the screen or a printer).
        Specified by:
        draw in class 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.
      • 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 class Plot
        Parameters:
        percent - the zoom percentage.
      • getPlotType

        public java.lang.String getPlotType()
        Returns a short string describing the type of plot.
        Specified by:
        getPlotType in class Plot
        Returns:
        A short string describing the type of plot.
      • getMinimumVerticalDataValue

        public java.lang.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.
      • getMaximumVerticalDataValue

        public java.lang.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
      • setAxisRange

        protected void setAxisRange()
        Sets the axis range to the current values in the rangeInfo array.
      • 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.
      • equals

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

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Returns a clone of the plot.
        Specified by:
        clone in interface org.jfree.util.PublicCloneable
        Overrides:
        clone in class Plot
        Returns:
        A clone.
        Throws:
        java.lang.CloneNotSupportedException - if the plot cannot be cloned.