| java.lang.Object org.jfree.chart.plot.Plot org.jfree.chart.plot.ThermometerPlot
ThermometerPlot | public class ThermometerPlot extends Plot implements ValueAxisPlot,Zoomable,Cloneable,Serializable(Code) | | A plot that displays a single value (from a
ValueDataset ) in a
thermometer type display.
This plot supports a number of options:
- three sub-ranges which could be viewed as 'Normal', 'Warning'
and 'Critical' ranges.
- 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 | |
final protected static int | AXIS_GAP The axis gap. | final public static int | BULB A constant for the value label position (in the thermometer bulb). | final protected static int | BULB_DIAMETER The bulb diameter. | final protected static int | BULB_RADIUS The bulb radius. | final protected static int | COLUMN_DIAMETER The column diameter. | final protected static int | COLUMN_RADIUS The column radius. | final public static int | CRITICAL A constant for the 'critical' range. | final protected static double | DEFAULT_LOWER_BOUND The default lower bound. | final protected static double | DEFAULT_UPPER_BOUND The default upper bound. | final protected static int | DISPLAY_HIGH Index for display high value in subrangeInfo matrix. | final protected static int | DISPLAY_LOW Index for display low value in subrangeInfo matrix. | final protected static int | GAP_DIAMETER The gap diameter. | final protected static int | GAP_RADIUS The gap radius. | final public static int | LEFT A constant for the value label position (left of the thermometer). | final public static int | NONE A constant for the value label position (no label). | final public static int | NORMAL A constant for the 'normal' range. | final protected static int | RANGE_HIGH Index for high value in subrangeInfo matrix. | final protected static int | RANGE_LOW Index for low value in subrangeInfo matrix. | final public static int | RIGHT A constant for the value label position (right of the thermometer). | final protected static String[] | UNITS The unit strings. | final public static int | UNITS_CELCIUS A constant for unit type 'Celcius'. | final public static int | UNITS_FAHRENHEIT A constant for unit type 'Fahrenheit'. | final public static int | UNITS_KELVIN A constant for unit type 'Kelvin'. | final public static int | UNITS_NONE A constant for unit type 'None'. | final public static int | WARNING A constant for the 'warning' range. | protected static ResourceBundle | localizationResources The resourceBundle for the localization. |
Method Summary | |
public Object | clone() 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. | public int | getAxisLocation() Returns the axis location. | public Range | getDataRange(ValueAxis axis) Returns the data range.
Parameters: axis - the axis. | 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 LegendItemCollection | getLegendItems() Returns the legend items for the plot. | public double | getLowerBound() Returns the lower bound for the thermometer. | public 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. | public Paint | getMercuryPaint() Returns the default mercury paint. | public 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. | public PlotOrientation | getOrientation() Returns the orientation of the plot. | public RectangleInsets | getPadding() Returns the padding for the thermometer. | public String | getPlotType() Returns a short string describing the type of plot. | public ValueAxis | getRangeAxis() Returns the range axis. | public boolean | getShowValueLines() Returns the flag that controls whether not value lines are displayed. | public Paint | getSubrangePaint(int range) Gets the paint used for a particular subrange.
Parameters: range - the range (. | 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() Returns a code indicating the unit display type. | public double | getUpperBound() Returns the upper bound for 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.
Parameters: d - the number to be tested. | 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 | 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 | 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) 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) | 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. | public void | setUnits(String u) 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. | 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. | 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 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 lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source) Zooms the range axes. |
AXIS_GAP | final protected static int AXIS_GAP(Code) | | The axis gap.
|
BULB | final public static int BULB(Code) | | A constant for the value label position (in the thermometer bulb).
|
BULB_DIAMETER | final protected static int BULB_DIAMETER(Code) | | The bulb diameter.
|
BULB_RADIUS | final protected static int BULB_RADIUS(Code) | | The bulb radius.
|
COLUMN_DIAMETER | final protected static int COLUMN_DIAMETER(Code) | | The column diameter.
|
COLUMN_RADIUS | final protected static int COLUMN_RADIUS(Code) | | The column radius.
|
CRITICAL | final public static int CRITICAL(Code) | | A constant for the 'critical' range.
|
DEFAULT_LOWER_BOUND | final protected static double DEFAULT_LOWER_BOUND(Code) | | The default lower bound.
|
DEFAULT_UPPER_BOUND | final protected static double DEFAULT_UPPER_BOUND(Code) | | The default upper bound.
|
DISPLAY_HIGH | final protected static int DISPLAY_HIGH(Code) | | Index for display high value in subrangeInfo matrix.
|
DISPLAY_LOW | final protected static int DISPLAY_LOW(Code) | | Index for display low value in subrangeInfo matrix.
|
GAP_DIAMETER | final protected static int GAP_DIAMETER(Code) | | The gap diameter.
|
GAP_RADIUS | final protected static int GAP_RADIUS(Code) | | The gap radius.
|
LEFT | final public static int LEFT(Code) | | A constant for the value label position (left of the thermometer).
|
NONE | final public static int NONE(Code) | | A constant for the value label position (no label).
|
NORMAL | final public static int NORMAL(Code) | | A constant for the 'normal' range.
|
RANGE_HIGH | final protected static int RANGE_HIGH(Code) | | Index for high value in subrangeInfo matrix.
|
RANGE_LOW | final protected static int RANGE_LOW(Code) | | Index for low value in subrangeInfo matrix.
|
RIGHT | final public static int RIGHT(Code) | | A constant for the value label position (right of the thermometer).
|
UNITS | final protected static String[] UNITS(Code) | | The unit strings.
|
UNITS_CELCIUS | final public static int UNITS_CELCIUS(Code) | | A constant for unit type 'Celcius'.
|
UNITS_FAHRENHEIT | final public static int UNITS_FAHRENHEIT(Code) | | A constant for unit type 'Fahrenheit'.
|
UNITS_KELVIN | final public static int UNITS_KELVIN(Code) | | A constant for unit type 'Kelvin'.
|
UNITS_NONE | final public static int UNITS_NONE(Code) | | A constant for unit type 'None'.
|
WARNING | final public static int WARNING(Code) | | A constant for the 'warning' range.
|
localizationResources | protected static ResourceBundle localizationResources(Code) | | The resourceBundle for the localization.
|
ThermometerPlot | public ThermometerPlot()(Code) | | Creates a new thermometer plot.
|
ThermometerPlot | public ThermometerPlot(ValueDataset dataset)(Code) | | Creates a new thermometer plot, using default attributes where necessary.
Parameters: dataset - the data set. |
datasetChanged | public void datasetChanged(DatasetChangeEvent event)(Code) | | Checks to see if a new value means the axis range needs adjusting.
Parameters: event - the dataset change event. |
draw | public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)(Code) | | Draws the plot on a Java 2D graphics device (such as the screen or a
printer).
Parameters: g2 - the graphics device. Parameters: area - the area within which the plot should be drawn. Parameters: anchor - the anchor point (null permitted). Parameters: parentState - the state from the parent plot, if there is one. Parameters: info - collects info about the drawing. |
equals | public boolean equals(Object obj)(Code) | | Tests this plot for equality with another object. The plot's dataset
is not considered in the test.
Parameters: obj - the object (null permitted). true or false . |
getDataRange | public Range getDataRange(ValueAxis axis)(Code) | | Returns the data range.
Parameters: axis - the axis. The range of data displayed. |
getFollowDataInSubranges | public boolean getFollowDataInSubranges()(Code) | | Returns a flag that controls whether or not the thermometer axis zooms
to display the subrange within which the data value falls.
The flag. |
getLowerBound | public double getLowerBound()(Code) | | 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.
The lower bound. See Also: ThermometerPlot.setLowerBound(double) |
getMaximumVerticalDataValue | public Number getMaximumVerticalDataValue()(Code) | | 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.
The maximum value in either the domain or the range |
getMinimumVerticalDataValue | public Number getMinimumVerticalDataValue()(Code) | | 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.
The minimum value in either the domain or the range. |
getPlotType | public String getPlotType()(Code) | | Returns a short string describing the type of plot.
A short string describing the type of plot. |
getUpperBound | public double getUpperBound()(Code) | | 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.
The upper bound. See Also: ThermometerPlot.setUpperBound(double) |
isDomainZoomable | public boolean isDomainZoomable()(Code) | | Returns false .
A boolean. |
isRangeZoomable | public boolean isRangeZoomable()(Code) | | Returns true .
A boolean. |
isValidNumber | protected static boolean isValidNumber(double d)(Code) | | Determine whether a number is valid and finite.
Parameters: d - the number to be tested. true if the number is valid and finite, and false otherwise. |
setAxisRange | protected void setAxisRange()(Code) | | Sets the axis range to the current values in the rangeInfo array.
|
setDisplayRange | public void setDisplayRange(int range, double low, double high)(Code) | | Sets the displayed bounds for a sub range.
Parameters: range - the range type. Parameters: low - the low value. Parameters: high - the high value. |
setFollowDataInSubranges | public void setFollowDataInSubranges(boolean flag)(Code) | | 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. |
setPadding | public void setPadding(RectangleInsets padding)(Code) | | Sets the padding for the thermometer and sends a
PlotChangeEvent
to all registered listeners.
Parameters: padding - the padding (null not permitted). See Also: ThermometerPlot.getPadding() |
setRange | public void setRange(double lower, double upper)(Code) | | Sets the lower and upper bounds for the thermometer.
Parameters: lower - the lower bound. Parameters: upper - the upper bound. |
setShowValueLines | public void setShowValueLines(boolean b)(Code) | | 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: ThermometerPlot.getShowValueLines() |
setSubrange | public void setSubrange(int range, double low, double high)(Code) | | Sets the bounds for a subrange.
Parameters: range - the range type. Parameters: low - the low value. Parameters: high - the high value. |
setSubrangeInfo | public void setSubrangeInfo(int range, double low, double hi)(Code) | | Sets information for a particular range.
Parameters: range - the range to specify information about. Parameters: low - the low value for the range Parameters: hi - the high value for the range |
setSubrangeInfo | public void setSubrangeInfo(int range, double rangeLow, double rangeHigh, double displayLow, double displayHigh)(Code) | | Sets the subrangeInfo attribute of the ThermometerPlot object
Parameters: range - the new rangeInfo value. Parameters: rangeLow - the new rangeInfo value Parameters: rangeHigh - the new rangeInfo value Parameters: displayLow - the new rangeInfo value Parameters: displayHigh - the new rangeInfo value |
setSubrangePaint | public void setSubrangePaint(int range, Paint paint)(Code) | | 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). Parameters: paint - the paint to be applied (null not permitted). See Also: ThermometerPlot.getSubrangePaint(int) |
setUnits | public void setUnits(int u)(Code) | | 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: ThermometerPlot.getUnits() |
setUnits | public void setUnits(String u)(Code) | | Sets the unit type.
Parameters: u - the unit type (null ignored). |
setValueFormat | public void setValueFormat(NumberFormat formatter)(Code) | | 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)(Code) | | 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. |
zoom | public void zoom(double percent)(Code) | | 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.
Parameters: percent - the zoom percentage. |
zoomDomainAxes | public void zoomDomainAxes(double factor, PlotRenderingInfo state, Point2D source)(Code) | | Multiplies the range on the domain axis/axes by the specified factor.
Parameters: factor - the zoom factor. Parameters: state - the plot state. Parameters: source - the source point. |
zoomDomainAxes | public void zoomDomainAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)(Code) | | This method does nothing.
Parameters: lowerPercent - the lower percent. Parameters: upperPercent - the upper percent. Parameters: state - the plot state. Parameters: source - the source point. |
zoomRangeAxes | public void zoomRangeAxes(double factor, PlotRenderingInfo state, Point2D source)(Code) | | Multiplies the range on the range axis/axes by the specified factor.
Parameters: factor - the zoom factor. Parameters: state - the plot state. Parameters: source - the source point. |
zoomRangeAxes | public void zoomRangeAxes(double lowerPercent, double upperPercent, PlotRenderingInfo state, Point2D source)(Code) | | Zooms the range axes.
Parameters: lowerPercent - the lower percent. Parameters: upperPercent - the upper percent. Parameters: state - the plot state. Parameters: source - the source point. |
Methods inherited from org.jfree.chart.plot.Plot | public void addChangeListener(PlotChangeListener listener)(Code)(Java Doc) public void axisChanged(AxisChangeEvent event)(Code)(Java Doc) public Object clone() throws CloneNotSupportedException(Code)(Java Doc) public void datasetChanged(DatasetChangeEvent event)(Code)(Java Doc) abstract public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)(Code)(Java Doc) public void drawBackground(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) public void drawBackgroundImage(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) protected void drawNoDataMessage(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) public void drawOutline(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) protected void fillBackground(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) protected void fillBackground(Graphics2D g2, Rectangle2D area, PlotOrientation orientation)(Code)(Java Doc) public float getBackgroundAlpha()(Code)(Java Doc) public Image getBackgroundImage()(Code)(Java Doc) public int getBackgroundImageAlignment()(Code)(Java Doc) public float getBackgroundImageAlpha()(Code)(Java Doc) public Paint getBackgroundPaint()(Code)(Java Doc) public DatasetGroup getDatasetGroup()(Code)(Java Doc) public DrawingSupplier getDrawingSupplier()(Code)(Java Doc) public float getForegroundAlpha()(Code)(Java Doc) public RectangleInsets getInsets()(Code)(Java Doc) public LegendItemCollection getLegendItems()(Code)(Java Doc) public String getNoDataMessage()(Code)(Java Doc) public Font getNoDataMessageFont()(Code)(Java Doc) public Paint getNoDataMessagePaint()(Code)(Java Doc) public Paint getOutlinePaint()(Code)(Java Doc) public Stroke getOutlineStroke()(Code)(Java Doc) public Plot getParent()(Code)(Java Doc) abstract public String getPlotType()(Code)(Java Doc) protected double getRectX(double x, double w1, double w2, RectangleEdge edge)(Code)(Java Doc) protected double getRectY(double y, double h1, double h2, RectangleEdge edge)(Code)(Java Doc) public Plot getRootPlot()(Code)(Java Doc) public void handleClick(int x, int y, PlotRenderingInfo info)(Code)(Java Doc) public boolean isOutlineVisible()(Code)(Java Doc) public boolean isSubplot()(Code)(Java Doc) public void markerChanged(MarkerChangeEvent event)(Code)(Java Doc) public void notifyListeners(PlotChangeEvent event)(Code)(Java Doc) public void removeChangeListener(PlotChangeListener listener)(Code)(Java Doc) public static RectangleEdge resolveDomainAxisLocation(AxisLocation location, PlotOrientation orientation)(Code)(Java Doc) public static RectangleEdge resolveRangeAxisLocation(AxisLocation location, PlotOrientation orientation)(Code)(Java Doc) public void setBackgroundAlpha(float alpha)(Code)(Java Doc) public void setBackgroundImage(Image image)(Code)(Java Doc) public void setBackgroundImageAlignment(int alignment)(Code)(Java Doc) public void setBackgroundImageAlpha(float alpha)(Code)(Java Doc) public void setBackgroundPaint(Paint paint)(Code)(Java Doc) protected void setDatasetGroup(DatasetGroup group)(Code)(Java Doc) public void setDrawingSupplier(DrawingSupplier supplier)(Code)(Java Doc) public void setForegroundAlpha(float alpha)(Code)(Java Doc) public void setInsets(RectangleInsets insets)(Code)(Java Doc) public void setInsets(RectangleInsets insets, boolean notify)(Code)(Java Doc) public void setNoDataMessage(String message)(Code)(Java Doc) public void setNoDataMessageFont(Font font)(Code)(Java Doc) public void setNoDataMessagePaint(Paint paint)(Code)(Java Doc) public void setOutlinePaint(Paint paint)(Code)(Java Doc) public void setOutlineStroke(Stroke stroke)(Code)(Java Doc) public void setOutlineVisible(boolean visible)(Code)(Java Doc) public void setParent(Plot parent)(Code)(Java Doc) public void zoom(double percent)(Code)(Java Doc)
|
|
|