lt.monarch.chart.mapper
Interface AxisScale

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AnalogAxisScale, DateAxisMapper.DateScale, DateAxisMapper.DefaultDateScale, DateAxisMapper.StepScale, LogAxisScale, LogAxisScale.SubScale, MathAxisScale, MathAxisScale.SubScale

public interface AxisScale
extends java.io.Serializable

AxisScale lists axis measurement marks and labels.


Method Summary
Modifier and Type Method and Description
 int findNearestMark(double d)
          Finds the nearest mark from the given position on the axis.
 java.lang.String getLabelAt(int i)
          Returns an appropriate label for the axis mark.
 java.lang.String getLabelAt(int i, java.util.Locale locale)
          Returns an appropriate label for the axis mark formatted according to the given Locale.
 int getMarkCount()
          Returns the axis mark count.
 AxisScale getSubScale()
          Returns a sub-scale for the scale.
 double mapMark(int i)
          Finds the position for the axis measurement mark.
 double[] mapMarkTicks(int i)
          Finds the position for the axis measurement mark ticks (some scales marks can have 2 or more ticks).
 

Method Detail

mapMark

double mapMark(int i)
Finds the position for the axis measurement mark.

Parameters:
i - label index
Returns:
a value in range [0,1]

findNearestMark

int findNearestMark(double d)
Finds the nearest mark from the given position on the axis.

Parameters:
d - position on axis in range [0,1]
Returns:
mark index

getMarkCount

int getMarkCount()
Returns the axis mark count.

Returns:
label count

getLabelAt

java.lang.String getLabelAt(int i)
Returns an appropriate label for the axis mark.

Parameters:
i - label index
Returns:
label text

getLabelAt

java.lang.String getLabelAt(int i,
                            java.util.Locale locale)
Returns an appropriate label for the axis mark formatted according to the given Locale.

Parameters:
i - label index
locale - the locale
Returns:
label text

getSubScale

AxisScale getSubScale()
Returns a sub-scale for the scale. The sub-scale handles the same axis interval, but is finer-grained than the parent scale.

Returns:
sub-scale or null if no sub-scale exists

mapMarkTicks

double[] mapMarkTicks(int i)
Finds the position for the axis measurement mark ticks (some scales marks can have 2 or more ticks).

Parameters:
i - label index
Returns:
a value array in range [0,1]