|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Plot | +--com.jrefinery.chart.MeterPlot
A plot that displays a single value in the context of several ranges ('normal', 'warning' and 'critical').
Field Summary | |
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 |
NO_LABELS
Constant for the label type. |
static java.lang.String |
NORMAL_TEXT
The default text for the normal level. |
static int |
VALUE_LABELS
Constant for the label type. |
static java.lang.String |
WARNING_TEXT
The default text for the warning level. |
Fields inherited from class com.jrefinery.chart.Plot |
backgroundAlpha, backgroundImage, backgroundPaint, dataset, DEFAULT_BACKGROUND_ALPHA, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, foregroundAlpha, insets, listenerList, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, noDataMessage, noDataMessageFont, 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_PAINT, DEFAULT_TICK_STROKE |
Constructor Summary | |
MeterPlot(MeterDataset data)
Default constructor. |
|
MeterPlot(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,
int tickLabelType,
java.awt.Font tickLabelFont)
Constructs a new meter plot. |
Method Summary | |
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). |
java.awt.Paint |
getCriticalPaint()
Returns the paint used to display the 'critical' range. |
java.awt.Paint |
getDialBackgroundPaint()
Returns the paint for the dial background. |
java.awt.Color |
getDialBorderColor()
Returns the color of the border for the dial. |
int |
getDialType()
Returns the type of dial (DIALTYPE_PIE, DIALTYPE_CIRCLE, DIALTYPE_CHORD). |
boolean |
getDrawBorder()
Returns a flag that controls whether or not a rectangular border is drawn around the plot area. |
java.util.List |
getLegendItemLabels()
Deprecated. use getLegendItems(). |
LegendItemCollection |
getLegendItems()
Returns null. |
int |
getMeterAngle()
Returns the meter angle. |
MeterDataset |
getMeterDataset()
Returns the dataset for the plot, cast as a MeterDataset. |
java.awt.Paint |
getNeedlePaint()
Returns the paint for the needle. |
java.awt.Paint |
getNormalPaint()
Returns the paint for the 'normal' level. |
java.lang.String |
getPlotType()
Returns a short string describing the type of plot. |
java.awt.Font |
getTickLabelFont()
Returns the tick label font. |
int |
getTickLabelType()
Returns the tick label type. |
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 |
getWarningPaint()
Returns the paint used to display the 'warning' range. |
void |
setCriticalPaint(java.awt.Paint paint)
Sets the paint used to display the 'critical' range. |
void |
setDialBackgroundPaint(java.awt.Paint paint)
Sets the paint used to fill the dial background. |
void |
setDialBorderColor(java.awt.Color color)
Sets the color for the border of the dial. |
void |
setDialType(int type)
Sets the dial type (background 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 |
setNormalPaint(java.awt.Paint paint)
Sets the paint used to display the 'normal' range. |
void |
setTickLabelFont(java.awt.Font font)
Sets the tick label font and notifies registered listeners that the plot has been changed. |
void |
setTickLabelType(int type)
Sets the tick label type. |
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 |
setWarningPaint(java.awt.Paint paint)
Sets the paint used to display the 'warning' range. |
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 DIALTYPE_PIE
public static final int DIALTYPE_CIRCLE
public static final int DIALTYPE_CHORD
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
Constructor Detail |
public MeterPlot(MeterDataset data)
data
- The dataset.public MeterPlot(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, int tickLabelType, java.awt.Font tickLabelFont)
data
- the data series.insets
- the plot insets.backgroundPaint
- the background color.backgroundImage
- the background image.backgroundAlpha
- the background alpha-transparency.outlineStroke
- the outline stroke.outlinePaint
- the outline paint.foregroundAlpha
- the foreground alpha-transparency.tickLabelType
- the label type.tickLabelFont
- the label font.Method Detail |
public int getDialType()
public void setDialType(int type)
This controls the shape of the dial background. Use one of the constants: DIALTYPE_PIE, DIALTYPE_CIRCLE, or DIALTYPE_CHORD.
type
- The dial type.public java.awt.Paint getDialBackgroundPaint()
public void setDialBackgroundPaint(java.awt.Paint paint)
If you set this to null, it will revert to the default color.
paint
- The paint.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 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 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 int getTickLabelType()
public void setTickLabelType(int type)
type
- the type of tick labels - either NO_LABELS
or
VALUE_LABELS
public java.awt.Font getTickLabelFont()
public void setTickLabelFont(java.awt.Font font)
font
- The new tick label font.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.Color getDialBorderColor()
public void setDialBorderColor(java.awt.Color color)
color
- the color.public MeterDataset getMeterDataset()
Provided for convenience.
public java.util.List getLegendItemLabels()
getLegendItemLabels
in class Plot
public LegendItemCollection getLegendItems()
getLegendItems
in class Plot
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, ChartRenderingInfo info)
draw
in class Plot
g2
- The graphics device.plotArea
- The area within which the plot should be drawn.info
- Collects info about the drawing.public java.lang.String getPlotType()
getPlotType
in class Plot
public void zoom(double percent)
Plots are required to support the zoom operation. In the case of a pie chart, it doesn't make sense to zoom in or out, so the method is empty.
zoom
in class Plot
percent
- The zoom percentage.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |