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 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 |
|
Range |
|
ValueDataset |
|
boolean |
|
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 |
|
public static final int BULB
A constant for the value label position (in the thermometer bulb).
- Field Value:
- 3
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
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 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 primary dataset for the plot.
- Returns:
- The primary dataset (possibly
null
).
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 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.
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.
- Returns:
- The maximum value in either the domain or the range
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.
- 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.
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 boolean getShowValueLines()
Returns the flag that controls whether not value lines are displayed.
- Returns:
- The flag.
public Paint getSubrangePaint(int range)
Gets the paint used for a particular subrange.
- Parameters:
range
- the range.
- Returns:
- The paint.
public Paint getThermometerPaint()
Returns the paint used to draw the thermometer outline.
- Returns:
- The paint.
public Stroke getThermometerStroke()
Returns the stroke used to draw the thermometer outline.
- Returns:
- The stroke.
public int getUnits()
Returns the unit display type (none/Fahrenheit/Celcius/Kelvin).
- Returns:
- The units type.
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.
public boolean getUseSubrangePaint()
Returns a flag that controls whether or not the mercury color changes for each subrange.
- Returns:
- The flag.
public Font getValueFont()
Gets the font used to display the current value.
- Returns:
- The font.
public Paint getValuePaint()
Gets the paint used to display the current value.
- Returns:
- The 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 with reference to the bulb. The location can be one of the constants:NONE
,RIGHT
andLEFT
.
- Parameters:
location
- the location.
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.
- Parameters:
dataset
- the dataset (null
permitted).
public void setDisplayRange(int range, double low, double high)
Sets the display 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 setLowerBound(double lower)
Sets the lower bound for the thermometer.
- Parameters:
lower
- the lower bound.
public void setMercuryPaint(Paint paint)
Sets the default mercury paint.
- Parameters:
paint
- the new paint.
public void setPadding(RectangleInsets padding)
Sets the padding for the thermometer.
- Parameters:
padding
- the padding.
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.
- Parameters:
axis
- the new axis.
public void setShowValueLines(boolean b)
Sets the display as to whether to show value lines in the output.
- Parameters:
b
- Whether to show value lines in the thermometer
public void setSubrange(int range, double low, double high)
Sets the range.
- 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 range.
- Parameters:
range
- the range.paint
- the paint to be applied.
public void setThermometerPaint(Paint paint)
Sets the paint used to draw the thermometer outline.
- Parameters:
paint
- the new paint (null ignored).
public void setThermometerStroke(Stroke s)
Sets the stroke used to draw the thermometer outline.
- Parameters:
s
- the new stroke (null ignored).
public void setUnits(String u)
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.
public void setUpperBound(double upper)
Sets the upper bound for the thermometer.
- Parameters:
upper
- the upper bound.
public void setUseSubrangePaint(boolean flag)
Sets the range colour change option.
- Parameters:
flag
- The new range colour change option
public void setValueFont(Font f)
Sets the font used to display the current value.
- Parameters:
f
- the new font.
public void setValueFormat(NumberFormat formatter)
Sets the formatter for the value label.
- Parameters:
formatter
- the new formatter.
public void setValueLocation(int location)
Sets the location at which the current value is displayed. The location can be one of the constants:NONE
,RIGHT
LEFT
andBULB
.
- Parameters:
location
- the location.
public void setValuePaint(Paint p)
Sets the paint used to display the current value.
- Parameters:
p
- the new paint.
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 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.