java.lang.Object | |
↳ | org.jfree.chart.plot.Plot |
![]() |
![]() |
The base class for all plots in JFreeChart. The JFreeChart
class
delegates the drawing of axes and data to the plot. This base class
provides facilities common to most plot types.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
float | DEFAULT_BACKGROUND_ALPHA | The default background alpha transparency. | |||||||||
float | DEFAULT_FOREGROUND_ALPHA | The default foreground alpha transparency. | |||||||||
int | MINIMUM_HEIGHT_TO_DRAW | The minimum height at which the plot should be drawn. | |||||||||
int | MINIMUM_WIDTH_TO_DRAW | The minimum width at which the plot should be drawn. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_BACKGROUND_PAINT | The default background color. | ||||||||||
DEFAULT_INSETS | The default insets. | ||||||||||
DEFAULT_LEGEND_ITEM_BOX | A default box shape for legend items. | ||||||||||
DEFAULT_LEGEND_ITEM_CIRCLE | A default circle shape for legend items. | ||||||||||
DEFAULT_OUTLINE_PAINT | The default outline color. | ||||||||||
DEFAULT_OUTLINE_STROKE | The default outline stroke. | ||||||||||
ZERO | Useful constant representing zero. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new plot.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Registers an object for notification of changes to the plot.
| |||||||||||
Receives notification of a change to one of the plot's axes.
| |||||||||||
Creates a clone of the plot.
| |||||||||||
Receives notification of a change to the plot's dataset.
| |||||||||||
Draws the plot within the specified area.
| |||||||||||
Draws the plot background (the background color and/or image).
| |||||||||||
Draws the background image (if there is one) aligned within the
specified area.
| |||||||||||
Draws the plot outline.
| |||||||||||
Tests this plot for equality with another object.
| |||||||||||
Returns the alpha transparency of the plot area background.
| |||||||||||
Returns the background image that is used to fill the plot's background
area.
| |||||||||||
Returns the background image alignment.
| |||||||||||
Returns the alpha transparency used to draw the background image.
| |||||||||||
Returns the background color of the plot area.
| |||||||||||
Returns the dataset group for the plot (not currently used).
| |||||||||||
Returns the drawing supplier for the plot.
| |||||||||||
Returns the alpha-transparency for the plot foreground.
| |||||||||||
Returns the insets for the plot area.
| |||||||||||
Returns the legend items for the plot.
| |||||||||||
Returns the string that is displayed when the dataset is empty or
null . | |||||||||||
Returns the font used to display the 'no data' message.
| |||||||||||
Returns the paint used to display the 'no data' message.
| |||||||||||
Returns the color used to draw the outline of the plot area.
| |||||||||||
Returns the stroke used to outline the plot area.
| |||||||||||
Returns the parent plot (or
null if this plot is not part
of a combined plot). | |||||||||||
Returns a short string describing the plot type.
| |||||||||||
Returns the root plot.
| |||||||||||
Handles a 'click' on the plot.
| |||||||||||
Returns a flag that controls whether or not change events are sent to
registered listeners.
| |||||||||||
Returns the flag that controls whether or not the plot outline is
drawn.
| |||||||||||
Returns
true if this plot is part of a combined plot
structure (that is, getParent() returns a non-null
value), and false otherwise. | |||||||||||
Receives notification of a change to a marker that is assigned to the
plot.
| |||||||||||
Notifies all registered listeners that the plot has been modified.
| |||||||||||
Unregisters an object for notification of changes to the plot.
| |||||||||||
Resolves a domain axis location for a given plot orientation.
| |||||||||||
Resolves a range axis location for a given plot orientation.
| |||||||||||
Sets the alpha transparency of the plot area background, and notifies
registered listeners that the plot has been modified.
| |||||||||||
Sets the background image for the plot and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the alignment for the background image and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the alpha transparency used when drawing the background image.
| |||||||||||
Sets the background color of the plot area and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the drawing supplier for the plot and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the drawing supplier for the plot and, if requested, sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the alpha-transparency for the plot and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the insets for the plot and sends a
PlotChangeEvent to
all registered listeners. | |||||||||||
Sets the insets for the plot and, if requested, and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the message that is displayed when the dataset is empty or
null , and sends a PlotChangeEvent to all registered
listeners. | |||||||||||
Sets the font used to display the 'no data' message and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the paint used to display the 'no data' message and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets a flag that controls whether or not listeners receive
PlotChangeEvent notifications. | |||||||||||
Sets the paint used to draw the outline of the plot area and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the stroke used to outline the plot area and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the flag that controls whether or not the plot's outline is
drawn, and sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Sets the parent plot.
| |||||||||||
Performs a zoom on the plot.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a plot entity that contains a reference to the plot and the
data area as shape.
| |||||||||||
Draws a message to state that there is no data to plot.
| |||||||||||
Fills the specified area with the background paint.
| |||||||||||
Fills the specified area with the background paint.
| |||||||||||
Sends a
PlotChangeEvent to all registered listeners. | |||||||||||
Adjusts the supplied x-value.
| |||||||||||
Adjusts the supplied y-value.
| |||||||||||
Sets the dataset group (not currently used).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
The default background alpha transparency.
The default foreground alpha transparency.
The minimum height at which the plot should be drawn.
The minimum width at which the plot should be drawn.
The default insets.
Creates a new plot.
Registers an object for notification of changes to the plot.
listener | the object to be registered. |
---|
Receives notification of a change to one of the plot's axes.
event | information about the event (not used here). |
---|
Creates a clone of the plot.
CloneNotSupportedException | if some component of the plot does not support cloning. |
---|
Receives notification of a change to the plot's dataset.
The plot reacts by passing on a plot change event to all registered listeners.
event | information about the event (not used here). |
---|
Draws the plot within the specified area. The anchor is a point on the
chart that is specified externally (for instance, it may be the last
point of the last mouse click performed by the user) - plots can use or
ignore this value as they see fit.
Subclasses need to provide an implementation of this method, obviously.
g2 | the graphics device. |
---|---|
area | the plot area. |
anchor | the anchor point (null permitted). |
parentState | the parent state (if any). |
info | carries back plot rendering info. |
Draws the plot background (the background color and/or image).
This method will be called during the chart drawing process and is declared public so that it can be accessed by the renderers used by certain subclasses. You shouldn't need to call this method directly.
g2 | the graphics device. |
---|---|
area | the area within which the plot should be drawn. |
Draws the background image (if there is one) aligned within the specified area.
g2 | the graphics device. |
---|---|
area | the area. |
Draws the plot outline. This method will be called during the chart drawing process and is declared public so that it can be accessed by the renderers used by certain subclasses. You shouldn't need to call this method directly.
g2 | the graphics device. |
---|---|
area | the area within which the plot should be drawn. |
Tests this plot for equality with another object.
obj | the object (null permitted). |
---|
true
or false
.
Returns the alpha transparency of the plot area background.
Returns the background image that is used to fill the plot's background area.
null
).Returns the background image alignment. Alignment constants are defined
in the org.jfree.ui.Align
class in the JCommon class
library.
Returns the alpha transparency used to draw the background image. This is a value in the range 0.0f to 1.0f, where 0.0f is fully transparent and 1.0f is fully opaque.
Returns the background color of the plot area.
null
).Returns the dataset group for the plot (not currently used).
Returns the drawing supplier for the plot.
null
).Returns the alpha-transparency for the plot foreground.
Returns the insets for the plot area.
null
).Returns the legend items for the plot. By default, this method returns
null
. Subclasses should override to return a
LegendItemCollection
.
null
).
Returns the string that is displayed when the dataset is empty or
null
.
null
possible).Returns the font used to display the 'no data' message.
null
).Returns the paint used to display the 'no data' message.
null
).Returns the color used to draw the outline of the plot area.
null).
Returns the stroke used to outline the plot area.
null
).Returns the parent plot (or null
if this plot is not part
of a combined plot).
Returns a short string describing the plot type.
Note: this gets used in the chart property editing user interface, but there needs to be a better mechanism for identifying the plot type.
null
).
Handles a 'click' on the plot. Since the plot does not maintain any information about where it has been drawn, the plot rendering info is supplied as an argument so that the plot dimensions can be determined.
x | the x coordinate (in Java2D space). |
---|---|
y | the y coordinate (in Java2D space). |
info | an object containing information about the dimensions of the plot. |
Returns a flag that controls whether or not change events are sent to registered listeners.
Returns the flag that controls whether or not the plot outline is
drawn. The default value is true
. Note that for
historical reasons, the plot's outline paint and stroke can take on
null
values, in which case the outline will not be drawn
even if this flag is set to true
.
Returns true
if this plot is part of a combined plot
structure (that is, getParent()
returns a non-null
value), and false
otherwise.
true
if this plot is part of a combined plot
structure.Receives notification of a change to a marker that is assigned to the plot.
event | the event. |
---|
Notifies all registered listeners that the plot has been modified.
event | information about the change event. |
---|
Unregisters an object for notification of changes to the plot.
listener | the object to be unregistered. |
---|
Resolves a domain axis location for a given plot orientation.
location | the location (null not permitted). |
---|---|
orientation | the orientation (null not permitted). |
null
).
Resolves a range axis location for a given plot orientation.
location | the location (null not permitted). |
---|---|
orientation | the orientation (null not permitted). |
null
).
Sets the alpha transparency of the plot area background, and notifies registered listeners that the plot has been modified.
alpha | the new alpha value (in the range 0.0f to 1.0f). |
---|
Sets the background image for the plot and sends a
PlotChangeEvent
to all registered listeners.
image | the image (null permitted). |
---|
Sets the alignment for the background image and sends a
PlotChangeEvent
to all registered listeners. Alignment options
are defined by the org.jfree.ui.Align class in the JCommon
class library.
alignment | the alignment. |
---|
Sets the alpha transparency used when drawing the background image.
alpha | the alpha transparency (in the range 0.0f to 1.0f, where 0.0f is fully transparent, and 1.0f is fully opaque). |
---|
IllegalArgumentException | if alpha is not within
the specified range. |
---|
Sets the background color of the plot area and sends a
PlotChangeEvent
to all registered listeners.
paint | the paint (null permitted). |
---|
Sets the drawing supplier for the plot and sends a
PlotChangeEvent
to all registered listeners. The drawing
supplier is responsible for supplying a limitless (possibly repeating)
sequence of Paint
, Stroke
and
Shape
objects that the plot's renderer(s) can use to
populate its (their) tables.
supplier | the new supplier. |
---|
Sets the drawing supplier for the plot and, if requested, sends a
PlotChangeEvent
to all registered listeners. The drawing
supplier is responsible for supplying a limitless (possibly repeating)
sequence of Paint
, Stroke
and
Shape
objects that the plot's renderer(s) can use to
populate its (their) tables.
supplier | the new supplier. |
---|---|
notify | notify listeners? |
Sets the alpha-transparency for the plot and sends a
PlotChangeEvent
to all registered listeners.
alpha | the new alpha transparency. |
---|
Sets the insets for the plot and sends a PlotChangeEvent
to
all registered listeners.
insets | the new insets (null not permitted). |
---|
Sets the insets for the plot and, if requested, and sends a
PlotChangeEvent
to all registered listeners.
insets | the new insets (null not permitted). |
---|---|
notify | a flag that controls whether the registered listeners are notified. |
Sets the message that is displayed when the dataset is empty or
null
, and sends a PlotChangeEvent
to all registered
listeners.
message | the message (null permitted). |
---|
Sets the font used to display the 'no data' message and sends a
PlotChangeEvent
to all registered listeners.
font | the font (null not permitted). |
---|
Sets the paint used to display the 'no data' message and sends a
PlotChangeEvent
to all registered listeners.
paint | the paint (null not permitted). |
---|
Sets a flag that controls whether or not listeners receive
PlotChangeEvent
notifications.
notify | a boolean. |
---|
Sets the paint used to draw the outline of the plot area and sends a
PlotChangeEvent
to all registered listeners. If you set this
attribute to null
, no outline will be drawn.
paint | the paint (null permitted). |
---|
Sets the stroke used to outline the plot area and sends a
PlotChangeEvent
to all registered listeners. If you set this
attribute to null
, no outline will be drawn.
stroke | the stroke (null permitted). |
---|
Sets the flag that controls whether or not the plot's outline is
drawn, and sends a PlotChangeEvent
to all registered listeners.
visible | the new flag value. |
---|
Sets the parent plot. This method is intended for internal use, you shouldn't need to call it directly.
parent | the parent plot (null permitted). |
---|
Performs a zoom on the plot. Subclasses should override if zooming is appropriate for the type of plot.
percent | the zoom percentage. |
---|
Creates a plot entity that contains a reference to the plot and the data area as shape.
dataArea | the data area used as hot spot for the entity. |
---|---|
plotState | the plot rendering info containing a reference to the EntityCollection. |
toolTip | the tool tip (defined in the respective Plot
subclass) (null permitted). |
urlText | the url (defined in the respective Plot subclass)
(null permitted). |
Draws a message to state that there is no data to plot.
g2 | the graphics device. |
---|---|
area | the area within which the plot should be drawn. |
Fills the specified area with the background paint.
g2 | the graphics device. |
---|---|
area | the area. |
Fills the specified area with the background paint. If the background
paint is an instance of GradientPaint
, the gradient will
run in the direction suggested by the plot's orientation.
g2 | the graphics target. |
---|---|
area | the plot area. |
orientation | the plot orientation (null not
permitted). |
Adjusts the supplied x-value.
x | the x-value. |
---|---|
w1 | width 1. |
w2 | width 2. |
edge | the edge (left or right). |
Adjusts the supplied y-value.
y | the x-value. |
---|---|
h1 | height 1. |
h2 | height 2. |
edge | the edge (top or bottom). |
Sets the dataset group (not currently used).
group | the dataset group (null permitted). |
---|