info.monitorenter.gui.chart
Interface IAxisTitlePainter

All Superinterfaces:
Serializable
All Known Implementing Classes:
AxisTitlePainterDefault

public interface IAxisTitlePainter
extends Serializable

Interface for an painter of the title of an axis of the Chart2D.

Since:
2.2.1
Version:
$Revision: 1.6 $
Author:
Achim Westermann

Field Summary
static String PROPERTY_TITLEFONT
          Constant for a PropertyChangeEvent of the title font.
 
Method Summary
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Add a listener for the given property.
 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).
 Font getTitleFont()
          Returns the font used for painting the title or null if not configured.
 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 paintTitle(IAxis axis, Graphics2D g)
          Invoked to let implementations paint the given title of the given axis.
 void removePropertyChangeListener(String property, PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 void setTitleFont(Font font)
          Sets the title font to use.
 

Field Detail

PROPERTY_TITLEFONT

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

See Also:
Constant Field Values
Method Detail

addPropertyChangeListener

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_TITLEFONT IAxisTitlePainter that changed Font, the old value. Font, the new value.

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

getPropertyChangeListeners

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)

removePropertyChangeListener

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)

getHeight

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.

setTitleFont

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

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

getTitleFont

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

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

getWidth

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.

paintTitle

void paintTitle(IAxis axis,
                Graphics2D g)
Invoked to let implementations paint the given title of the given axis.

Implementations should make use of the information about the axis coordinates (start pixel,end pixel) and the graphics context (for font dimensions) to do it right.

Parameters:
axis - the axis to paint the title of, needed e.g. to IAxis.getTitle().
g - needed for size informations.


Copyright © 2001 - 2007 LGPL, All Rights Footloose.