|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.chart.Plot
com.jrefinery.chart.ThermometerPlot
public class ThermometerPlot
A plot that displays a single value in a thermometer type display. NOTE: The Thermometer plot utilises a meter data set, however range options within this data set are not currently utilised. This is currently under consideration / development. The Thermometer supports a number of options 1. 3 ranges which could be viewed as Critical, Warning and Normal ranges. 2. The thermometer can be run in two modes: a. fixed range where colour changes on value, or b. 3 seperate ranges where colour changes with range changes. 3. Settable units to be displayed. 4. Settable display location for the value text
| Field Summary | |
|---|---|
static int |
BULB
|
protected static int |
bulbDiameter
|
protected static int |
bulbRadius
Some basic sizing options for the thermometer |
protected static int |
columnDiameter
|
protected static int |
columnRadius
|
static int |
CRITICAL
|
protected MeterDataset |
data
|
protected static int |
DISPLAY_HI
|
protected static int |
DISPLAY_LOW
|
protected static int |
DISPLAY_RANGE
|
protected boolean |
drawLines
|
protected boolean |
followValue
|
protected static int |
gapDiameter
|
protected static int |
gapRadius
|
protected boolean |
ignoreDataModelRangeChanges
Data Model Type : Basically used to enable / disable the code for supporting data model range changes. |
static int |
LEFT
|
protected static int |
legendWidth
|
static int |
NONE
the selection of where value is written on screen |
static int |
NORMAL
The three ranges |
protected java.awt.Color |
outerColour
Colour for the outline of the thermometer |
protected java.awt.Stroke |
outerStroke
Stokes for drawing |
protected int |
range
Two range variables are utilised to track which range is the current for the display and data. |
protected static int |
RANGE_HI
Index to Range information matrix |
protected static int |
RANGE_LOW
|
protected ValueAxis |
rangeAxis
|
protected int |
rangeData
|
protected int |
rangeIndcatorStrokeSize
|
protected double[][] |
rangeInfo
Matrix of range data |
protected java.awt.Stroke |
rangeInidcatorStroke
|
protected java.awt.Paint[] |
rangePaint
Paint for each range |
protected int |
units
The currently selected display units |
protected static java.lang.String[] |
UNITS
|
static int |
UNITS_CELCIUS
|
static int |
UNITS_FARINHEIGHT
|
static int |
UNITS_NONE
Units to be displayed |
protected java.awt.Color |
valueColour
Colour that the value is written in |
protected java.awt.Font |
valueFont
The font to write the value in |
protected java.text.DecimalFormat |
valueFormat
Number format for the value |
protected int |
valueLocation
Current location of where the value is written on screean |
static int |
WARNING
|
| Fields inherited from class com.jrefinery.chart.Plot |
|---|
backgroundAlpha, backgroundImage, backgroundPaint, dataset, DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, firstSeriesIndex, foregroundAlpha, insets, listeners, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, outlinePaint, outlineStroke, seriesOutlinePaint, seriesOutlineStroke, seriesPaint, seriesStroke, shapeFactory, ZERO |
| Fields inherited from interface com.jrefinery.chart.AxisConstants |
|---|
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_STROKE |
| Constructor Summary | |
|---|---|
ThermometerPlot()
|
|
ThermometerPlot(MeterDataset data)
Constructor for the ThermometerPlot object |
|
ThermometerPlot(MeterDataset data,
java.awt.Insets insets,
java.awt.Paint backgroundPaint,
java.awt.Image backgroundImage,
float backgroundAlpha,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint,
float foregroundAlpha)
Constructs a new plot. |
|
| Method Summary | |
|---|---|
void |
datasetChanged(DatasetChangeEvent event)
This is experimental, an early attempt to support data model ranges being changed |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
MeterDataset |
getData()
Returns the dataset. |
boolean |
getFollowData()
Get whether the thermometer paint changes with data (true) or range (false) |
java.util.List |
getLegendItemLabels()
|
java.lang.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. |
java.lang.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. |
java.awt.Stroke |
getOuterStroke()
|
java.lang.String |
getPlotType()
Returns a short string describing the type of plot. |
int |
getRangeIndicatorWidth()
Gets the width of the range inidictators |
java.awt.Paint |
getRangePaint(int range)
Gets the paint used for a particular range |
boolean |
getShowValueLines(boolean b)
|
int |
getUnits()
Gets the display units |
int |
getValueDisplayLocation()
Gets the display location for the value |
java.awt.Font |
getValueFont()
Gets the Font used to display the current value |
Range |
getVerticalDataRange()
Returns the range for the data to be plotted against the vertical axis. |
ValueAxis |
getVerticalValueAxis()
|
boolean |
isCompatibleHorizontalAxis(Axis axis)
Returns true if the axis is compatible with the meter plot, and false otherwise. |
boolean |
isCompatibleRangeAxis(ValueAxis axis)
Checks the compatibility of a range axis, returning true if the axis is compatible with the plot, and false otherwise. |
boolean |
isCompatibleVerticalAxis(Axis axis)
Returns true if the axis is compatible with the meter plot, and false otherwise. |
protected static boolean |
isValidNumber(double i)
Determine whether a number is valid and finite |
void |
propertyChange()
|
protected void |
setAxisRange()
|
void |
setData(MeterDataset data)
Sets the data for the chart, replacing any existing data. |
void |
setDisplayLocation(int loc)
|
void |
setDisplayRange(int range,
double low,
double hi)
|
void |
setFollowData(boolean v)
Sets the range colour change option. |
void |
setFont(java.awt.Font f)
Sets the font for the thermometer plot. |
void |
setOuterStoke(java.awt.Stroke s)
|
void |
setRange(int range,
double low,
double hi)
|
void |
setRangeAxis(ValueAxis axis)
Sets the range axis for the plot. |
void |
setRangeIndicatorWidth(int width)
Sets the width of the range inidctators. |
void |
setRangeInfo(int range,
double low,
double hi)
Sets information for a particular range |
void |
setRangeInfo(int range,
double range_low,
double range_hi,
double display_low,
double display_hi)
Sets the rangeInfo attribute of the ThermometerPlot object |
void |
setRangePaint(int range,
java.awt.Paint paint)
Sets the paint to be used for a range |
void |
setShowValueLines(boolean b)
Sets the display as to whether to show value lines in the output. |
void |
setThermometerColor(java.awt.Color c)
Set the outline colour of the thermometer |
void |
setUnits(int u)
Sets the units for this thermometer |
void |
setValueFont(java.awt.Font f)
Sets the font for the current value display |
void |
setValueFormat(java.text.DecimalFormat fo)
Sets the format attribute for the value label |
void |
zoom(double percent)
A zoom method that does nothing. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNITS_NONE
public static final int UNITS_FARINHEIGHT
public static final int UNITS_CELCIUS
protected static final java.lang.String[] UNITS
protected MeterDataset data
protected int units
public static final int NONE
public static final int LEFT
public static final int BULB
protected int valueLocation
protected static final int bulbRadius
protected static final int bulbDiameter
protected static final int columnRadius
protected static final int columnDiameter
protected static final int gapRadius
protected static final int gapDiameter
protected static final int legendWidth
public static int NORMAL
public static int WARNING
public static int CRITICAL
protected int range
protected int rangeData
protected static final int RANGE_HI
protected static final int RANGE_LOW
protected static final int DISPLAY_HI
protected static final int DISPLAY_LOW
protected static final int DISPLAY_RANGE
protected double[][] rangeInfo
protected java.awt.Paint[] rangePaint
protected java.awt.Color outerColour
protected java.awt.Color valueColour
protected java.awt.Font valueFont
protected java.text.DecimalFormat valueFormat
protected java.awt.Stroke outerStroke
protected java.awt.Stroke rangeInidcatorStroke
protected int rangeIndcatorStrokeSize
protected boolean followValue
protected boolean drawLines
protected boolean ignoreDataModelRangeChanges
protected ValueAxis rangeAxis
| Constructor Detail |
|---|
public ThermometerPlot()
public ThermometerPlot(MeterDataset data)
public ThermometerPlot(MeterDataset data,
java.awt.Insets insets,
java.awt.Paint backgroundPaint,
java.awt.Image backgroundImage,
float backgroundAlpha,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint,
float foregroundAlpha)
insets - Amount of blank space around the plot area.backgroundPaint - An optional color for the plot's background.backgroundImage - An optional image for the plot's background.backgroundAlpha - Alpha-transparency for the plot's background.outlineStroke - The Stroke used to draw an outline around the plot.outlinePaint - The color used to draw an outline around the plot.foregroundAlpha - The alpha-transparency for the plot foreground.| Method Detail |
|---|
public void setRangeAxis(ValueAxis axis)
throws AxisNotCompatibleException
An exception is thrown if the new axis and the plot are not mutually compatible.
axis - The new axis (null permitted).
AxisNotCompatibleExceptionpublic void zoom(double percent)
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.
zoom in class Plotpercent - The zoom percentage.public java.lang.String getPlotType()
getPlotType in class Plotpublic MeterDataset getData()
Provided for convenience.
public void setData(MeterDataset data)
Registered listeners are notified that the chart has been modified.
data - The new dataset.public boolean isCompatibleHorizontalAxis(Axis axis)
axis - The axis.
public boolean isCompatibleVerticalAxis(Axis axis)
axis - The axis.
protected static boolean isValidNumber(double i)
i - The number to be tested
public void setValueFormat(java.text.DecimalFormat fo)
fo - The new value formatpublic int getValueDisplayLocation()
public void setUnits(int u)
u - The new units valuepublic void setFont(java.awt.Font f)
f - The new font value.public void setValueFont(java.awt.Font f)
f - The new value fontpublic int getUnits()
public java.awt.Font getValueFont()
public void setRangePaint(int range,
java.awt.Paint paint)
range - The rangepaint - The paint to be appliedpublic java.awt.Paint getRangePaint(int range)
range - The range
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartRenderingInfo info)
draw in class Plotg2 - The graphics device.plotArea - The area within which the plot should be drawn.info - Collects info about the drawing.
public void setRangeInfo(int range,
double low,
double hi)
range - The range to specify information abouthi - The High value for the rangelow - The Low value for the range
public void setRangeInfo(int range,
double range_low,
double range_hi,
double display_low,
double display_hi)
range - The new rangeInfo valuerange_hi - The new rangeInfo valuerange_low - The new rangeInfo valuedisplay_hi - The new rangeInfo valuedisplay_low - The new rangeInfo value
public void setRange(int range,
double low,
double hi)
public void setDisplayRange(int range,
double low,
double hi)
public void setDisplayLocation(int loc)
public void setThermometerColor(java.awt.Color c)
c - new colour to set the outline of the thermometerpublic void datasetChanged(DatasetChangeEvent event)
datasetChanged in interface DatasetChangeListenerdatasetChanged in class Plotevent - Information about the event (not used here).public java.lang.Number getMinimumVerticalDataValue()
public java.lang.Number getMaximumVerticalDataValue()
public Range getVerticalDataRange()
VerticalValuePlot
getVerticalDataRange in interface VerticalValuePlotpublic void setShowValueLines(boolean b)
b - Whether to show value lines in the thermometerpublic boolean getShowValueLines(boolean b)
public void setFollowData(boolean v)
b - The new range colour change optionpublic boolean getFollowData()
public void setRangeIndicatorWidth(int width)
size - the width of the inidcator. valid range 0-15 inclusivepublic int getRangeIndicatorWidth()
public void setOuterStoke(java.awt.Stroke s)
public java.awt.Stroke getOuterStroke()
public void propertyChange()
protected void setAxisRange()
public java.util.List getLegendItemLabels()
getLegendItemLabels in class Plotpublic boolean isCompatibleRangeAxis(ValueAxis axis)
axis - The proposed axis.
public ValueAxis getVerticalValueAxis()
getVerticalValueAxis in interface VerticalValuePlot
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||