Save This Page
Home » jcommon-1.0.13 » org.jfree » chart » plot » [javadoc | source]
org.jfree.chart.plot
public class: ThermometerPlot [javadoc | source]
java.lang.Object
   org.jfree.chart.plot.Plot
      org.jfree.chart.plot.ThermometerPlot

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

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.
  3. settable units to be displayed.
  4. settable display location for the value text.
Field Summary
public static final  int UNITS_NONE    A constant for unit type 'None'. 
public static final  int UNITS_FAHRENHEIT    A constant for unit type 'Fahrenheit'. 
public static final  int UNITS_CELCIUS    A constant for unit type 'Celcius'. 
public static final  int UNITS_KELVIN    A constant for unit type 'Kelvin'. 
public static final  int NONE    A constant for the value label position (no label). 
public static final  int RIGHT    A constant for the value label position (right of the thermometer). 
public static final  int LEFT    A constant for the value label position (left of the thermometer). 
public static final  int BULB    A constant for the value label position (in the thermometer bulb). 
public static final  int NORMAL    A constant for the 'normal' range. 
public static final  int WARNING    A constant for the 'warning' range. 
public static final  int CRITICAL    A constant for the 'critical' range. 
protected static final  int BULB_RADIUS    The bulb radius.
     
    protected static final  int BULB_DIAMETER    The bulb diameter.
       
      protected static final  int COLUMN_RADIUS    The column radius.
         
        protected static final  int COLUMN_DIAMETER    The column diameter.
           
          protected static final  int GAP_RADIUS    The gap radius.
             
            protected static final  int GAP_DIAMETER    The gap diameter.
               
              protected static final  int AXIS_GAP    The axis gap. 
              protected static final  String[] UNITS    The unit strings. 
              protected static final  int RANGE_LOW    Index for low value in subrangeInfo matrix. 
              protected static final  int RANGE_HIGH    Index for high value in subrangeInfo matrix. 
              protected static final  int DISPLAY_LOW    Index for display low value in subrangeInfo matrix. 
              protected static final  int DISPLAY_HIGH    Index for display high value in subrangeInfo matrix. 
              protected static final  double DEFAULT_LOWER_BOUND    The default lower bound. 
              protected static final  double DEFAULT_UPPER_BOUND    The default upper bound. 
              protected static final  int DEFAULT_BULB_RADIUS    The default bulb radius.
                since: 1.0.7 -
               
              protected static final  int DEFAULT_COLUMN_RADIUS    The default column radius.
                since: 1.0.7 -
               
              protected static final  int DEFAULT_GAP    The default gap between the outlines representing the thermometer.
                since: 1.0.7 -
               
              protected static  ResourceBundle localizationResources    The resourceBundle for the localization. 
              Fields inherited from org.jfree.chart.plot.Plot:
              ZERO,  DEFAULT_INSETS,  DEFAULT_OUTLINE_STROKE,  DEFAULT_OUTLINE_PAINT,  DEFAULT_FOREGROUND_ALPHA,  DEFAULT_BACKGROUND_ALPHA,  DEFAULT_BACKGROUND_PAINT,  MINIMUM_WIDTH_TO_DRAW,  MINIMUM_HEIGHT_TO_DRAW,  DEFAULT_LEGEND_ITEM_BOX,  DEFAULT_LEGEND_ITEM_CIRCLE
              Constructor:
               public ThermometerPlot() 
               public ThermometerPlot(ValueDataset dataset) 
                Creates a new thermometer plot, using default attributes where necessary.
                Parameters:
                dataset - the data set.
              Method from org.jfree.chart.plot.ThermometerPlot Summary:
              clone,   datasetChanged,   draw,   equals,   getAxisLocation,   getBulbDiameter,   getBulbRadius,   getColumnDiameter,   getColumnRadius,   getDataRange,   getDataset,   getFollowDataInSubranges,   getGap,   getLegendItems,   getLowerBound,   getMaximumVerticalDataValue,   getMercuryPaint,   getMinimumVerticalDataValue,   getOrientation,   getPadding,   getPlotType,   getRangeAxis,   getShowValueLines,   getSubrangePaint,   getThermometerPaint,   getThermometerStroke,   getUnits,   getUpperBound,   getUseSubrangePaint,   getValueFont,   getValueLocation,   getValuePaint,   isDomainZoomable,   isRangeZoomable,   isValidNumber,   setAxisLocation,   setAxisRange,   setBulbRadius,   setColumnRadius,   setDataset,   setDisplayRange,   setFollowDataInSubranges,   setGap,   setLowerBound,   setMercuryPaint,   setPadding,   setRange,   setRangeAxis,   setShowValueLines,   setSubrange,   setSubrangeInfo,   setSubrangeInfo,   setSubrangePaint,   setThermometerPaint,   setThermometerStroke,   setUnits,   setUnits,   setUpperBound,   setUseSubrangePaint,   setValueFont,   setValueFormat,   setValueLocation,   setValuePaint,   zoom,   zoomDomainAxes,   zoomDomainAxes,   zoomDomainAxes,   zoomRangeAxes,   zoomRangeAxes,   zoomRangeAxes
              Methods from 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
              Methods from java.lang.Object:
              equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
              Method from org.jfree.chart.plot.ThermometerPlot Detail:
               public Object clone() throws CloneNotSupportedException 
                Returns a clone of the plot.
               public  void datasetChanged(DatasetChangeEvent event) 
                Checks to see if a new value means the axis range needs adjusting.
               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).
               public boolean equals(Object obj) 
                Tests this plot for equality with another object. The plot's dataset is not considered in the test.
               public int getAxisLocation() 
                Returns the axis location.
               public int getBulbDiameter() 
                Returns the bulb diameter, which is always twice the value returned by #getBulbRadius() .
               public int getBulbRadius() 
                Returns the bulb radius, in Java2D units.
               public int getColumnDiameter() 
                Returns the column diameter, which is always twice the value returned by #getColumnRadius() .
               public int getColumnRadius() 
                Returns the column radius, in Java2D units.
               public Range getDataRange(ValueAxis axis) 
                Returns the data range.
               public ValueDataset getDataset() 
                Returns the dataset for the plot.
               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.
               public int getGap() 
                Returns the gap, in Java2D units, between the two outlines that represent the thermometer.
               public LegendItemCollection getLegendItems() 
                Returns the legend items for the plot.
               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.
               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.
               public Paint getMercuryPaint() 
                Returns the default mercury paint.
               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.
               public PlotOrientation getOrientation() 
                Returns the orientation of the plot.
               public RectangleInsets getPadding() 
                Returns the padding for the thermometer. This is the space inside the plot area.
               public String getPlotType() 
                Returns a short string describing the type of plot.
               public ValueAxis getRangeAxis() 
                Returns the range axis.
               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.
               public Paint getSubrangePaint(int range) 
                Gets the paint used for a particular subrange.
               public Paint getThermometerPaint() 
                Returns the paint used to draw the thermometer outline.
               public Stroke getThermometerStroke() 
                Returns the stroke used to draw the thermometer outline.
               public int getUnits() 
               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.
               public boolean getUseSubrangePaint() 
                Returns a flag that controls whether or not the mercury color changes for each subrange.
               public Font getValueFont() 
                Gets the font used to display the current value.
               public int getValueLocation() 
                Returns a code indicating the location at which the value label is displayed.
               public Paint getValuePaint() 
                Gets the paint used to display the current value.
               public boolean isDomainZoomable() 
                Returns false.
               public boolean isRangeZoomable() 
                Returns true.
               protected static boolean isValidNumber(double d) 
                Determine whether a number is valid and finite.
               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.
               protected  void setAxisRange() 
                Sets the axis range to the current values in the rangeInfo array.
               public  void setBulbRadius(int r) 
                Sets the bulb radius (in Java2D units) and sends a PlotChangeEvent to all registered listeners.
               public  void setColumnRadius(int r) 
                Sets the column radius (in Java2D units) and sends a PlotChangeEvent to all registered listeners.
               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.
               public  void setDisplayRange(int range,
                  double low,
                  double high) 
                Sets the displayed bounds for a sub range.
               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.
               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.
               public  void setLowerBound(double lower) 
                Sets the lower bound for the thermometer.
               public  void setMercuryPaint(Paint paint) 
                Sets the default mercury paint and sends a PlotChangeEvent to all registered listeners.
               public  void setPadding(RectangleInsets padding) 
                Sets the padding for the thermometer and sends a PlotChangeEvent to all registered listeners.
               public  void setRange(double lower,
                  double upper) 
                Sets the lower and upper bounds for the thermometer.
               public  void setRangeAxis(ValueAxis axis) 
                Sets the range axis for the plot and sends a PlotChangeEvent to all registered listeners.
               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.
               public  void setSubrange(int range,
                  double low,
                  double high) 
                Sets the bounds for a subrange.
               public  void setSubrangeInfo(int range,
                  double low,
                  double hi) 
                Sets information for a particular range.
               public  void setSubrangeInfo(int range,
                  double rangeLow,
                  double rangeHigh,
                  double displayLow,
                  double displayHigh) 
                Sets the subrangeInfo attribute of the ThermometerPlot object
               public  void setSubrangePaint(int range,
                  Paint paint) 
                Sets the paint to be used for a subrange and sends a PlotChangeEvent to all registered listeners.
               public  void setThermometerPaint(Paint paint) 
                Sets the paint used to draw the thermometer outline and sends a PlotChangeEvent to all registered listeners.
               public  void setThermometerStroke(Stroke s) 
                Sets the stroke used to draw the thermometer outline and sends a PlotChangeEvent to all registered listeners.
               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.
               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.
               public  void setUpperBound(double upper) 
                Sets the upper bound for the thermometer.
               public  void setUseSubrangePaint(boolean flag) 
                Sets the range colour change option.
               public  void setValueFont(Font f) 
                Sets the font used to display the current value.
               public  void setValueFormat(NumberFormat formatter) 
                Sets the formatter for the value label and sends a PlotChangeEvent to all registered listeners.
               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.

               public  void setValuePaint(Paint paint) 
                Sets the paint used to display the current value and sends a PlotChangeEvent to all registered listeners.
               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.
               public  void zoomDomainAxes(double factor,
                  PlotRenderingInfo state,
                  Point2D source) 
                Multiplies the range on the domain axis/axes by the specified factor.
               public  void zoomDomainAxes(double factor,
                  PlotRenderingInfo state,
                  Point2D source,
                  boolean useAnchor) 
                Multiplies the range on the domain axis/axes by the specified factor.
               public  void zoomDomainAxes(double lowerPercent,
                  double upperPercent,
                  PlotRenderingInfo state,
                  Point2D source) 
                This method does nothing.
               public  void zoomRangeAxes(double factor,
                  PlotRenderingInfo state,
                  Point2D source) 
                Multiplies the range on the range axis/axes by the specified factor.
               public  void zoomRangeAxes(double factor,
                  PlotRenderingInfo state,
                  Point2D source,
                  boolean useAnchor) 
                Multiplies the range on the range axis/axes by the specified factor.
               public  void zoomRangeAxes(double lowerPercent,
                  double upperPercent,
                  PlotRenderingInfo state,
                  Point2D source) 
                Zooms the range axes.