lt.monarch.chart.mapper
Class AbstractAxisMapper

java.lang.Object
  extended by lt.monarch.chart.mapper.AbstractAxisMapper
All Implemented Interfaces:
java.io.Serializable, AxisMapper
Direct Known Subclasses:
AbstractRadarMapper, AnalogAxisMapper, CountableAxisMapper

public abstract class AbstractAxisMapper
extends java.lang.Object
implements AxisMapper, java.io.Serializable

Base implementation of axis mapper.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
AbstractAxisMapper()
           
 
Method Summary
Modifier and Type Method and Description
 void addListener(AxisMapperListener listener)
          Adds specified axis mapper listener to receive notification when axis mapping changed.
protected  void fireMappingChanged()
          Notifies all listeners that axis mapping changed.
 AxisMapperRange getProjectionRange()
          Returns projection range of this axis mapper.
 java.lang.Object mapBack(double pos)
          Default implementation of AxisMapper mapBack method.
 void removeListener(AxisMapperListener listener)
          Removes specified axis mapper listener so that it no longer receives notifications from this mapper.
 void setProjectionRange(double min, double max)
          Sets projection range for this axis mapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface lt.monarch.chart.mapper.AxisMapper
formatKey, getPreferredHeight, getPreferredWidth, getScale, getViewRange, map
 

Constructor Detail

AbstractAxisMapper

public AbstractAxisMapper()
Method Detail

addListener

public void addListener(AxisMapperListener listener)
Adds specified axis mapper listener to receive notification when axis mapping changed. If listener is null, no exception is thrown and no action is performed.

Specified by:
addListener in interface AxisMapper
Parameters:
listener - the axis mapper listener

removeListener

public void removeListener(AxisMapperListener listener)
Removes specified axis mapper listener so that it no longer receives notifications from this mapper. If listener is null, no exception is thrown and no action is performed.

Specified by:
removeListener in interface AxisMapper
Parameters:
listener - the axis mapper listener

fireMappingChanged

protected void fireMappingChanged()
Notifies all listeners that axis mapping changed.


mapBack

public java.lang.Object mapBack(double pos)
Default implementation of AxisMapper mapBack method. Every axis mapper that supports back mapping should override this method.

Specified by:
mapBack in interface AxisMapper
Parameters:
pos - position in range [0,1]
Returns:
null
See Also:
AxisMapper.mapBack(double)

setProjectionRange

public void setProjectionRange(double min,
                               double max)
Sets projection range for this axis mapper.

Specified by:
setProjectionRange in interface AxisMapper
Parameters:
min - range lower bound
max - range upper bound
See Also:
AxisMapperRange

getProjectionRange

public AxisMapperRange getProjectionRange()
Returns projection range of this axis mapper.

Specified by:
getProjectionRange in interface AxisMapper
Returns:
the projection range
See Also:
AxisMapperRange