| java.lang.Object org.jfree.chart.plot.Plot org.jfree.chart.plot.MeterPlot
MeterPlot | public class MeterPlot extends Plot implements Serializable,Cloneable(Code) | | A plot that displays a single value in the form of a needle on a dial.
Defined ranges (for example, 'normal', 'warning' and 'critical') can be
highlighted on the dial.
|
Constructor Summary | |
public | MeterPlot() Creates a new plot with a default range of 0 to
100 and no value to display. | public | MeterPlot(ValueDataset dataset) Creates a new plot that displays the value from the supplied dataset. |
Method Summary | |
public void | addInterval(MeterInterval interval) Adds an interval and sends a
PlotChangeEvent to all registered
listeners. | public void | clearIntervals() Clears the intervals for the plot and sends a
PlotChangeEvent to
all registered listeners. | public Object | clone() Returns an independent copy (clone) of the plot. | 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). | protected void | drawArc(Graphics2D g2, Rectangle2D area, double minValue, double maxValue, Paint paint, Stroke stroke) Draws an arc. | protected void | drawArcForInterval(Graphics2D g2, Rectangle2D meterArea, MeterInterval interval) Draws the arc to represent an interval. | protected void | drawTick(Graphics2D g2, Rectangle2D meterArea, double value) Draws a tick. | protected void | drawTick(Graphics2D g2, Rectangle2D meterArea, double value, boolean label) Draws a tick on the dial. | protected void | drawTicks(Graphics2D g2, Rectangle2D meterArea, double minValue, double maxValue) Draws the ticks that subdivide the overall range. | protected void | drawValueLabel(Graphics2D g2, Rectangle2D area) Draws the value label just below the center of the dial. | public boolean | equals(Object obj) Tests the plot for equality with an arbitrary object. | protected void | fillArc(Graphics2D g2, Rectangle2D area, double minValue, double maxValue, Paint paint, boolean dial) Fills an arc on the dial between the given values. | public ValueDataset | getDataset() Returns the dataset for the plot. | public Paint | getDialBackgroundPaint() Returns the paint for the dial background. | public Paint | getDialOutlinePaint() Returns the dial outline paint. | public DialShape | getDialShape() Returns the dial shape. | public boolean | getDrawBorder() Returns a flag that controls whether or not a rectangular border is
drawn around the plot area. | public List | getIntervals() Returns an unmodifiable list of the intervals for the plot. | public LegendItemCollection | getLegendItems() Returns an item for each interval. | public int | getMeterAngle() Returns the meter angle in degrees. | public Paint | getNeedlePaint() Returns the paint for the needle. | public String | getPlotType() Returns a short string describing the type of plot. | public Range | getRange() Returns the overall range for the dial. | public Font | getTickLabelFont() Returns the tick label font. | public NumberFormat | getTickLabelFormat() Returns the tick label format. | public Paint | getTickLabelPaint() Returns the tick label paint. | public boolean | getTickLabelsVisible() Returns the flag that determines whether or not tick labels are visible. | public Paint | getTickPaint() Returns the paint used to draw the ticks around the dial. | public double | getTickSize() Returns the tick size (the interval between ticks on the dial). | public String | getUnits() Returns a string describing the units for the dial. | public Font | getValueFont() Returns the font for the value label. | public Paint | getValuePaint() Returns the paint for the value label. | public void | setDataset(ValueDataset dataset) Sets the dataset for the plot, replacing the existing dataset if there
is one, and triggers a
PlotChangeEvent . | public void | setDialBackgroundPaint(Paint paint) Sets the paint used to fill the dial background. | public void | setDialOutlinePaint(Paint paint) Sets the dial outline paint and sends a
PlotChangeEvent to all
registered listeners. | public void | setDialShape(DialShape shape) Sets the dial shape and sends a
PlotChangeEvent to all
registered listeners. | public 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. | public void | setMeterAngle(int angle) Sets the angle (in degrees) for the whole range of the dial and sends
a
PlotChangeEvent to all registered listeners. | public void | setNeedlePaint(Paint paint) Sets the paint used to display the needle and sends a
PlotChangeEvent to all registered listeners. | public void | setRange(Range range) Sets the range for the dial and sends a
PlotChangeEvent to all
registered listeners. | public void | setTickLabelFont(Font font) Sets the tick label font and sends a
PlotChangeEvent to all
registered listeners. | public void | setTickLabelFormat(NumberFormat format) Sets the format for the tick labels and sends a
PlotChangeEvent
to all registered listeners. | public void | setTickLabelPaint(Paint paint) Sets the tick label paint and sends a
PlotChangeEvent to all
registered listeners. | public 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. | public void | setTickPaint(Paint paint) Sets the paint used to draw the tick labels around the dial and sends
a
PlotChangeEvent to all registered listeners. | public void | setTickSize(double size) Sets the tick size and sends a
PlotChangeEvent to all
registered listeners. | public void | setUnits(String units) Sets the units for the dial and sends a
PlotChangeEvent to all
registered listeners. | public void | setValueFont(Font font) Sets the font used to display the value label and sends a
PlotChangeEvent to all registered listeners. | public void | setValuePaint(Paint paint) Sets the paint used to display the value label and sends a
PlotChangeEvent to all registered listeners. | public double | valueToAngle(double value) Translates a data value to an angle on the dial.
Parameters: value - the value. | public void | zoom(double percent) A zoom method that does nothing. |
DEFAULT_BORDER_SIZE | final public static float DEFAULT_BORDER_SIZE(Code) | | The default border size.
|
DEFAULT_CIRCLE_SIZE | final public static float DEFAULT_CIRCLE_SIZE(Code) | | The default circle size.
|
DEFAULT_DIAL_BACKGROUND_PAINT | final static Paint DEFAULT_DIAL_BACKGROUND_PAINT(Code) | | The default background paint.
|
DEFAULT_LABEL_FONT | final public static Font DEFAULT_LABEL_FONT(Code) | | The default label font.
|
DEFAULT_METER_ANGLE | final public static int DEFAULT_METER_ANGLE(Code) | | The default meter angle.
|
DEFAULT_NEEDLE_PAINT | final static Paint DEFAULT_NEEDLE_PAINT(Code) | | The default needle paint.
|
DEFAULT_VALUE_FONT | final static Font DEFAULT_VALUE_FONT(Code) | | The default value font.
|
DEFAULT_VALUE_PAINT | final static Paint DEFAULT_VALUE_PAINT(Code) | | The default value paint.
|
localizationResources | protected static ResourceBundle localizationResources(Code) | | The resourceBundle for the localization.
|
MeterPlot | public MeterPlot()(Code) | | Creates a new plot with a default range of 0 to
100 and no value to display.
|
MeterPlot | public MeterPlot(ValueDataset dataset)(Code) | | Creates a new plot that displays the value from the supplied dataset.
Parameters: dataset - the dataset (null permitted). |
draw | public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)(Code) | | Draws the plot on a Java 2D graphics device (such as the screen or a
printer).
Parameters: g2 - the graphics device. Parameters: area - the area within which the plot should be drawn. Parameters: anchor - the anchor point (null permitted). Parameters: parentState - the state from the parent plot, if there is one. Parameters: info - collects info about the drawing. |
drawArc | protected void drawArc(Graphics2D g2, Rectangle2D area, double minValue, double maxValue, Paint paint, Stroke stroke)(Code) | | Draws an arc.
Parameters: g2 - the graphics device. Parameters: area - the plot area. Parameters: minValue - the minimum value. Parameters: maxValue - the maximum value. Parameters: paint - the paint. Parameters: stroke - the stroke. |
drawArcForInterval | protected void drawArcForInterval(Graphics2D g2, Rectangle2D meterArea, MeterInterval interval)(Code) | | Draws the arc to represent an interval.
Parameters: g2 - the graphics device. Parameters: meterArea - the drawing area. Parameters: interval - the interval. |
drawTick | protected void drawTick(Graphics2D g2, Rectangle2D meterArea, double value)(Code) | | Draws a tick.
Parameters: g2 - the graphics device. Parameters: meterArea - the meter area. Parameters: value - the value. |
drawTick | protected void drawTick(Graphics2D g2, Rectangle2D meterArea, double value, boolean label)(Code) | | Draws a tick on the dial.
Parameters: g2 - the graphics device. Parameters: meterArea - the meter area. Parameters: value - the tick value. Parameters: label - a flag that controls whether or not a value label is drawn. |
drawTicks | protected void drawTicks(Graphics2D g2, Rectangle2D meterArea, double minValue, double maxValue)(Code) | | Draws the ticks that subdivide the overall range.
Parameters: g2 - the graphics device. Parameters: meterArea - the meter area. Parameters: minValue - the minimum value. Parameters: maxValue - the maximum value. |
drawValueLabel | protected void drawValueLabel(Graphics2D g2, Rectangle2D area)(Code) | | Draws the value label just below the center of the dial.
Parameters: g2 - the graphics device. Parameters: area - the plot area. |
equals | public boolean equals(Object obj)(Code) | | Tests the plot for equality with an arbitrary object. Note that the
dataset is ignored for the purposes of testing equality.
Parameters: obj - the object (null permitted). A boolean. |
fillArc | protected void fillArc(Graphics2D g2, Rectangle2D area, double minValue, double maxValue, Paint paint, boolean dial)(Code) | | Fills an arc on the dial between the given values.
Parameters: g2 - the graphics device. Parameters: area - the plot area. Parameters: minValue - the minimum data value. Parameters: maxValue - the maximum data value. Parameters: paint - the background paint (null not permitted). Parameters: dial - a flag that indicates whether the arc represents the whole dial. |
getDrawBorder | public boolean getDrawBorder()(Code) | | Returns a flag that controls whether or not a rectangular border is
drawn around the plot area.
A flag. See Also: MeterPlot.setDrawBorder(boolean) |
getMeterAngle | public int getMeterAngle()(Code) | | Returns the meter angle in degrees. This defines, in part, the shape
of the dial. The default is 270 degrees.
The meter angle (in degrees). See Also: MeterPlot.setMeterAngle(int) |
getPlotType | public String getPlotType()(Code) | | Returns a short string describing the type of plot.
A string describing the type of plot. |
getTickPaint | public Paint getTickPaint()(Code) | | Returns the paint used to draw the ticks around the dial.
The paint used to draw the ticks around the dial (never null ). See Also: MeterPlot.setTickPaint(Paint) |
setDialBackgroundPaint | public void setDialBackgroundPaint(Paint paint)(Code) | | Sets the paint used to fill the dial background. Set this to
null for no background.
Parameters: paint - the paint (null permitted). See Also: MeterPlot.getDialBackgroundPaint() |
setDrawBorder | public void setDrawBorder(boolean draw)(Code) | | 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.
Parameters: draw - the flag. See Also: MeterPlot.getDrawBorder() |
setMeterAngle | public void setMeterAngle(int angle)(Code) | | Sets the angle (in degrees) for the whole range of the dial and sends
a
PlotChangeEvent to all registered listeners.
Parameters: angle - the angle (in degrees, in the range 1-360). See Also: MeterPlot.getMeterAngle() |
setRange | public void setRange(Range range)(Code) | | Sets the range for the dial and sends a
PlotChangeEvent to all
registered listeners.
Parameters: range - the range (null not permitted and zero-lengthranges not permitted). See Also: MeterPlot.getRange() |
setTickLabelsVisible | public void setTickLabelsVisible(boolean visible)(Code) | | Sets the flag that controls whether or not the tick labels are visible
and sends a
PlotChangeEvent to all registered listeners.
Parameters: visible - the flag. See Also: MeterPlot.getTickLabelsVisible() |
setTickPaint | public void setTickPaint(Paint paint)(Code) | | Sets the paint used to draw the tick labels around the dial and sends
a
PlotChangeEvent to all registered listeners.
Parameters: paint - the paint (null not permitted). See Also: MeterPlot.getTickPaint() |
valueToAngle | public double valueToAngle(double value)(Code) | | Translates a data value to an angle on the dial.
Parameters: value - the value. The angle on the dial. |
zoom | public void zoom(double percent)(Code) | | A zoom method that does nothing. Plots are required to support the
zoom operation. In the case of a meter plot, it doesn't make sense to
zoom in or out, so the method is empty.
Parameters: percent - The zoom percentage. |
Methods inherited from org.jfree.chart.plot.Plot | public void addChangeListener(PlotChangeListener listener)(Code)(Java Doc) public void axisChanged(AxisChangeEvent event)(Code)(Java Doc) public Object clone() throws CloneNotSupportedException(Code)(Java Doc) public void datasetChanged(DatasetChangeEvent event)(Code)(Java Doc) abstract public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor, PlotState parentState, PlotRenderingInfo info)(Code)(Java Doc) public void drawBackground(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) public void drawBackgroundImage(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) protected void drawNoDataMessage(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) public void drawOutline(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) protected void fillBackground(Graphics2D g2, Rectangle2D area)(Code)(Java Doc) protected void fillBackground(Graphics2D g2, Rectangle2D area, PlotOrientation orientation)(Code)(Java Doc) public float getBackgroundAlpha()(Code)(Java Doc) public Image getBackgroundImage()(Code)(Java Doc) public int getBackgroundImageAlignment()(Code)(Java Doc) public float getBackgroundImageAlpha()(Code)(Java Doc) public Paint getBackgroundPaint()(Code)(Java Doc) public DatasetGroup getDatasetGroup()(Code)(Java Doc) public DrawingSupplier getDrawingSupplier()(Code)(Java Doc) public float getForegroundAlpha()(Code)(Java Doc) public RectangleInsets getInsets()(Code)(Java Doc) public LegendItemCollection getLegendItems()(Code)(Java Doc) public String getNoDataMessage()(Code)(Java Doc) public Font getNoDataMessageFont()(Code)(Java Doc) public Paint getNoDataMessagePaint()(Code)(Java Doc) public Paint getOutlinePaint()(Code)(Java Doc) public Stroke getOutlineStroke()(Code)(Java Doc) public Plot getParent()(Code)(Java Doc) abstract public String getPlotType()(Code)(Java Doc) protected double getRectX(double x, double w1, double w2, RectangleEdge edge)(Code)(Java Doc) protected double getRectY(double y, double h1, double h2, RectangleEdge edge)(Code)(Java Doc) public Plot getRootPlot()(Code)(Java Doc) public void handleClick(int x, int y, PlotRenderingInfo info)(Code)(Java Doc) public boolean isOutlineVisible()(Code)(Java Doc) public boolean isSubplot()(Code)(Java Doc) public void markerChanged(MarkerChangeEvent event)(Code)(Java Doc) public void notifyListeners(PlotChangeEvent event)(Code)(Java Doc) public void removeChangeListener(PlotChangeListener listener)(Code)(Java Doc) public static RectangleEdge resolveDomainAxisLocation(AxisLocation location, PlotOrientation orientation)(Code)(Java Doc) public static RectangleEdge resolveRangeAxisLocation(AxisLocation location, PlotOrientation orientation)(Code)(Java Doc) public void setBackgroundAlpha(float alpha)(Code)(Java Doc) public void setBackgroundImage(Image image)(Code)(Java Doc) public void setBackgroundImageAlignment(int alignment)(Code)(Java Doc) public void setBackgroundImageAlpha(float alpha)(Code)(Java Doc) public void setBackgroundPaint(Paint paint)(Code)(Java Doc) protected void setDatasetGroup(DatasetGroup group)(Code)(Java Doc) public void setDrawingSupplier(DrawingSupplier supplier)(Code)(Java Doc) public void setForegroundAlpha(float alpha)(Code)(Java Doc) public void setInsets(RectangleInsets insets)(Code)(Java Doc) public void setInsets(RectangleInsets insets, boolean notify)(Code)(Java Doc) public void setNoDataMessage(String message)(Code)(Java Doc) public void setNoDataMessageFont(Font font)(Code)(Java Doc) public void setNoDataMessagePaint(Paint paint)(Code)(Java Doc) public void setOutlinePaint(Paint paint)(Code)(Java Doc) public void setOutlineStroke(Stroke stroke)(Code)(Java Doc) public void setOutlineVisible(boolean visible)(Code)(Java Doc) public void setParent(Plot parent)(Code)(Java Doc) public void zoom(double percent)(Code)(Java Doc)
|
|
|