info.monitorenter.gui.chart
Class IAxis.AxisTitle

java.lang.Object
  extended by info.monitorenter.gui.chart.IAxis.AxisTitle
All Implemented Interfaces:
Serializable, Cloneable
Enclosing interface:
IAxis

public static final class IAxis.AxisTitle
extends Object
implements Cloneable, Serializable

Represents a title of an axis.

Since:
3.0.0
Version:
$Revision: 1.39 $
Author:
Achim Westermann
See Also:
Serialized Form

Field Summary
static String PROPERTY_TITLE
          Constant for a PropertyChangeEvent of the title font.
static String PROPERTY_TITLECOLOR
          Constant for a PropertyChangeEvent of the title font.
static String PROPERTY_TITLEFONT
          Constant for a PropertyChangeEvent of the title font.
static String PROPERTY_TITLEPAINTER
          Constant for a PropertyChangeEvent of the title font.
 
Constructor Summary
IAxis.AxisTitle(String title)
          Creates an instance with the given title backed by a AxisTitlePainterDefault.
IAxis.AxisTitle(String title, IAxisTitlePainter painter)
          Creates an instance with the given title backed by the given painter.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_TITLE

public static final String PROPERTY_TITLE
Constant for a PropertyChangeEvent of the title font.

See Also:
Constant Field Values

PROPERTY_TITLECOLOR

public static final String PROPERTY_TITLECOLOR
Constant for a PropertyChangeEvent of the title font.

See Also:
Constant Field Values

PROPERTY_TITLEFONT

public static final String PROPERTY_TITLEFONT
Constant for a PropertyChangeEvent of the title font.

See Also:
Constant Field Values

PROPERTY_TITLEPAINTER

public static final String PROPERTY_TITLEPAINTER
Constant for a PropertyChangeEvent of the title font.

See Also:
Constant Field Values
Constructor Detail

IAxis.AxisTitle

public IAxis.AxisTitle(String title)
Creates an instance with the given title backed by a AxisTitlePainterDefault.

Parameters:
title - the title to use.

IAxis.AxisTitle

public IAxis.AxisTitle(String title,
                       IAxisTitlePainter painter)
Creates an instance with the given title backed by the given painter.

Parameters:
title - the title to use.
painter - the painter to use.
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Add a listener for the given property.

The following PropertyChangeEvent types should be fired to listeners:

getPropertyName() getSource() getOldValue() getNewValue()
PROPERTY_TITLE IAxis.AxisTitle that changed String, the old value. String, the new value.
PROPERTY_TITLEFONT IAxis.AxisTitle that changed Font, the old value. Font, the new value.
PROPERTY_TITLEPAINTER IAxis.AxisTitle that changed IAxisTitlePainter, the old value. IAxisTitlePainter, the new value.
PROPERTY_TITLECOLOR IAxis.AxisTitle that changed Color, the old value. Color, the new value.

Parameters:
propertyName - the property to be informed about changes.
listener - the listener that will be informed.

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException
See Also:
Object.clone()

getHeight

public 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.

Parameters:
axis - the instance this title painter is working for.
g2d - needed for size informations (e.g. font widths).
Returns:
the height of this axis title in px with respect to the current title of the given axis.

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
Returns an array of all the listeners that were added to the this instance with addPropertyChangeListener(String, PropertyChangeListener).

Parameters:
propertyName - The name of the property being listened to.
Returns:
an array of all the listeners that were added to the this instance with addPropertyChangeListener(String, PropertyChangeListener) .
See Also:
PropertyChangeSupport.getPropertyChangeListeners(java.lang.String)

getTitle

public final String getTitle()
Returns the title or null if there was no title configured before.

Returns:
the title or null if there was no title configured before.

getTitleColor

public Color getTitleColor()
Returns the color used for painting the title.

Default is Color.BLACK.

Returns:
the color used for painting the title.

getTitleFont

public Font getTitleFont()
Returns the optional font used for painting the title or null if not configured.

Returns:
the font used for painting the title or null if not configured.

getTitlePainter

public final IAxisTitlePainter getTitlePainter()
Returns the titlePainter.

Returns:
the titlePainter

getWidth

public 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.

Parameters:
axis - the instance this title painter is working for.
g2d - needed for size informations (e.g. font widths).
Returns:
the width of this axis title in px with respect to the current title of the given axis.

removePropertyChangeListener

public void removePropertyChangeListener(String property,
                                         PropertyChangeListener listener)
Remove a PropertyChangeListener for a specific property. If 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.

Parameters:
property - The name of the property that was listened on.
listener - The PropertyChangeListener to be removed.
See Also:
PropertyChangeSupport.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

setTitle

public final String setTitle(String title)
Sets the title or null if there should be no title.

Parameters:
title - the title or null if no title should be used.
Returns:
the previous title or null if there was none before.

setTitleColor

public void setTitleColor(Color color)
Sets the title color to use.

Default is Color.BLACK.

Parameters:
color - the color to use for the title.

setTitleFont

public void setTitleFont(Font font)
Sets the optional title font to use.

Parameters:
font - the font to use for the title.

setTitlePainter

public final IAxisTitlePainter setTitlePainter(IAxisTitlePainter titlePainter)
Sets the titlePainter.

Parameters:
titlePainter - the titlePainter to set.
Returns:
the previous title painter or null if there was none before.


Copyright © 2001 - 2010 LGPL, All Rights Footloose.