Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.jfree.chart.plot.Plot
org.jfree.chart.plot.ThermometerPlot
ValueDataset
) in a
thermometer type display.
This plot supports a number of options:
Field Summary | |
protected static int |
|
static int |
|
protected static int |
|
protected static int |
|
protected static int |
|
protected static int |
|
static int |
|
protected static int |
|
protected static int |
|
protected static int |
|
protected static double |
|
protected static double |
|
protected static int |
|
protected static int |
|
protected static int |
|
protected static int |
|
static int |
|
static int |
|
static int |
|
protected static int |
|
protected static int |
|
static int |
|
protected static String[] |
|
static int |
|
static int |
|
static int |
|
static int |
|
static int |
|
protected static ResourceBundle |
|
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 | |
| |
|
Method Summary | |
Object |
|
void |
|
void |
|
boolean |
|
int |
|
int |
|
int |
|
int |
|
int |
|
Range |
|
ValueDataset |
|
boolean |
|
int |
|
LegendItemCollection |
|
double |
|
Number |
|
Paint |
|
Number |
|
PlotOrientation |
|
RectangleInsets |
|
String |
|
ValueAxis |
|
boolean |
|
Paint |
|
Paint |
|
Stroke |
|
int |
|
double |
|
boolean |
|
Font |
|
int |
|
Paint |
|
boolean |
|
boolean |
|
protected static boolean |
|
void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public static final int BULB
A constant for the value label position (in the thermometer bulb).
- Field Value:
- 3
protected static final int BULB_DIAMETER
Deprecated. As of 1.0.7, use
getBulbDiameter()
.The bulb diameter.
- Field Value:
- 80
protected static final int BULB_RADIUS
Deprecated. As of 1.0.7, use
getBulbRadius()
.The bulb radius.
- Field Value:
- 40
protected static final int COLUMN_DIAMETER
Deprecated. As of 1.0.7, use
getColumnDiameter()
.The column diameter.
- Field Value:
- 40
protected static final int COLUMN_RADIUS
Deprecated. As of 1.0.7, use
getColumnRadius()
.The column radius.
- Field Value:
- 20
protected static final int DEFAULT_BULB_RADIUS
The default bulb radius.
- Field Value:
- 40
- Since:
- 1.0.7
protected static final int DEFAULT_COLUMN_RADIUS
The default column radius.
- Field Value:
- 20
- Since:
- 1.0.7
protected static final int DEFAULT_GAP
The default gap between the outlines representing the thermometer.
- Field Value:
- 5
- Since:
- 1.0.7
protected static final double DEFAULT_LOWER_BOUND
The default lower bound.
- Field Value:
- 0.0
protected static final double DEFAULT_UPPER_BOUND
The default upper bound.
- Field Value:
- 100.0
protected static final int DISPLAY_HIGH
Index for display high value in subrangeInfo matrix.
- Field Value:
- 3
protected static final int DISPLAY_LOW
Index for display low value in subrangeInfo matrix.
- Field Value:
- 2
protected static final int GAP_DIAMETER
Deprecated. As of 1.0.7, use
getGap()
times two.The gap diameter.
- Field Value:
- 10
protected static final int GAP_RADIUS
Deprecated. As of 1.0.7, use
getGap()
.The gap radius.
- Field Value:
- 5
public static final int LEFT
A constant for the value label position (left of the thermometer).
- Field Value:
- 2
protected static final int RANGE_HIGH
Index for high value in subrangeInfo matrix.
- Field Value:
- 1
protected static final int RANGE_LOW
Index for low value in subrangeInfo matrix.
- Field Value:
- 0
public static final int RIGHT
A constant for the value label position (right of the thermometer).
- Field Value:
- 1
public static final int UNITS_FAHRENHEIT
A constant for unit type 'Fahrenheit'.
- Field Value:
- 1
protected static ResourceBundle localizationResources
The resourceBundle for the localization.
public ThermometerPlot(ValueDataset dataset)
Creates a new thermometer plot, using default attributes where necessary.
- Parameters:
dataset
- the data set.
public Object clone() throws CloneNotSupportedException
Returns a clone of the plot.
- Returns:
- A clone.
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.
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).
- 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.
public boolean equals(Object obj)
Tests this plot for equality with another object. The plot's dataset is not considered in the test.
- Parameters:
obj
- the object (null
permitted).
- Returns:
true
orfalse
.
public int getAxisLocation()
Returns the axis location.
- See Also:
setAxisLocation(int)
public int getBulbDiameter()
Returns the bulb diameter, which is always twice the value returned bygetBulbRadius()
.
- Returns:
- The bulb diameter.
- Since:
- 1.0.7
public int getBulbRadius()
Returns the bulb radius, in Java2D units.
- Returns:
- The bulb radius.
- Since:
- 1.0.7
public int getColumnDiameter()
Returns the column diameter, which is always twice the value returned bygetColumnRadius()
.
- Returns:
- The column diameter.
- Since:
- 1.0.7
public int getColumnRadius()
Returns the column radius, in Java2D units.
- Returns:
- The column radius.
- Since:
- 1.0.7
- See Also:
setColumnRadius(int)
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.
public ValueDataset getDataset()
Returns the dataset for the plot.
- Returns:
- The dataset (possibly
null
).
- See Also:
setDataset(ValueDataset)
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.
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)
public LegendItemCollection getLegendItems()
Returns the legend items for the plot.
- Specified by:
- getLegendItems in interface LegendItemSource
- Overrides:
- getLegendItems in interface Plot
- Returns:
null
.
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)
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
public Paint getMercuryPaint()
Returns the default mercury paint.
- Returns:
- The paint (never
null
).
- See Also:
setMercuryPaint(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.
- Returns:
- The minimum value in either the domain or the range.
public PlotOrientation getOrientation()
Returns the orientation of the plot.
- Specified by:
- getOrientation in interface Zoomable
- Returns:
- The orientation (always
PlotOrientation.VERTICAL
).
public 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)
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.
public ValueAxis getRangeAxis()
Returns the range axis.
- Returns:
- The range axis (never
null
).
- See Also:
setRangeAxis(ValueAxis)
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)
public Paint getSubrangePaint(int range)
Gets the paint used for a particular subrange.
- Parameters:
range
- the range (.
- Returns:
- The paint.
- See Also:
setSubrangePaint(int,Paint)
public Paint getThermometerPaint()
Returns the paint used to draw the thermometer outline.
- Returns:
- The paint (never
null
).
public Stroke getThermometerStroke()
Returns the stroke used to draw the thermometer outline.
- Returns:
- The stroke (never
null
).
public int getUnits()
Returns a code indicating the unit display type. This is one ofUNITS_NONE
,UNITS_FAHRENHEIT
,UNITS_CELCIUS
andUNITS_KELVIN
.
- Returns:
- The units type.
- See Also:
setUnits(int)
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)
public boolean getUseSubrangePaint()
Returns a flag that controls whether or not the mercury color changes for each subrange.
- Returns:
- The flag.
- See Also:
setUseSubrangePaint(boolean)
public Font getValueFont()
Gets the font used to display the current value.
- Returns:
- The font.
- See Also:
setValueFont(Font)
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.
- Returns:
- The paint.
- See Also:
setValuePaint(Paint)
public boolean isDomainZoomable()
Returnsfalse
.
- Specified by:
- isDomainZoomable in interface Zoomable
- Returns:
- A boolean.
public boolean isRangeZoomable()
Returnstrue
.
- Specified by:
- isRangeZoomable in interface Zoomable
- Returns:
- A boolean.
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, andfalse
otherwise.
public void setAxisLocation(int location)
Sets the location at which the axis is displayed relative to the thermometer, and sends aPlotChangeEvent
to all registered listeners.
- See Also:
getAxisLocation()
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 aPlotChangeEvent
to all registered listeners.
- Parameters:
r
- the new radius (in Java2D units).
- Since:
- 1.0.7
- See Also:
getBulbRadius()
public void setColumnRadius(int r)
Sets the column radius (in Java2D units) and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
r
- the new radius.
- Since:
- 1.0.7
- See Also:
getColumnRadius()
public void setDataset(ValueDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there is one, and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
dataset
- the dataset (null
permitted).
- See Also:
getDataset()
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.
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.
public void setGap(int gap)
Sets the gap (in Java2D units) between the two outlines that represent the thermometer, and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
gap
- the new gap.
- Since:
- 1.0.7
- See Also:
getGap()
public void setLowerBound(double lower)
Sets the lower bound for the thermometer.
- Parameters:
lower
- the lower bound.
- See Also:
getLowerBound()
public void setMercuryPaint(Paint paint)
Sets the default mercury paint and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
paint
- the new paint (null
not permitted).
- See Also:
getMercuryPaint()
public void setPadding(RectangleInsets padding)
Sets the padding for the thermometer and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
padding
- the padding (null
not permitted).
- See Also:
getPadding()
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.
public void setRangeAxis(ValueAxis axis)
Sets the range axis for the plot and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
axis
- the new axis (null
not permitted).
- See Also:
getRangeAxis()
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()
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.
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 rangehi
- the high value for the range
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 valuerangeHigh
- the new rangeInfo valuedisplayLow
- the new rangeInfo valuedisplayHigh
- the new rangeInfo value
public void setSubrangePaint(int range, Paint paint)
Sets the paint to be used for a subrange and sends aPlotChangeEvent
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)
public void setThermometerPaint(Paint paint)
Sets the paint used to draw the thermometer outline and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
paint
- the new paint (null
ignored).
- See Also:
getThermometerPaint()
public void setThermometerStroke(Stroke s)
Sets the stroke used to draw the thermometer outline and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
s
- the new stroke (null
ignored).
- See Also:
getThermometerStroke()
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).
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()
public void setUpperBound(double upper)
Sets the upper bound for the thermometer.
- Parameters:
upper
- the upper bound.
- See Also:
getUpperBound()
public void setUseSubrangePaint(boolean flag)
Sets the range colour change option.
- Parameters:
flag
- the new range colour change option
- See Also:
getUseSubrangePaint()
public void setValueFont(Font f)
Sets the font used to display the current value.
- Parameters:
f
- the new font (null
not permitted).
- See Also:
getValueFont()
public void setValueFormat(NumberFormat formatter)
Sets the formatter for the value label and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
formatter
- the new formatter (null
not permitted).
public void setValueLocation(int location)
Sets the location at which the current value is displayed and sends aPlotChangeEvent
to all registered listeners. The location can be one of the constants:NONE
,RIGHT
LEFT
andBULB
.
- Parameters:
location
- the location.
public void setValuePaint(Paint paint)
Sets the paint used to display the current value and sends aPlotChangeEvent
to all registered listeners.
- Parameters:
paint
- the new paint (null
not permitted).
- See Also:
getValuePaint()
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.
- Parameters:
percent
- the zoom percentage.
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.
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.
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
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.
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.
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