java.lang.Object | ||
↳ | org.jfree.chart.block.AbstractBlock | |
↳ | org.jfree.chart.title.Title |
![]() |
![]() |
The base class for all chart titles. A chart can have multiple titles, appearing at the top, bottom, left or right of the chart.
Concrete implementations of this class will render text and images, and hence do the actual work of drawing titles.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DEFAULT_HORIZONTAL_ALIGNMENT | The default horizontal alignment. | ||||||||||
DEFAULT_PADDING | Default title padding. | ||||||||||
DEFAULT_POSITION | The default title position. | ||||||||||
DEFAULT_VERTICAL_ALIGNMENT | The default vertical alignment. | ||||||||||
visible | A flag that controls whether or not the title is visible. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new title, using default attributes where necessary.
| |||||||||||
Creates a new title, using default attributes where necessary.
| |||||||||||
Creates a new title.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Registers an object for notification of changes to the title.
| |||||||||||
Returns a clone of the title.
| |||||||||||
Draws the title on a Java 2D graphics device (such as the screen or a
printer).
| |||||||||||
Tests an object for equality with this title.
| |||||||||||
Returns the horizontal alignment of the title.
| |||||||||||
Returns the flag that indicates whether or not the notification
mechanism is enabled.
| |||||||||||
Returns the position of the title.
| |||||||||||
Returns the vertical alignment of the title.
| |||||||||||
Returns a hashcode for the title.
| |||||||||||
Returns a flag that controls whether or not the title should be
drawn.
| |||||||||||
Unregisters an object for notification of changes to the chart title.
| |||||||||||
Sets the horizontal alignment for the title and sends a
TitleChangeEvent to all registered listeners. | |||||||||||
Sets the flag that indicates whether or not the notification mechanism
is enabled.
| |||||||||||
Sets the position for the title and sends a
TitleChangeEvent to
all registered listeners. | |||||||||||
Sets the vertical alignment for the title, and notifies any registered
listeners of the change.
| |||||||||||
Sets a flag that controls whether or not the title should be drawn, and
sends a
TitleChangeEvent to all registered listeners. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Notifies all registered listeners that the chart title has changed in
some way.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
The default horizontal alignment.
Default title padding.
The default title position.
The default vertical alignment.
A flag that controls whether or not the title is visible.
Creates a new title, using default attributes where necessary.
Creates a new title, using default attributes where necessary.
position | the position of the title (null not
permitted). |
---|---|
horizontalAlignment | the horizontal alignment of the title
(null not permitted). |
verticalAlignment | the vertical alignment of the title
(null not permitted).
|
Creates a new title.
position | the position of the title (null not
permitted). |
---|---|
horizontalAlignment | the horizontal alignment of the title (LEFT,
CENTER or RIGHT, null not
permitted). |
verticalAlignment | the vertical alignment of the title (TOP,
MIDDLE or BOTTOM, null not
permitted). |
padding | the amount of space to leave around the outside of the
title (null not permitted).
|
Registers an object for notification of changes to the title.
listener | the object that is being registered. |
---|
Returns a clone of the title.
One situation when this is useful is when editing the title properties - you can edit a clone, and then it is easier to cancel the changes if necessary.
CloneNotSupportedException | not thrown by this class, but it may be thrown by subclasses. |
---|
Draws the title on a Java 2D graphics device (such as the screen or a printer).
g2 | the graphics device. |
---|---|
area | the area allocated for the title (subclasses should not draw outside this area). |
Tests an object for equality with this title.
obj | the object (null not permitted). |
---|
true
or false
.
Returns the horizontal alignment of the title.
null
).
Returns the flag that indicates whether or not the notification mechanism is enabled.
Returns the position of the title.
null
).
Returns the vertical alignment of the title.
null
).
Returns a hashcode for the title.
Returns a flag that controls whether or not the title should be
drawn. The default value is true
.
Unregisters an object for notification of changes to the chart title.
listener | the object that is being unregistered. |
---|
Sets the horizontal alignment for the title and sends a
TitleChangeEvent
to all registered listeners.
alignment | the horizontal alignment (null not
permitted).
|
---|
Sets the flag that indicates whether or not the notification mechanism is enabled. There are certain situations (such as cloning) where you want to turn notification off temporarily.
flag | the new value of the flag. |
---|
Sets the position for the title and sends a TitleChangeEvent
to
all registered listeners.
position | the position (null not permitted).
|
---|
Sets the vertical alignment for the title, and notifies any registered listeners of the change.
alignment | the new vertical alignment (TOP, MIDDLE or BOTTOM,
null not permitted).
|
---|
Sets a flag that controls whether or not the title should be drawn, and
sends a TitleChangeEvent
to all registered listeners.
visible | the new flag value. |
---|
Notifies all registered listeners that the chart title has changed in some way.
event | an object that contains information about the change to the title. |
---|