de.erichseifert.gral.plots.axes
Interface AxisRenderer

All Superinterfaces:
SettingsStorage
All Known Implementing Classes:
AbstractAxisRenderer2D, LinearRenderer2D, LogarithmicRenderer2D

public interface AxisRenderer
extends SettingsStorage

Interface for generic renderers of axes.


Field Summary
static Settings.Key INTERSECTION
          Key for specifying the intersection point of axis.
static Settings.Key LABEL
          Key for specifying the String instance for the label text of the axis.
static Settings.Key LABEL_COLOR
          Key for specifying the Paint instance to be used to paint the axis label.
static Settings.Key LABEL_DISTANCE
          Key for specifying a Number value for the distance from the axis to the label.
static Settings.Key LABEL_ROTATION
          Key for specifying a Number value for the rotation of the axis label in degrees.
static Settings.Key SHAPE
          Key for specifying the Shape instance that defines the shape of the axis.
static Settings.Key SHAPE_COLOR
          Key for specifying Paint instance to be used to paint the axis, its ticks and its labels.
static Settings.Key SHAPE_DIRECTION_SWAPPED
          Key for specifying a Boolean value which decides whether the axis direction will be changed.
static Settings.Key SHAPE_NORMAL_ORIENTATION_CLOCKWISE
          Key for specifying a Boolean value which decides whether normal vector is calculated using clockwise (true) or counterclockwise rotation (false).
static Settings.Key SHAPE_STROKE
          Key for specifying the Stroke instance which define the shape of the axis.
static Settings.Key SHAPE_VISIBLE
          Key for specifying a Boolean value which decides whether the shape of the axis will be drawn.
static Settings.Key TICK_LABELS
          Key for specifying whether tick labels are drawn.
static Settings.Key TICK_LABELS_DISTANCE
          Key for specifying a Number value for the distance of labels to their ticks.
static Settings.Key TICK_LABELS_FORMAT
          Key for specifying the {java.text.Format} instance which converts the tick values to labels.
static Settings.Key TICK_LABELS_OUTSIDE
          Key for specifying a Boolean value which decides whether the tick labels are drawn outside of the plot.
static Settings.Key TICK_LABELS_ROTATION
          Key for specifying a Number value for the rotation of the tick labels in degrees.
static Settings.Key TICKS
          Key for specifying a Boolean value which decides whether major ticks are drawn.
static Settings.Key TICKS_ALIGNMENT
          Key for specifying a Number value for the alignment of major ticks: 0.0 means outside, 0.5 means centered, 1.0 means inside.
static Settings.Key TICKS_COLOR
          Key for specifying the Paint instance to be used to paint the shapes of major ticks.
static Settings.Key TICKS_CUSTOM
          Custom labels as a Map with a position (Double) as key and a label (String) as value.
static Settings.Key TICKS_LENGTH
          Key for specifying a Number value for the length of major tick strokes.
static Settings.Key TICKS_MINOR
          Key for specifying a Boolean value which decides whether minor ticks are drawn.
static Settings.Key TICKS_MINOR_ALIGNMENT
          Key for specifying a Number value for the alignment of minor ticks: 0.0 means outside, 0.5 means centered, 1.0 means inside.
static Settings.Key TICKS_MINOR_COLOR
          Key for specifying the Paint instance to be used to paint the the shapes of minor ticks.
static Settings.Key TICKS_MINOR_COUNT
          Key for specifying an Integer value for the count of minor ticks.
static Settings.Key TICKS_MINOR_LENGTH
          Key for specifying a Number value for the length of minor tick strokes.
static Settings.Key TICKS_MINOR_STROKE
          Key for specifying the Stroke instance which is used to draw all minor ticks.
static Settings.Key TICKS_SPACING
          Key for specifying a Number value for the interval for major ticks.
static Settings.Key TICKS_STROKE
          Key for specifying the Stroke instance which is used to draw all major ticks.
 
Method Summary
 PointND<Double> getNormal(Axis axis, Number value, boolean extrapolate, boolean forceLinear)
          Returns the normal vector at the position of the specified value.
 PointND<Double> getPosition(Axis axis, Number value, boolean extrapolate, boolean forceLinear)
          Returns the position of the specified value on the axis.
 Drawable getRendererComponent(Axis axis)
          Returns a component that displays the specified axis.
 List<Tick> getTicks(Axis axis)
          Returns a list of all tick element on the axis.
 Number viewToWorld(Axis axis, double value, boolean extrapolate)
          Converts a view (screen) coordinate value to a world (axis) coordinate value.
 double worldToView(Axis axis, Number value, boolean extrapolate)
          Converts a world (axis) coordinate value to a view (screen) coordinate value.
 
Methods inherited from interface de.erichseifert.gral.util.SettingsStorage
getSetting, removeSetting, removeSettingDefault, setSetting, setSettingDefault
 

Field Detail

INTERSECTION

static final Settings.Key INTERSECTION
Key for specifying the intersection point of axis.


SHAPE

static final Settings.Key SHAPE
Key for specifying the Shape instance that defines the shape of the axis.


SHAPE_VISIBLE

static final Settings.Key SHAPE_VISIBLE
Key for specifying a Boolean value which decides whether the shape of the axis will be drawn. This doesn't influence ticks or labels.


SHAPE_NORMAL_ORIENTATION_CLOCKWISE

static final Settings.Key SHAPE_NORMAL_ORIENTATION_CLOCKWISE
Key for specifying a Boolean value which decides whether normal vector is calculated using clockwise (true) or counterclockwise rotation (false).


SHAPE_COLOR

static final Settings.Key SHAPE_COLOR
Key for specifying Paint instance to be used to paint the axis, its ticks and its labels.


