lt.monarch.chart.mapper
Class AbstractRadarMapper

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

public abstract class AbstractRadarMapper
extends AbstractAxisMapper

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  int axisCount
          Number of axes
protected  AxisMapper axisMapper
          An axis mapper object used to map data values on each radar axis
protected  double initAngle
          The initial rotation angle for axis (in radians)
protected  java.util.ArrayList<AbstractDataModel> models
          An array of registered data models
 double radius
          Relative length of radar axes.
 
Constructor Summary
Constructor and Description
AbstractRadarMapper(AxisMapper axisMapper)
           
 
Method Summary
Modifier and Type Method and Description
 java.lang.String formatKey(java.lang.Object key)
          Provides text representation of the coordinate value.
 int getAxisCount()
          Returns the number of axes in the chart.
 double getInitAxisPosition()
          Returns the initial rotation angle for axis (in radians).
 double getPreferredHeight(AbstractGraphics g, AbstractTextPainter textPainter)
          Gets preferred height.
 double getPreferredWidth(AbstractGraphics g, AbstractTextPainter textPainter)
          Gets preferred width.
 AxisScale getScale()
          Returns a scale object for this axis.
 AxisMapperRange getViewRange()
          Gets an AxisMapperRange object representing visible axis range.
abstract  PolarPoint map(java.lang.Double angle, java.lang.Object value)
          Maps the polar values the polar point.
 double map(java.lang.Object key)
          Deprecated. 
abstract  PolarPoint mapAxis(java.lang.Integer index, java.lang.Object value)
          Maps the point on the specified radar axis to the polar point, when the relative position on the radar axis is already known.
 void setAxisCount(int axisCount)
           
 void setInitAxisPosition(double angle)
          Sets the initial rotation angle for axis (in radians).
 
Methods inherited from class lt.monarch.chart.mapper.AbstractAxisMapper
addListener, fireMappingChanged, getProjectionRange, mapBack, removeListener, setProjectionRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

public final double radius
Relative length of radar axes. Default value is 0.4d.

See Also:
Constant Field Values

axisMapper

protected final AxisMapper axisMapper
An axis mapper object used to map data values on each radar axis


models

protected java.util.ArrayList<AbstractDataModel> models
An array of registered data models


axisCount

protected int axisCount
Number of axes


initAngle

protected double initAngle
The initial rotation angle for axis (in radians)

Constructor Detail

AbstractRadarMapper

public AbstractRadarMapper(AxisMapper axisMapper)
Method Detail

formatKey

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

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

getPreferredHeight

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

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.

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

getScale

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

Returns:
scale object

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]

Returns:
AxisMapperRange object representing visible axis range

map

@Deprecated
public double map(java.lang.Object key)
Deprecated. 

Description copied from interface: AxisMapper
Finds the position for the coordinate value.

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

setAxisCount

public void setAxisCount(int axisCount)

getAxisCount

public int getAxisCount()
Returns the number of axes in the chart. It is determined by calculating the maximum number of data values in each radar data model.

Returns:
number of axes in the chart

setInitAxisPosition

public void setInitAxisPosition(double angle)
Sets the initial rotation angle for axis (in radians).

Parameters:
angle - rotation angle in radians

getInitAxisPosition

public double getInitAxisPosition()
Returns the initial rotation angle for axis (in radians).

Returns:
double rotation in radians

map

public abstract PolarPoint map(java.lang.Double angle,
                               java.lang.Object value)
Maps the polar values the polar point.

Parameters:
angle - angle of the polar coordinate
value - radius of the polar coordinate
Returns:
polar point in the polar coordinate system

mapAxis

public abstract PolarPoint mapAxis(java.lang.Integer index,
                                   java.lang.Object value)
Maps the point on the specified radar axis to the polar point, when the relative position on the radar axis is already known.

Parameters:
index - radar axis index
value - position on the axis
Returns:
polar point in the polar coordinate system