|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.plot.Plot
org.jfree.chart.plot.MeterPlot
A plot that displays a single value in the context of several ranges ('normal', 'warning' and 'critical').
Field Summary | |
static int |
CRITICAL_DATA_RANGE
Constant to indicate the critical data range. |
static java.lang.String |
CRITICAL_TEXT
The default text for the critical level. |
static java.awt.Paint |
DEFAULT_BACKGROUND_PAINT
The default background color. |
static float |
DEFAULT_BORDER_SIZE
The default border size. |
static float |
DEFAULT_CIRCLE_SIZE
The default circle size. |
static java.awt.Font |
DEFAULT_LABEL_FONT
The default label font. |
static int |
DEFAULT_METER_ANGLE
The default meter angle. |
static int |
DIALTYPE_CHORD
Constant for meter type 'chord'. |
static int |
DIALTYPE_CIRCLE
Constant for meter type 'circle'. |
static int |
DIALTYPE_PIE
Constant for meter type 'pie'. |
static int |
FULL_DATA_RANGE
Constant to indicate the full data range. |
protected static java.util.ResourceBundle |
localizationResources
The resourceBundle for the localization. |
static int |
NO_LABELS
Constant for the label type. |
static int |
NORMAL_DATA_RANGE
Constant to indicate the normal data range. |
static java.lang.String |
NORMAL_TEXT
The default text for the normal level. |
static int |
VALUE_LABELS
Constant for the label type. |
static int |
WARNING_DATA_RANGE
Constant to indicate the warning data range. |
static java.lang.String |
WARNING_TEXT
The default text for the warning level. |
Fields inherited from class org.jfree.chart.plot.Plot |
DEFAULT_BACKGROUND_ALPHA, 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 | |
MeterPlot()
Creates a new plot with no dataset. |
|
MeterPlot(ValueDataset dataset)
Creates a new plot that displays the value in the supplied dataset. |
Method Summary | |
java.lang.Object |
clone()
Correct cloning support, management of deeper copies and listeners |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
PlotState parentState,
PlotRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
protected void |
drawArc(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
double minValue,
double maxValue,
java.awt.Paint paint)
Draws an arc. |
protected void |
drawArc(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D area,
double minValue,
double maxValue,
java.awt.Paint paint,
int outlineType)
Draws an arc. |
protected void |
drawArcFor(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D meterArea,
ValueDataset data,
int type)
Draws a colored range (arc) for one level. |
protected void |
drawTick(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D meterArea,
double value)
Draws a tick. |
protected void |
drawTick(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D meterArea,
double value,
boolean label,
java.awt.Paint color)
Draws a tick. |
protected void |
drawTick(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D meterArea,
double value,
boolean label,
java.awt.Paint labelPaint,
boolean curValue,
java.lang.String units)
Draws a tick on the chart (also handles a special case [curValue=true] that draws the value in the middle of the dial). |
protected void |
drawTicks(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D meterArea,
double minValue,
double maxValue)
Draws the ticks. |
boolean |
equals(java.lang.Object object)
Tests the plot for equality with an arbitrary object. |
java.awt.Paint |
getCriticalBackgroundPaint()
Returns the background paint used to display the 'critical' range. |
java.awt.Paint |
getCriticalPaint()
Returns the paint used to display the 'critical' range. |
Range |
getCriticalRange()
Returns the critical range for the dial. |
ValueDataset |
getDataset()
Returns the primary dataset for the plot. |
java.awt.Paint |
getDialBackgroundPaint()
Returns the paint for the dial background. |
java.awt.Paint |
getDialOutlinePaint()
Returns the dial outline paint. |
DialShape |
getDialShape()
Returns the dial shape. |
boolean |
getDrawBorder()
Returns a flag that controls whether or not a rectangular border is drawn around the plot area. |
LegendItemCollection |
getLegendItems()
Returns null. |
int |
getMeterAngle()
Returns the meter angle. |
java.awt.Paint |
getNeedlePaint()
Returns the paint for the needle. |
java.awt.Paint |
getNormalBackgroundPaint()
Returns the background paint for the 'normal' level. |
java.awt.Paint |
getNormalPaint()
Returns the paint for the 'normal' level. |
Range |
getNormalRange()
Returns the normal range for the dial. |
java.lang.String |
getPlotType()
Returns a short string describing the type of plot. |
Range |
getRange()
Returns the overall range for the dial. |
java.awt.Font |
getTickLabelFont()
Returns the tick label font. |
java.text.NumberFormat |
getTickLabelFormat()
Returns the tick label format. |
int |
getTickLabelType()
Returns the tick label type. |
java.lang.String |
getUnits()
Returns the units for the dial. |
java.awt.Font |
getValueFont()
Returns the font for the value label. |
java.awt.Paint |
getValuePaint()
Returns the paint for the value label. |
java.awt.Paint |
getWarningBackgroundPaint()
Returns the background paint used to display the 'warning' range. |
java.awt.Paint |
getWarningPaint()
Returns the paint used to display the 'warning' range. |
Range |
getWarningRange()
Returns the warning range for the dial. |
void |
setCriticalBackgroundPaint(java.awt.Paint paint)
Sets the background paint used to display the 'critical' range. |
void |
setCriticalPaint(java.awt.Paint paint)
Sets the paint used to display the 'critical' range. |
void |
setCriticalRange(Range range)
Sets the critical range for the dial. |
void |
setDataset(ValueDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there is one. |
void |
setDialBackgroundPaint(java.awt.Paint paint)
Sets the paint used to fill the dial background. |
void |
setDialOutlinePaint(java.awt.Paint paint)
Sets the dial outline paint. |
void |
setDialShape(DialShape shape)
Sets the dial shape. |
void |
setDrawBorder(boolean draw)
Sets the flag that controls whether or not a rectangular border is drawn around the plot area. |
void |
setMeterAngle(int angle)
Sets the range through which the dial's needle is free to rotate. |
void |
setNeedlePaint(java.awt.Paint paint)
Sets the paint used to display the needle. |
void |
setNormalBackgroundPaint(java.awt.Paint paint)
Sets the background paint used to display the 'normal' range. |
void |
setNormalPaint(java.awt.Paint paint)
Sets the paint used to display the 'normal' range. |
void |
setNormalRange(Range range)
Sets the normal range for the dial. |
void |
setRange(Range range)
Sets the overall range for the dial. |
void |
setTickLabelFont(java.awt.Font font)
Sets the tick label font and sends a PlotChangeEvent to all registered listeners. |
void |
setTickLabelFormat(java.text.NumberFormat format)
Sets the format for the tick labels and sends a PlotChangeEvent to
all registered listeners. |
void |
setTickLabelType(int type)
Sets the tick label type. |
void |
setUnits(java.lang.String units)
Sets the units for the dial. |
void |
setValueFont(java.awt.Font font)
Sets the font used to display the value label. |
void |
setValuePaint(java.awt.Paint paint)
Sets the paint used to display the value label. |
void |
setWarningBackgroundPaint(java.awt.Paint paint)
Sets the background paint used to display the 'warning' range. |
void |
setWarningPaint(java.awt.Paint paint)
Sets the paint used to display the 'warning' range. |
void |
setWarningRange(Range range)
Sets the warning range for the dial. |
void |
zoom(double percent)
A zoom method that does nothing. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NORMAL_DATA_RANGE
public static final int WARNING_DATA_RANGE
public static final int CRITICAL_DATA_RANGE
public static final int FULL_DATA_RANGE
public static final java.lang.String NORMAL_TEXT
public static final java.lang.String WARNING_TEXT
public static final java.lang.String CRITICAL_TEXT
public static final int DEFAULT_METER_ANGLE
public static final float DEFAULT_BORDER_SIZE
public static final float DEFAULT_CIRCLE_SIZE
public static final java.awt.Paint DEFAULT_BACKGROUND_PAINT
public static final java.awt.Font DEFAULT_LABEL_FONT
public static final int NO_LABELS
public static final int VALUE_LABELS
protected static java.util.ResourceBundle localizationResources
public static final int DIALTYPE_PIE
public static final int DIALTYPE_CIRCLE
public static final int DIALTYPE_CHORD
Constructor Detail |
public MeterPlot()
public MeterPlot(ValueDataset dataset)
dataset
- the dataset (null
permitted).Method Detail |
public java.lang.String getUnits()
public void setUnits(java.lang.String units)
units
- the units.public Range getRange()
public void setRange(Range range)
range
- the range (null
not permitted).public Range getNormalRange()
public void setNormalRange(Range range)
range
- the range.public Range getWarningRange()
public void setWarningRange(Range range)
range
- the range.public Range getCriticalRange()
public void setCriticalRange(Range range)
range
- the range.public DialShape getDialShape()
public void setDialShape(DialShape shape)
shape
- the shape.public java.awt.Paint getDialBackgroundPaint()
null
).public void setDialBackgroundPaint(java.awt.Paint paint)
paint
- the paint (null
permitted).public java.awt.Paint getNeedlePaint()
public void setNeedlePaint(java.awt.Paint paint)
If you set this to null, it will revert to the default color.
paint
- The paint.public java.awt.Font getValueFont()
public void setValueFont(java.awt.Font font)
If you set this to null, it will revert to the default font.
font
- The font.public java.awt.Paint getValuePaint()
public void setValuePaint(java.awt.Paint paint)
If you set this to null, it will revert to the default paint.
paint
- The paint.public java.awt.Paint getNormalPaint()
public void setNormalPaint(java.awt.Paint paint)
If you set this to null, it will revert to the default color.
paint
- The paint.public java.awt.Paint getNormalBackgroundPaint()
null
).public void setNormalBackgroundPaint(java.awt.Paint paint)
paint
- The paint (null
permitted).public java.awt.Paint getWarningPaint()
public void setWarningPaint(java.awt.Paint paint)
If you set this to null, it will revert to the default color.
paint
- The paint.public java.awt.Paint getWarningBackgroundPaint()
null
).public void setWarningBackgroundPaint(java.awt.Paint paint)
paint
- the paint (null
permitted).public java.awt.Paint getCriticalPaint()
public void setCriticalPaint(java.awt.Paint paint)
If you set this to null, it will revert to the default color.
paint
- The paint.public java.awt.Paint getCriticalBackgroundPaint()
null
).public void setCriticalBackgroundPaint(java.awt.Paint paint)
paint
- the paint (null
permitted).public int getTickLabelType()
public void setTickLabelType(int type)
type
- the type of tick labels - either NO_LABELS
or
VALUE_LABELS
public java.awt.Font getTickLabelFont()
null
).public void setTickLabelFont(java.awt.Font font)
PlotChangeEvent
to all registered listeners.
font
- the font (null
not permitted).public java.text.NumberFormat getTickLabelFormat()
null
).public void setTickLabelFormat(java.text.NumberFormat format)
PlotChangeEvent
to
all registered listeners.
format
- the format (null
not permitted).public boolean getDrawBorder()
public void setDrawBorder(boolean draw)
Note: it looks like the true setting needs some work to provide some insets.
draw
- the flag.public int getMeterAngle()
public void setMeterAngle(int angle)
angle
- the angle.public java.awt.Paint getDialOutlinePaint()
public void setDialOutlinePaint(java.awt.Paint paint)
paint
- the paint.public ValueDataset getDataset()
null
).public void setDataset(ValueDataset dataset)
dataset
- the dataset (null
permitted).public LegendItemCollection getLegendItems()
getLegendItems
in interface LegendItemSource
getLegendItems
in class Plot
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, PlotState parentState, PlotRenderingInfo info)
draw
in class Plot
g2
- the graphics device.plotArea
- the area within which the plot should be drawn.parentState
- the state from the parent plot, if there is one.info
- collects info about the drawing.protected void drawArcFor(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D meterArea, ValueDataset data, int type)
g2
- The graphics device.meterArea
- The drawing area.data
- The dataset.type
- The level.protected void drawArc(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, double minValue, double maxValue, java.awt.Paint paint)
g2
- the graphics device.area
- the plot area.minValue
- the minimum value.maxValue
- the maximum value.paint
- the paint.protected void drawArc(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area, double minValue, double maxValue, java.awt.Paint paint, int outlineType)
g2
- the graphics device.area
- the plot area.minValue
- the minimum value.maxValue
- the maximum value.paint
- the paint.outlineType
- the outline type.protected void drawTicks(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D meterArea, double minValue, double maxValue)
g2
- the graphics device.meterArea
- the meter area.minValue
- the minimum value.maxValue
- the maximum value.protected void drawTick(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D meterArea, double value)
g2
- the graphics device.meterArea
- the meter area.value
- the value.protected void drawTick(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D meterArea, double value, boolean label, java.awt.Paint color)
g2
- the graphics device.meterArea
- the meter area.value
- the value.label
- the label.color
- the color.protected void drawTick(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D meterArea, double value, boolean label, java.awt.Paint labelPaint, boolean curValue, java.lang.String units)
g2
- the graphics device.meterArea
- the meter area.value
- the tick value.label
- a flag that controls whether or not a value label is drawn.labelPaint
- the label color.curValue
- a flag for the special case of the current value.units
- the unit-of-measure for the dial.public java.lang.String getPlotType()
getPlotType
in class Plot
public void zoom(double percent)
zoom
in class Plot
percent
- The zoom percentage.public boolean equals(java.lang.Object object)
equals
in class Plot
object
- the object (null
permitted).
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class Plot
java.lang.CloneNotSupportedException
- if some component of the plot does not
support cloning.Plot.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |