public class MeterPlot extends Plot implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_BORDER_SIZE
The default border size.
|
static float |
DEFAULT_CIRCLE_SIZE
The default circle size.
|
static Font |
DEFAULT_LABEL_FONT
The default label font.
|
static int |
DEFAULT_METER_ANGLE
The default meter angle.
|
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 and Description |
---|
MeterPlot()
Creates a new plot with a default range of
0 to
100 and no value to display. |
MeterPlot(ValueDataset dataset)
Creates a new plot that displays the value from the supplied dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addInterval(MeterInterval interval)
Adds an interval and sends a
PlotChangeEvent to all registered
listeners. |
void |
clearIntervals()
Clears the intervals for the plot and sends a
PlotChangeEvent to
all registered listeners. |
Object |
clone()
Returns an independent copy (clone) of the plot.
|
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).
|
boolean |
equals(Object obj)
Tests the plot for equality with an arbitrary object.
|
ValueDataset |
getDataset()
Returns the dataset for the plot.
|
Paint |
getDialBackgroundPaint()
Returns the paint for the dial background.
|
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.
|
List |
getIntervals()
Returns an unmodifiable list of the intervals for the plot.
|
LegendItemCollection |
getLegendItems()
Returns an item for each interval.
|
int |
getMeterAngle()
Returns the meter angle in degrees.
|
Paint |
getNeedlePaint()
Returns the paint for the needle.
|
String |
getPlotType()
Returns a short string describing the type of plot.
|
Range |
getRange()
Returns the overall range for the dial.
|
Font |
getTickLabelFont()
Returns the tick label font.
|
NumberFormat |
getTickLabelFormat()
Returns the tick label format.
|
Paint |
getTickLabelPaint()
Returns the tick label paint.
|
boolean |
getTickLabelsVisible()
Returns the flag that determines whether or not tick labels are visible.
|
Paint |
getTickPaint()
Returns the paint used to draw the ticks around the dial.
|
double |
getTickSize()
Returns the tick size (the interval between ticks on the dial).
|
String |
getUnits()
Returns a string describing the units for the dial.
|
Font |
getValueFont()
Returns the font for the value label.
|
Paint |
getValuePaint()
Returns the paint for the value label.
|
void |
setDataset(ValueDataset dataset)
Sets the dataset for the plot, replacing the existing dataset if there
is one, and triggers a
PlotChangeEvent . |
void |
setDialBackgroundPaint(Paint paint)
Sets the paint used to fill the dial background.
|
void |
setDialOutlinePaint(Paint paint)
Sets the dial outline paint and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDialShape(DialShape shape)
Sets the dial shape and sends a
PlotChangeEvent to all
registered listeners. |
void |
setDrawBorder(boolean draw)
Sets the flag that controls whether or not a rectangular border is drawn
around the plot area and sends a
PlotChangeEvent to all
registered listeners. |
void |
setMeterAngle(int angle)
Sets the angle (in degrees) for the whole range of the dial and sends
a
PlotChangeEvent to all registered listeners. |
void |
setNeedlePaint(Paint paint)
Sets the paint used to display the needle and sends a
PlotChangeEvent to all registered listeners. |
void |
setRange(Range range)
Sets the range for the dial and sends a
PlotChangeEvent to all
registered listeners. |
void |
setTickLabelFont(Font font)
Sets the tick label font and sends a
PlotChangeEvent to all
registered listeners. |
void |
setTickLabelFormat(NumberFormat format)
Sets the format for the tick labels and sends a
PlotChangeEvent
to all registered listeners. |
void |
setTickLabelPaint(Paint paint)
Sets the tick label paint and sends a
PlotChangeEvent to all
registered listeners. |
void |
setTickLabelsVisible(boolean visible)
Sets the flag that controls whether or not the tick labels are visible
and sends a
PlotChangeEvent to all registered listeners. |
void |
setTickPaint(Paint paint)
Sets the paint used to draw the tick labels around the dial and sends
a
PlotChangeEvent to all registered listeners. |
void |
setTickSize(double size)
Sets the tick size and sends a
PlotChangeEvent to all
registered listeners. |
void |
setUnits(String units)
Sets the units for the dial and sends a
PlotChangeEvent to all
registered listeners. |
void |
setValueFont(Font font)
Sets the font used to display the value label and sends a
PlotChangeEvent to all registered listeners. |
void |
setValuePaint(Paint paint)
Sets the paint used to display the value label and sends a
PlotChangeEvent to all registered listeners. |
double |
valueToAngle(double value)
Translates a data value to an angle on the dial.
|
void |
zoom(double percent)
A zoom method that does nothing.
|
addChangeListener, annotationChanged, axisChanged, datasetChanged, drawBackground, drawBackgroundImage, drawOutline, getBackgroundAlpha, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getDatasetGroup, getDrawingSupplier, getForegroundAlpha, getInsets, getNoDataMessage, getNoDataMessageFont, getNoDataMessagePaint, getOutlinePaint, getOutlineStroke, getParent, getRootPlot, handleClick, isNotify, isOutlineVisible, isSubplot, markerChanged, notifyListeners, removeChangeListener, resolveDomainAxisLocation, resolveRangeAxisLocation, setBackgroundAlpha, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setDrawingSupplier, setDrawingSupplier, setForegroundAlpha, setInsets, setInsets, setNoDataMessage, setNoDataMessageFont, setNoDataMessagePaint, setNotify, setOutlinePaint, setOutlineStroke, setOutlineVisible, setParent
public static final int DEFAULT_METER_ANGLE
public static final float DEFAULT_BORDER_SIZE
public static final float DEFAULT_CIRCLE_SIZE
public static final Font DEFAULT_LABEL_FONT
public MeterPlot()
0
to
100
and no value to display.public MeterPlot(ValueDataset dataset)
dataset
- the dataset (null
permitted).public DialShape getDialShape()
DialShape.CIRCLE
).null
).setDialShape(DialShape)
public void setDialShape(DialShape shape)
PlotChangeEvent
to all
registered listeners.shape
- the shape (null
not permitted).getDialShape()
public int getMeterAngle()
setMeterAngle(int)
public void setMeterAngle(int angle)
PlotChangeEvent
to all registered listeners.angle
- the angle (in degrees, in the range 1-360).getMeterAngle()
public Range getRange()
null
).setRange(Range)
public void setRange(Range range)
PlotChangeEvent
to all
registered listeners.range
- the range (null
not permitted and zero-length
ranges not permitted).getRange()
public double getTickSize()
setTickSize(double)
public void setTickSize(double size)
PlotChangeEvent
to all
registered listeners.size
- the tick size (must be > 0).getTickSize()
public Paint getTickPaint()
null
).setTickPaint(Paint)
public void setTickPaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getTickPaint()
public String getUnits()
null
).setUnits(String)
public void setUnits(String units)
PlotChangeEvent
to all
registered listeners.units
- the units (null
permitted).getUnits()
public Paint getNeedlePaint()
null
).setNeedlePaint(Paint)
public void setNeedlePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getNeedlePaint()
public boolean getTickLabelsVisible()
setTickLabelsVisible(boolean)
public void setTickLabelsVisible(boolean visible)
PlotChangeEvent
to all registered listeners.visible
- the flag.getTickLabelsVisible()
public Font getTickLabelFont()
null
).setTickLabelFont(Font)
public void setTickLabelFont(Font font)
PlotChangeEvent
to all
registered listeners.font
- the font (null
not permitted).getTickLabelFont()
public Paint getTickLabelPaint()
null
).setTickLabelPaint(Paint)
public void setTickLabelPaint(Paint paint)
PlotChangeEvent
to all
registered listeners.paint
- the paint (null
not permitted).getTickLabelPaint()
public NumberFormat getTickLabelFormat()
null
).setTickLabelFormat(NumberFormat)
public void setTickLabelFormat(NumberFormat format)
PlotChangeEvent
to all registered listeners.format
- the format (null
not permitted).getTickLabelFormat()
public Font getValueFont()
null
).setValueFont(Font)
public void setValueFont(Font font)
PlotChangeEvent
to all registered listeners.font
- the font (null
not permitted).getValueFont()
public Paint getValuePaint()
null
).setValuePaint(Paint)
public void setValuePaint(Paint paint)
PlotChangeEvent
to all registered listeners.paint
- the paint (null
not permitted).getValuePaint()
public Paint getDialBackgroundPaint()
null
).setDialBackgroundPaint(Paint)
public void setDialBackgroundPaint(Paint paint)
null
for no background.paint
- the paint (null
permitted).getDialBackgroundPaint()
public boolean getDrawBorder()
setDrawBorder(boolean)
public void setDrawBorder(boolean draw)
PlotChangeEvent
to all
registered listeners.draw
- the flag.getDrawBorder()
public Paint getDialOutlinePaint()
setDialOutlinePaint(Paint)
public void setDialOutlinePaint(Paint paint)
PlotChangeEvent
to all
registered listeners.paint
- the paint.getDialOutlinePaint()
public ValueDataset getDataset()
null
).setDataset(ValueDataset)
public void setDataset(ValueDataset dataset)
PlotChangeEvent
.dataset
- the dataset (null
permitted).getDataset()
public List getIntervals()
addInterval(MeterInterval)
public void addInterval(MeterInterval interval)
PlotChangeEvent
to all registered
listeners.interval
- the interval (null
not permitted).getIntervals()
,
clearIntervals()
public void clearIntervals()
PlotChangeEvent
to
all registered listeners.addInterval(MeterInterval)
public LegendItemCollection getLegendItems()
getLegendItems
in interface LegendItemSource
getLegendItems
in class Plot
public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)
public double valueToAngle(double value)
value
- the value.public String getPlotType()
getPlotType
in class Plot
public void zoom(double percent)
public boolean equals(Object obj)
public Object clone() throws CloneNotSupportedException
clone
in interface org.jfree.util.PublicCloneable
clone
in class Plot
CloneNotSupportedException
- if some component of the plot cannot
be cloned.Jas4pp 1.5 © Java Analysis Studio for Particle Physics