public abstract class Title extends AbstractBlock implements Block, Cloneable, Serializable
Concrete implementations of this class will render text and images, and hence do the actual work of drawing titles.
Modifier and Type | Field and Description |
---|---|
static org.jfree.ui.HorizontalAlignment |
DEFAULT_HORIZONTAL_ALIGNMENT
The default horizontal alignment.
|
static org.jfree.ui.RectangleInsets |
DEFAULT_PADDING
Default title padding.
|
static org.jfree.ui.RectangleEdge |
DEFAULT_POSITION
The default title position.
|
static org.jfree.ui.VerticalAlignment |
DEFAULT_VERTICAL_ALIGNMENT
The default vertical alignment.
|
boolean |
visible
A flag that controls whether or not the title is visible.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(TitleChangeListener listener)
Registers an object for notification of changes to the title.
|
Object |
clone()
Returns a clone of the title.
|
abstract void |
draw(Graphics2D g2,
Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a
printer).
|
boolean |
equals(Object obj)
Tests an object for equality with this title.
|
org.jfree.ui.HorizontalAlignment |
getHorizontalAlignment()
Returns the horizontal alignment of the title.
|
boolean |
getNotify()
Returns the flag that indicates whether or not the notification
mechanism is enabled.
|
org.jfree.ui.RectangleEdge |
getPosition()
Returns the position of the title.
|
org.jfree.ui.VerticalAlignment |
getVerticalAlignment()
Returns the vertical alignment of the title.
|
int |
hashCode()
Returns a hashcode for the title.
|
boolean |
isVisible()
Returns a flag that controls whether or not the title should be
drawn.
|
void |
removeChangeListener(TitleChangeListener listener)
Unregisters an object for notification of changes to the chart title.
|
void |
setHorizontalAlignment(org.jfree.ui.HorizontalAlignment alignment)
Sets the horizontal alignment for the title and sends a
TitleChangeEvent to all registered listeners. |
void |
setNotify(boolean flag)
Sets the flag that indicates whether or not the notification mechanism
is enabled.
|
void |
setPosition(org.jfree.ui.RectangleEdge position)
Sets the position for the title and sends a
TitleChangeEvent to
all registered listeners. |
void |
setVerticalAlignment(org.jfree.ui.VerticalAlignment alignment)
Sets the vertical alignment for the title, and notifies any registered
listeners of the change.
|
void |
setVisible(boolean visible)
Sets a flag that controls whether or not the title should be drawn, and
sends a
TitleChangeEvent to all registered listeners. |
arrange, arrange, getBorder, getBounds, getContentXOffset, getContentYOffset, getFrame, getHeight, getID, getMargin, getPadding, getWidth, setBorder, setBorder, setBounds, setFrame, setHeight, setID, setMargin, setMargin, setPadding, setPadding, setWidth
public static final org.jfree.ui.RectangleEdge DEFAULT_POSITION
public static final org.jfree.ui.HorizontalAlignment DEFAULT_HORIZONTAL_ALIGNMENT
public static final org.jfree.ui.VerticalAlignment DEFAULT_VERTICAL_ALIGNMENT
public static final org.jfree.ui.RectangleInsets DEFAULT_PADDING
public boolean visible
public boolean isVisible()
true
.setVisible(boolean)
public void setVisible(boolean visible)
TitleChangeEvent
to all registered listeners.visible
- the new flag value.isVisible()
public org.jfree.ui.RectangleEdge getPosition()
null
).public void setPosition(org.jfree.ui.RectangleEdge position)
TitleChangeEvent
to
all registered listeners.position
- the position (null
not permitted).public org.jfree.ui.HorizontalAlignment getHorizontalAlignment()
null
).public void setHorizontalAlignment(org.jfree.ui.HorizontalAlignment alignment)
TitleChangeEvent
to all registered listeners.alignment
- the horizontal alignment (null
not
permitted).public org.jfree.ui.VerticalAlignment getVerticalAlignment()
null
).public void setVerticalAlignment(org.jfree.ui.VerticalAlignment alignment)
alignment
- the new vertical alignment (TOP, MIDDLE or BOTTOM,
null
not permitted).public boolean getNotify()
public void setNotify(boolean flag)
flag
- the new value of the flag.public abstract void draw(Graphics2D g2, Rectangle2D area)
draw
in interface org.jfree.ui.Drawable
g2
- the graphics device.area
- the area allocated for the title (subclasses should not
draw outside this area).public Object clone() throws CloneNotSupportedException
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.
clone
in class AbstractBlock
CloneNotSupportedException
- not thrown by this class, but it may
be thrown by subclasses.public void addChangeListener(TitleChangeListener listener)
listener
- the object that is being registered.public void removeChangeListener(TitleChangeListener listener)
listener
- the object that is being unregistered.public boolean equals(Object obj)
equals
in class AbstractBlock
obj
- the object (null
not permitted).true
or false
.Jas4pp 1.5 © Java Analysis Studio for Particle Physics