lt.monarch.chart.mapper
Class AxisMapperInverter

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

public class AxisMapperInverter
extends java.lang.Object
implements AxisMapper

Axis mapper inverter.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  AxisMapper mapper
           
 
Constructor Summary
Constructor and Description
AxisMapperInverter(AxisMapper mapper)
           
 
Method Summary
Modifier and Type Method and Description
 void addListener(AxisMapperListener listener)
          Adds a mapper change listener.
 java.lang.String formatKey(java.lang.Object key)
          Provides text representation of the coordinate value.
 AxisMapper getMapper()
           
 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()
          Returns a scale object for this axis.
 AxisMapperRange getViewRange()
          Gets an AxisMapperRange object representing visible axis range.
 double map(java.lang.Object key)
          Finds the position for the coordinate value.
 java.lang.Object mapBack(double pos)
          Converts the position on the coordinate axis to the value in some coordinate space.
 void removeListener(AxisMapperListener listener)
          Removes a mapper change listener.
 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
 

Field Detail

mapper

protected AxisMapper mapper
Constructor Detail

AxisMapperInverter

public AxisMapperInverter(AxisMapper mapper)
Method Detail

getMapper

public AxisMapper getMapper()

addListener

public void addListener(AxisMapperListener listener)
Description copied from interface: AxisMapper
Adds a mapper change listener.

Specified by:
addListener in interface AxisMapper
Parameters:
listener - listener

removeListener

public void removeListener(AxisMapperListener listener)
Description copied from interface: AxisMapper
Removes a mapper change listener.

Specified by:
removeListener in interface AxisMapper
Parameters:
listener - listener

getScale

public AxisScale getScale()
Description copied from interface: AxisMapper
Returns a scale object for this axis.

Specified by:
getScale in interface AxisMapper
Returns:
scale object

map

public double map(java.lang.Object key)
Description copied from interface: AxisMapper
Finds the position for the coordinate value.

Specified by:
map in interface AxisMapper
Parameters:
key - value in some coordinate space
Returns:
a value in range [0,1]

mapBack

public java.lang.Object mapBack(double pos)
Description copied from interface: AxisMapper
Converts the position on the coordinate axis to the value in some coordinate space.

Specified by:
mapBack in interface AxisMapper
Parameters:
pos - position in range [0,1]
Returns:
a value in some coordinate space. Returns null if back mapping is not supported

formatKey

public java.lang.String formatKey(java.lang.Object key)
Description copied from interface: AxisMapper
Provides text representation of the coordinate value.

Specified by:
formatKey in interface AxisMapper
Parameters:
key - value in some coordinate space
Returns:
text representation of a coordinate value.

setProjectionRange

public void setProjectionRange(double min,
                               double max)
Description copied from interface: AxisMapper
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()
Description copied from interface: AxisMapper
Gets axis projection range.

Specified by:
getProjectionRange in interface AxisMapper
Returns:
mapper projection 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

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