SHAPE_STROKE

static final Settings.Key SHAPE_STROKE
Key for specifying the Stroke instance which define the shape of the axis.


SHAPE_DIRECTION_SWAPPED

static final Settings.Key SHAPE_DIRECTION_SWAPPED
Key for specifying a Boolean value which decides whether the axis direction will be changed.


TICKS

static final Settings.Key TICKS
Key for specifying a Boolean value which decides whether major ticks are drawn.


TICKS_SPACING

static final Settings.Key TICKS_SPACING
Key for specifying a Number value for the interval for major ticks.


TICKS_LENGTH

static final Settings.Key TICKS_LENGTH
Key for specifying a Number value for the length of major tick strokes. The length is specified relative to the font height.


TICKS_STROKE

static final Settings.Key TICKS_STROKE
Key for specifying the Stroke instance which is used to draw all major ticks.


TICKS_ALIGNMENT

static final Settings.Key TICKS_ALIGNMENT
Key for specifying a Number value for the alignment of major ticks: 0.0 means outside, 0.5 means centered, 1.0 means inside.


TICKS_COLOR

static final Settings.Key TICKS_COLOR
Key for specifying the Paint instance to be used to paint the shapes of major ticks.


TICK_LABELS

static final Settings.Key TICK_LABELS
Key for specifying whether tick labels are drawn.


TICK_LABELS_FORMAT

static final Settings.Key TICK_LABELS_FORMAT
Key for specifying the {java.text.Format} instance which converts the tick values to labels.


TICK_LABELS_DISTANCE

static final Settings.Key TICK_LABELS_DISTANCE
Key for specifying a Number value for the distance of labels to their ticks. The distance is specified relative to the font height.


TICK_LABELS_OUTSIDE

static final Settings.Key TICK_LABELS_OUTSIDE
Key for specifying a Boolean value which decides whether the tick labels are drawn outside of the plot.


TICK_LABELS_ROTATION

static final Settings.Key TICK_LABELS_ROTATION
Key for specifying a Number value for the rotation of the tick labels in degrees.


TICKS_MINOR

static final Settings.Key TICKS_MINOR
Key for specifying a Boolean value which decides whether minor ticks are drawn.


TICKS_MINOR_COUNT

static final Settings.Key TICKS_MINOR_COUNT
Key for specifying an Integer value for the count of minor ticks.


TICKS_MINOR_LENGTH

static final Settings.Key TICKS_MINOR_LENGTH
Key for specifying a Number value for the length of minor tick strokes. The length is specified relative to font height.


TICKS_MINOR_STROKE

static final Settings.Key TICKS_MINOR_STROKE
Key for specifying the Stroke instance which is used to draw all minor ticks.


TICKS_MINOR_ALIGNMENT

static final Settings.Key TICKS_MINOR_ALIGNMENT
Key for specifying a Number value for the alignment of minor ticks: 0.0 means outside, 0.5 means centered, 1.0 means inside.


TICKS_MINOR_COLOR

static final Settings.Key TICKS_MINOR_COLOR
Key for specifying the Paint instance to be used to paint the the shapes of minor ticks.


TICKS_CUSTOM

static final Settings.Key TICKS_CUSTOM
Custom labels as a Map with a position (Double) as key and a label (String) as value.


LABEL

static final Settings.Key LABEL
Key for specifying the String instance for the label text of the axis.


LABEL_DISTANCE

static final Settings.Key LABEL_DISTANCE
Key for specifying a Number value for the distance from the axis to the label. The length is specified relative to font height.


LABEL_ROTATION

static final Settings.Key LABEL_ROTATION
Key for specifying a Number value for the rotation of the axis label in degrees.


LABEL_COLOR

static final Settings.Key LABEL_COLOR
Key for specifying the Paint instance to be used to paint the axis label.

Method Detail

getRendererComponent

Drawable getRendererComponent(Axis axis)
Returns a component that displays the specified axis.

Parameters:
axis - axis to be displayed
Returns:
component displaying the axis
See Also:
Axis

worldToView

double worldToView(Axis axis,
                   Number value,
                   boolean extrapolate)
Converts a world (axis) coordinate value to a view (screen) coordinate value.

Parameters:
axis - Axis
value - World coordinate value to convert
extrapolate - Option to activate extrapolation value that are not on the axis
Returns:
Screen coordinate value

viewToWorld

Number viewToWorld(Axis axis,
                   double value,
                   boolean extrapolate)
Converts a view (screen) coordinate value to a world (axis) coordinate value.

Parameters:
axis - Axis
value - View coordinate value to convert
extrapolate - Option to activate extrapolation value that are not on the axis
Returns:
World coordinate value

getTicks

List<Tick> getTicks(Axis axis)
Returns a list of all tick element on the axis.

Parameters:
axis - Axis
Returns:
A list of Tick instances

getPosition

PointND<Double> getPosition(Axis axis,
                            Number value,
                            boolean extrapolate,
                            boolean forceLinear)
Returns the position of the specified value on the axis. The value is returned in view coordinates.

Parameters:
axis - Axis
value - World coordinate value to convert
extrapolate - Option to activate extrapolation value that are not on the axis
forceLinear - Force linear interpolation.
Returns:
N-dimensional point of the value

getNormal

PointND<Double> getNormal(Axis axis,
                          Number value,
                          boolean extrapolate,
                          boolean forceLinear)
Returns the normal vector at the position of the specified value. The vector is normalized.

Parameters:
axis - Axis
value - World coordinate value to convert
extrapolate - Option to activate extrapolation value that are not on the axis
forceLinear - Force linear interpolation.
Returns:
N-dimensional normal vector at the position


Copyright © 2009-2010. All Rights Reserved.