public static final class IAxis.AxisTitle extends Object implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
PROPERTY_TITLE
Constant for a
of the
title font. |
static String |
PROPERTY_TITLECOLOR
Constant for a
of the
title font. |
static String |
PROPERTY_TITLEFONT
Constant for a
of the
title font. |
static String |
PROPERTY_TITLEPAINTER
Constant for a
of the
title font. |
Constructor and Description |
---|
AxisTitle(String title)
Creates an instance with the given title backed by a
. |
AxisTitle(String title,
IAxisTitlePainter painter)
Creates an instance with the given title backed by the given painter.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Add a listener for the given property.
|
protected Object |
clone() |
int |
getHeight(IAxis<?> axis,
Graphics2D g2d)
Returns the height of this axis title in px with respect to the current
title of the given axis.
|
PropertyChangeListener[] |
getPropertyChangeListeners(String propertyName)
Returns an array of all the listeners that were added to the this
instance with
addPropertyChangeListener(String, PropertyChangeListener) . |
String |
getTitle()
Returns the title or
null if there was no title configured
before. |
Color |
getTitleColor()
Returns the color used for painting the title.
|
Font |
getTitleFont()
Returns the optional font used for painting the title or null if not
configured.
|
IAxisTitlePainter |
getTitlePainter()
Returns the titlePainter.
|
int |
getWidth(IAxis<?> axis,
Graphics2D g2d)
Returns the width of this axis title in px with respect to the current
title of the given axis.
|
void |
removePropertyChangeListener(String property,
PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property.
|
String |
setTitle(String title)
Sets the title or
null if there should be no title. |
void |
setTitleColor(Color color)
Sets the title color to use.
|
void |
setTitleFont(Font font)
Sets the optional title font to use.
|
IAxisTitlePainter |
setTitlePainter(IAxisTitlePainter titlePainter)
Sets the titlePainter.
|
public static final String PROPERTY_TITLE
PropertyChangeEvent
of the
title font.public static final String PROPERTY_TITLECOLOR
PropertyChangeEvent
of the
title font.public static final String PROPERTY_TITLEFONT
PropertyChangeEvent
of the
title font.public static final String PROPERTY_TITLEPAINTER
PropertyChangeEvent
of the
title font.public AxisTitle(String title)
AxisTitlePainterDefault
.
title
- the title to use.public AxisTitle(String title, IAxisTitlePainter painter)
title
- the title to use.painter
- the painter to use.public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
The following
types
should be fired to listeners:PropertyChangeEvent
getPropertyName() |
getSource() |
getOldValue() |
getNewValue() |
---|---|---|---|
|
that changed |
, the old value. |
, the new value. |
|
that changed |
, the old value. |
, the new value. |
|
that changed |
, the old value. |
, the new value. |
|
that changed |
, the old value. |
, the new value. |
propertyName
- the property to be informed about changes.listener
- the listener that will be informed.protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Object.clone()
public int getHeight(IAxis<?> axis, Graphics2D g2d)
axis
- the instance this title painter is working for.g2d
- needed for size informations (e.g. font widths).public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
addPropertyChangeListener(String, PropertyChangeListener)
.
propertyName
- The name of the property being listened to.addPropertyChangeListener(String, PropertyChangeListener)
.PropertyChangeSupport.getPropertyChangeListeners(java.lang.String)
public final String getTitle()
null
if there was no title configured
before.
null
if there was no title configured
before.public Color getTitleColor()
Default is
.
Color.BLACK
public Font getTitleFont()
public final IAxisTitlePainter getTitlePainter()
public int getWidth(IAxis<?> axis, Graphics2D g2d)
axis
- the instance this title painter is working for.g2d
- needed for size informations (e.g. font widths).public void removePropertyChangeListener(String property, PropertyChangeListener listener)
listener
was added more than once to the same event source
for the specified property, it will be notified one less time after being
removed. If propertyName
is null, no exception is thrown and
no action is taken. If listener
is null, or was never added
for the specified property, no exception is thrown and no action is
taken.property
- The name of the property that was listened on.listener
- The PropertyChangeListener to be removed.PropertyChangeSupport.removePropertyChangeListener(java.lang.String,
java.beans.PropertyChangeListener)
public final String setTitle(String title)
null
if there should be no title.
title
- the title or null
if no title should be used.public void setTitleColor(Color color)
Default is
.
Color.BLACK
color
- the color to use for the title.public void setTitleFont(Font font)
font
- the font to use for the title.public final IAxisTitlePainter setTitlePainter(IAxisTitlePainter titlePainter)
titlePainter
- the titlePainter to set.Copyright © 2001 - 2010 LGPL, All Rights Footloose.