lt.monarch.chart.mapper
Class NullAxisMapper

java.lang.Object
  extended by lt.monarch.chart.mapper.NullAxisMapper
All Implemented Interfaces:
java.io.Serializable, AxisMapper

public class NullAxisMapper
extends java.lang.Object
implements AxisMapper

Dummy Axis mapper, which just passes through all numeric values.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
NullAxisMapper()
           
 
Method Summary
Modifier and Type Method and Description
 void addListener(AxisMapperListener listener)
          Dummy implementation - does nothing.
 java.lang.String formatKey(java.lang.Object key)
          Dummy implementation - returns empty string.
 double getPreferredHeight(AbstractGraphics g, AbstractTextPainter textPainter)
          Gets preferred height.
 double getPreferredWidth(AbstractGraphics g, AbstractTextPainter textPainter)
          Gets preferred width.
 AxisMapperRange getProjectionRange()
          Gets axis projection range.
 AxisScale getScale()
          Dummy implementation - returns null.
 AxisMapperRange getViewRange()
          Gets an AxisMapperRange object representing visible axis range.
 double map(java.lang.Object key)
          Dummy implementation - casts the key to Number and returns it's double value.
 java.lang.Object mapBack(double pos)
          Dummy implementation - returns null.
 void removeListener(AxisMapperListener listener)
          Dummy implementation - does nothing.
 void setProjectionRange(double min, double max)
          Sets axis projection range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullAxisMapper

public NullAxisMapper()
Method Detail

addListener

public void addListener(AxisMapperListener listener)
Dummy implementation - does nothing.

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

removeListener

public void removeListener(AxisMapperListener listener)
Dummy implementation - does nothing.

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

getScale

public AxisScale getScale()
Dummy implementation - returns null.

Specified by:
getScale in interface AxisMapper
Returns:
null

map

public double map(java.lang.Object key)
Dummy implementation - casts the key to Number and returns it's double value.

Specified by:
map in interface AxisMapper
Parameters:
key - the key to map
Returns:
double value of the key

mapBack

public java.lang.Object mapBack(double pos)
Dummy implementation - returns null.

Specified by:
mapBack in interface AxisMapper
Parameters:
pos - position on mapping range
Returns:
null

formatKey

public java.lang.String formatKey(java.lang.Object key)
Dummy implementation - returns empty string.

Specified by:
formatKey in interface AxisMapper
Parameters:
key - the key to format
Returns:
empty string

setProjectionRange

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

Specified by:
setProjectionRange in interface AxisMapper
Parameters:
min - range minimum in range [0,1]
max - range maximum in range [0,1]

getProjectionRange

public AxisMapperRange getProjectionRange()
Gets axis projection range.

Specified by:
getProjectionRange in interface AxisMapper
Returns:
mapper projection range

getViewRange

public AxisMapperRange getViewRange()
Description copied from interface: AxisMapper
Gets an AxisMapperRange object representing visible axis range. The object can be used to set visible axis range. Returns normalized value from [0..1]

Specified by:
getViewRange in interface AxisMapper
Returns:
AxisMapperRange object representing visible axis range

getPreferredHeight

public double getPreferredHeight(AbstractGraphics g,
                                 AbstractTextPainter textPainter)
Description copied from interface: AxisMapper
Gets preferred height.

Specified by:
getPreferredHeight in interface AxisMapper
Parameters:
g - graphics context
textPainter - text painter mode
Returns:
preferred height

getPreferredWidth

public double getPreferredWidth(AbstractGraphics g,
                                AbstractTextPainter textPainter)
Description copied from interface: AxisMapper
Gets preferred width.

Specified by:
getPreferredWidth in interface AxisMapper
Parameters:
g - graphics context
textPainter - text painter mode
Returns:
preferred width