java.lang.Object | |
↳ | org.jfree.chart.axis.Axis |
![]() |
![]() |
The base class for all axes in JFreeChart. Subclasses are divided into
those that display values (ValueAxis
) and those that display
categories (CategoryAxis
).
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | DEFAULT_AXIS_VISIBLE | The default axis visibility. | |||||||||
boolean | DEFAULT_TICK_LABELS_VISIBLE | The default tick labels visibility. | |||||||||
boolean | DEFAULT_TICK_MARKS_VISIBLE | The default tick marks visible. | |||||||||
float | DEFAULT_TICK_MARK_INSIDE_LENGTH | The default tick mark inside length. | |||||||||
float | DEFAULT_TICK_MARK_OUTSIDE_LENGTH | The default tick mark outside length. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_AXIS_LABEL_FONT | The default axis label font. | ||||||||||
DEFAULT_AXIS_LABEL_INSETS | The default axis label insets. | ||||||||||
DEFAULT_AXIS_LABEL_PAINT | The default axis label paint. | ||||||||||
DEFAULT_AXIS_LINE_PAINT | The default axis line paint. | ||||||||||
DEFAULT_AXIS_LINE_STROKE | The default axis line stroke. | ||||||||||
DEFAULT_TICK_LABEL_FONT | The default tick label font. | ||||||||||
DEFAULT_TICK_LABEL_INSETS | The default tick label insets. | ||||||||||
DEFAULT_TICK_LABEL_PAINT | The default tick label paint. | ||||||||||
DEFAULT_TICK_MARK_PAINT | The default tick paint. | ||||||||||
DEFAULT_TICK_MARK_STROKE | The default tick stroke. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an axis, using default values where necessary.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Registers an object for notification of changes to the axis.
| |||||||||||
Returns a clone of the axis.
| |||||||||||
Configures the axis to work with the current plot.
| |||||||||||
Draws the axis on a Java 2D graphics device (such as the screen or a
printer).
| |||||||||||
Tests this axis for equality with another object.
| |||||||||||
Returns the paint used to draw the axis line.
| |||||||||||
Returns the stroke used to draw the axis line.
| |||||||||||
Returns the fixed dimension for the axis.
| |||||||||||
Returns the label for the axis.
| |||||||||||
Returns the angle of the axis label.
| |||||||||||
Returns the font for the axis label.
| |||||||||||
Returns the insets for the label (that is, the amount of blank space
that should be left around the label).
| |||||||||||
Returns the color/shade used to draw the axis label.
| |||||||||||
Returns the inside length of the minor tick marks.
| |||||||||||
Returns the outside length of the minor tick marks.
| |||||||||||
Returns the plot that the axis is assigned to.
| |||||||||||
Returns the font used for the tick labels (if showing).
| |||||||||||
Returns the insets for the tick labels.
| |||||||||||
Returns the color/shade used for the tick labels.
| |||||||||||
Returns the inside length of the tick marks.
| |||||||||||
Returns the outside length of the tick marks.
| |||||||||||
Returns the paint used to draw tick marks (if they are showing).
| |||||||||||
Returns the stroke used to draw tick marks.
| |||||||||||
Returns
true if the specified object is registered with
the dataset as a listener. | |||||||||||
A flag that controls whether or not the axis line is drawn.
| |||||||||||
Returns the flag that indicates whether or not the minor tick marks are
showing.
| |||||||||||
Returns a flag indicating whether or not the tick labels are visible.
| |||||||||||
Returns the flag that indicates whether or not the tick marks are
showing.
| |||||||||||
Returns
true if the axis is visible, and
false otherwise. | |||||||||||
Calculates the positions of the ticks for the axis, storing the results
in the tick list (ready for drawing).
| |||||||||||
Deregisters an object for notification of changes to the axis.
| |||||||||||
Estimates the space (height or width) required to draw the axis.
| |||||||||||
Sets the paint used to draw the axis line and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the stroke used to draw the axis line and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets a flag that controls whether or not the axis line is visible and
sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the fixed dimension for the axis.
| |||||||||||
Sets the label for the axis and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the angle for the label and sends an
AxisChangeEvent to all
registered listeners. | |||||||||||
Sets the font for the axis label and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the insets for the axis label, and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the insets for the axis label, and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the paint used to draw the axis label and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the inside length of the minor tick marks and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the outside length of the minor tick marks and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the flag that indicates whether or not the minor tick marks are showing
and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets a reference to the plot that the axis is assigned to.
| |||||||||||
Sets the font for the tick labels and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the insets for the tick labels and sends an
AxisChangeEvent
to all registered listeners. | |||||||||||
Sets the paint used to draw tick labels (if they are showing) and
sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the flag that determines whether or not the tick labels are
visible and sends an
AxisChangeEvent to all registered
listeners. | |||||||||||
Sets the inside length of the tick marks and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the outside length of the tick marks and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the paint used to draw tick marks and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the stroke used to draw tick marks and sends
an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets the flag that indicates whether or not the tick marks are showing
and sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Sets a flag that controls whether or not the axis is visible and sends
an
AxisChangeEvent to all registered listeners. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Created an entity for the axis.
| |||||||||||
Draws an axis line at the current cursor position and edge.
| |||||||||||
Draws the axis label.
| |||||||||||
Sends an
AxisChangeEvent to all registered listeners. | |||||||||||
Returns a rectangle that encloses the axis label.
| |||||||||||
Notifies all registered listeners that the axis has changed.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
The default axis visibility.
The default tick labels visibility.
The default tick marks visible.
The default tick mark inside length.
The default tick mark outside length.
The default axis label insets.
The default tick label insets.
Constructs an axis, using default values where necessary.
label | the axis label (null permitted).
|
---|
Registers an object for notification of changes to the axis.
listener | the object that is being registered. |
---|
Returns a clone of the axis.
CloneNotSupportedException | if some component of the axis does not support cloning. |
---|
Configures the axis to work with the current plot. Override this method to perform any special processing (such as auto-rescaling).
Draws the axis on a Java 2D graphics device (such as the screen or a printer).
g2 | the graphics device (null not permitted). |
---|---|
cursor | the cursor location (determines where to draw the axis). |
plotArea | the area within which the axes and plot should be drawn. |
dataArea | the area within which the data should be drawn. |
edge | the axis location (null not permitted). |
plotState | collects information about the plot
(null permitted). |
null
).
Tests this axis for equality with another object.
obj | the object (null permitted). |
---|
true
or false
.
Returns the paint used to draw the axis line.
null
).Returns the stroke used to draw the axis line.
null
).Returns the fixed dimension for the axis.
Returns the label for the axis.
null
possible).Returns the insets for the label (that is, the amount of blank space that should be left around the label).
null
).Returns the color/shade used to draw the axis label.
null
).Returns the inside length of the minor tick marks.
Returns the outside length of the minor tick marks.
Returns the plot that the axis is assigned to. This method will return
null
if the axis is not currently assigned to a plot.
null
).Returns the font used for the tick labels (if showing).
null
).Returns the insets for the tick labels.
null
).Returns the color/shade used for the tick labels.
Returns the inside length of the tick marks.
Returns the outside length of the tick marks.
Returns the paint used to draw tick marks (if they are showing).
null
).Returns the stroke used to draw tick marks.
null
).Returns true
if the specified object is registered with
the dataset as a listener. Most applications won't need to call this
method, it exists mainly for use by unit testing code.
listener | the listener. |
---|
A flag that controls whether or not the axis line is drawn.
Returns the flag that indicates whether or not the minor tick marks are showing.
Returns a flag indicating whether or not the tick labels are visible.
Returns the flag that indicates whether or not the tick marks are showing.
Returns true
if the axis is visible, and
false
otherwise.
Calculates the positions of the ticks for the axis, storing the results in the tick list (ready for drawing).
g2 | the graphics device. |
---|---|
state | the axis state. |
dataArea | the area inside the axes. |
edge | the edge on which the axis is located. |
Deregisters an object for notification of changes to the axis.
listener | the object to deregister. |
---|
Estimates the space (height or width) required to draw the axis.
g2 | the graphics device. |
---|---|
plot | the plot that the axis belongs to. |
plotArea | the area within which the plot (including axes) should be drawn. |
edge | the axis location. |
space | space already reserved. |
Sets the paint used to draw the axis line and sends an
AxisChangeEvent
to all registered listeners.
paint | the paint (null not permitted). |
---|
Sets the stroke used to draw the axis line and sends an
AxisChangeEvent
to all registered listeners.
stroke | the stroke (null not permitted). |
---|
Sets a flag that controls whether or not the axis line is visible and
sends an AxisChangeEvent
to all registered listeners.
visible | the flag. |
---|
Sets the fixed dimension for the axis.
This is used when combining more than one plot on a chart. In this case, there may be several axes that need to have the same height or width so that they are aligned. This method is used to fix a dimension for the axis (the context determines whether the dimension is horizontal or vertical).
dimension | the fixed dimension. |
---|
Sets the label for the axis and sends an AxisChangeEvent
to all
registered listeners.
label | the new label (null permitted). |
---|
Sets the angle for the label and sends an AxisChangeEvent
to all
registered listeners.
angle | the angle (in radians). |
---|
Sets the font for the axis label and sends an AxisChangeEvent
to all registered listeners.
font | the font (null not permitted). |
---|
Sets the insets for the axis label, and sends an AxisChangeEvent
to all registered listeners.
insets | the insets (null not permitted). |
---|
Sets the insets for the axis label, and sends an AxisChangeEvent
to all registered listeners.
insets | the insets (null not permitted). |
---|---|
notify | notify listeners? |
Sets the paint used to draw the axis label and sends an
AxisChangeEvent
to all registered listeners.
paint | the paint (null not permitted). |
---|
Sets the inside length of the minor tick marks and sends
an AxisChangeEvent
to all registered listeners.
length | the new length. |
---|
Sets the outside length of the minor tick marks and sends
an AxisChangeEvent
to all registered listeners.
length | the new length. |
---|
Sets the flag that indicates whether or not the minor tick marks are showing
and sends an AxisChangeEvent
to all registered listeners.
flag | the flag. |
---|
Sets a reference to the plot that the axis is assigned to.
This method is used internally, you shouldn't need to call it yourself.
plot | the plot. |
---|
Sets the font for the tick labels and sends an AxisChangeEvent
to all registered listeners.
font | the font (null not allowed). |
---|
Sets the insets for the tick labels and sends an AxisChangeEvent
to all registered listeners.
insets | the insets (null not permitted). |
---|
Sets the paint used to draw tick labels (if they are showing) and
sends an AxisChangeEvent
to all registered listeners.
paint | the paint (null not permitted). |
---|
Sets the flag that determines whether or not the tick labels are
visible and sends an AxisChangeEvent
to all registered
listeners.
flag | the flag. |
---|
Sets the inside length of the tick marks and sends
an AxisChangeEvent
to all registered listeners.
length | the new length. |
---|
Sets the outside length of the tick marks and sends
an AxisChangeEvent
to all registered listeners.
length | the new length. |
---|
Sets the paint used to draw tick marks and sends an
AxisChangeEvent
to all registered listeners.
paint | the paint (null not permitted). |
---|
Sets the stroke used to draw tick marks and sends
an AxisChangeEvent
to all registered listeners.
stroke | the stroke (null not permitted). |
---|
Sets the flag that indicates whether or not the tick marks are showing
and sends an AxisChangeEvent
to all registered listeners.
flag | the flag. |
---|
Sets a flag that controls whether or not the axis is visible and sends
an AxisChangeEvent
to all registered listeners.
flag | the flag. |
---|
Created an entity for the axis.
cursor | the initial cursor value. |
---|---|
state | the axis state after completion of the drawing with a possibly updated cursor position. |
dataArea | the data area. |
edge | the edge. |
plotState | the PlotRenderingInfo from which a reference to the entity collection can be obtained. |
Draws an axis line at the current cursor position and edge.
g2 | the graphics device. |
---|---|
cursor | the cursor position. |
dataArea | the data area. |
edge | the edge. |
Draws the axis label.
label | the label text. |
---|---|
g2 | the graphics device. |
plotArea | the plot area. |
dataArea | the area inside the axes. |
edge | the location of the axis. |
state | the axis state (null not permitted). |
Returns a rectangle that encloses the axis label. This is typically used for layout purposes (it gives the maximum dimensions of the label).
g2 | the graphics device. |
---|---|
edge | the edge of the plot area along which the axis is measuring. |
Notifies all registered listeners that the axis has changed. The AxisChangeEvent provides information about the change.
event | information about the change to the axis. |
---|