info.monitorenter.gui.chart.labelformatters
Class ALabelFormatter

java.lang.Object
  extended by info.monitorenter.gui.chart.labelformatters.ALabelFormatter
All Implemented Interfaces:
IAxisLabelFormatter, Serializable
Direct Known Subclasses:
LabelFormatterAutoUnits, LabelFormatterDate, LabelFormatterNumber, LabelFormatterUnit

public abstract class ALabelFormatter
extends Object
implements IAxisLabelFormatter

A label formatter that is aware of the AAxis it formats label for.

This allows to compute the amount of fraction digits needed from the range to display.

Version:
$Revision: 1.6 $
Author:
Achim Westermann
See Also:
Serialized Form

Field Summary
protected  PropertyChangeSupport m_propertyChangeSupport
          Support for acting as a property change event producer for listeners.
static AUnit UNIT_UNCHANGED
          The default unit with the factor 1 that is returned as the default for getUnit().
 
Fields inherited from interface info.monitorenter.gui.chart.IAxisLabelFormatter
PROPERTY_FORMATCHANGE
 
Constructor Summary
protected ALabelFormatter()
          Default constructor.
 
Method Summary
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Registers a property change listener that will be informed about changes of the property identified by the given propertyName.
 IAxis getAxis()
          Intended for AAxis only.
 int getMaxAmountChars()
          Returns the maximum amount of characters that will be returned from IAxisLabelFormatter.format(double).
 AUnit getUnit()
          Returns UNIT_UNCHANGED.
 void initPaintIteration()
          Void adapter method implementation - optional to override.
 void removePropertyChangeListener(String property, PropertyChangeListener listener)
          Deregisters a property change listener that has been registerd for listening on the given property.
 void setAxis(IAxis axis)
          Intended for AAxis only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.monitorenter.gui.chart.IAxisLabelFormatter
format, getMinimumValueShiftForChange, getNextEvenValue, parse
 

Field Detail

UNIT_UNCHANGED

public static final AUnit UNIT_UNCHANGED
The default unit with the factor 1 that is returned as the default for getUnit().


m_propertyChangeSupport

protected PropertyChangeSupport m_propertyChangeSupport
Support for acting as a property change event producer for listeners.

Constructor Detail

ALabelFormatter

protected ALabelFormatter()
Default constructor.

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Description copied from interface: IAxisLabelFormatter
Registers a property change listener that will be informed about changes of the property identified by the given propertyName.

Specified by:
addPropertyChangeListener in interface IAxisLabelFormatter
Parameters:
propertyName - the name of the property the listener is interested in
listener - a listener that will only be informed if the property identified by the argument propertyName changes
See Also:
IAxisLabelFormatter.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

getAxis

public IAxis getAxis()
Intended for AAxis only.

Returns:
Returns the axis.

getMaxAmountChars

public int getMaxAmountChars()
Returns the maximum amount of characters that will be returned from IAxisLabelFormatter.format(double).

Specified by:
getMaxAmountChars in interface IAxisLabelFormatter
Returns:
the maximum amount of characters that will be returned from IAxisLabelFormatter.format(double).

getUnit

public AUnit getUnit()
Returns UNIT_UNCHANGED.

Specified by:
getUnit in interface IAxisLabelFormatter
Returns:
UNIT_UNCHANGED
See Also:
IAxisLabelFormatter.getUnit()

initPaintIteration

public void initPaintIteration()
Void adapter method implementation - optional to override.

Specified by:
initPaintIteration in interface IAxisLabelFormatter
See Also:
IAxisLabelFormatter.initPaintIteration()

removePropertyChangeListener

public void removePropertyChangeListener(String property,
                                         PropertyChangeListener listener)
Description copied from interface: IAxisLabelFormatter
Deregisters a property change listener that has been registerd for listening on the given property.

Specified by:
removePropertyChangeListener in interface IAxisLabelFormatter
Parameters:
property - the property the listener was registered to.
listener - a listener that will only be informed if the property identified by the argument propertyName changes
See Also:
IAxisLabelFormatter.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener)

setAxis

public void setAxis(IAxis axis)
Intended for AAxis only.

Do never invoke this! This is only public for package sorting reasons.

Specified by:
setAxis in interface IAxisLabelFormatter
Parameters:
axis - The m_axis to set.


Copyright © 2001 - 2007 LGPL, All Rights Footloose.