lt.monarch.chart.mapper
Interface AxisMapper

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractAxisMapper, AbstractRadarMapper, AnalogAxisMapper, AxisMapperInverter, CountableAxisMapper, DateAxisMapper, DateListAxisMapper, GroupedLabelsAxisMapper, LabelAxisMapper, LogAxisMapper, MathAxisMapper, NullAxisMapper, RadarMapper

public interface AxisMapper
extends java.io.Serializable

AxisMapper is responsible for mapping an Object value of some coordinate space into a double value in range [0,1].


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.
 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.
 

Method Detail

addListener

void addListener(AxisMapperListener listener)
Adds a mapper change listener.

Parameters:
listener - listener

removeListener

void removeListener(AxisMapperListener listener)
Removes a mapper change listener.

Parameters:
listener - listener

getScale

AxisScale getScale()
Returns a scale object for this axis.

Returns:
scale object

map

double map(java.lang.Object key)
Finds the position for the coordinate value.

Parameters:
key - value in some coordinate space
Returns:
a value in range [0,1]

mapBack

java.lang.Object mapBack(double pos)
Converts the position on the coordinate axis to the value in some coordinate space.

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

formatKey

java.lang.String formatKey(java.lang.Object key)
Provides text representation of the coordinate value.

Parameters:
key - value in some coordinate space
Returns:
text representation of a coordinate value.

setProjectionRange

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

Parameters:
min - range minimum in range [0,1]
max - range maximum in range [0,1]

getProjectionRange

AxisMapperRange getProjectionRange()
Gets axis projection range.

Returns:
mapper projection range

getViewRange

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

Returns:
AxisMapperRange object representing visible axis range

getPreferredHeight

double getPreferredHeight(AbstractGraphics g,
                          AbstractTextPainter textPainter)
Gets preferred height.

Parameters:
g - graphics context
textPainter - text painter mode
Returns:
preferred height

getPreferredWidth

double getPreferredWidth(AbstractGraphics g,
                         AbstractTextPainter textPainter)
Gets preferred width.

Parameters:
g - graphics context
textPainter - text painter mode
Returns:
preferred width