de.erichseifert.gral.plots.axes
Class AbstractAxisRenderer2D

java.lang.Object
  extended by de.erichseifert.gral.plots.axes.AbstractAxisRenderer2D
All Implemented Interfaces:
AxisRenderer, SettingsListener, SettingsStorage
Direct Known Subclasses:
LinearRenderer2D, LogarithmicRenderer2D

public abstract class AbstractAxisRenderer2D
extends Object
implements AxisRenderer, SettingsListener

Abstract class that provides function for rendering axes in two-dimensional space.

Functionality includes:


Field Summary
 
Fields inherited from interface de.erichseifert.gral.plots.axes.AxisRenderer
INTERSECTION, LABEL, LABEL_COLOR, LABEL_DISTANCE, LABEL_ROTATION, SHAPE, SHAPE_COLOR, SHAPE_DIRECTION_SWAPPED, SHAPE_NORMAL_ORIENTATION_CLOCKWISE, SHAPE_STROKE, SHAPE_VISIBLE, TICK_LABELS, TICK_LABELS_DISTANCE, TICK_LABELS_FORMAT, TICK_LABELS_OUTSIDE, TICK_LABELS_ROTATION, TICKS, TICKS_ALIGNMENT, TICKS_COLOR, TICKS_CUSTOM, TICKS_LENGTH, TICKS_MINOR, TICKS_MINOR_ALIGNMENT, TICKS_MINOR_COLOR, TICKS_MINOR_COUNT, TICKS_MINOR_LENGTH, TICKS_MINOR_STROKE, TICKS_SPACING, TICKS_STROKE
 
Constructor Summary
AbstractAxisRenderer2D()
          Initializes a new AbstractAxisRenderer2D instances with default settings.
 
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.
<T> T
getSetting(Settings.Key key)
          Returns the setting with the specified key.
 List<Tick> getTicks(Axis axis)
          Returns a list of all tick element on the axis.
<T> void
removeSetting(Settings.Key key)
          Removes the setting with the specified key.
<T> void
removeSettingDefault(Settings.Key key)
          Removes the default setting with the specified key.
<T> void
setSetting(Settings.Key key, T value)
          Sets the setting with the specified key to the specified value.
<T> void
setSettingDefault(Settings.Key key, T value)
          Sets a default value for the setting with the specified key.
 void settingChanged(SettingChangeEvent event)
          Invoked if a setting has changed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.erichseifert.gral.plots.axes.AxisRenderer
viewToWorld, worldToView
 

Constructor Detail

AbstractAxisRenderer2D

public AbstractAxisRenderer2D()
Initializes a new AbstractAxisRenderer2D instances with default settings.

Method Detail

getRendererComponent

public Drawable getRendererComponent(Axis axis)
Description copied from interface: AxisRenderer
Returns a component that displays the specified axis.

Specified by:
getRendererComponent in interface AxisRenderer
Parameters:
axis - axis to be displayed
Returns:
component displaying the axis
See Also:
Axis

getTicks

public List<Tick> getTicks(Axis axis)
Description copied from interface: AxisRenderer
Returns a list of all tick element on the axis.

Specified by:
getTicks in interface AxisRenderer
Parameters:
axis - Axis
Returns:
A list of Tick instances

getNormal

public PointND<Double> getNormal(Axis axis,
                                 Number value,
                                 boolean extrapolate,
                                 boolean forceLinear)
Description copied from interface: AxisRenderer
Returns the normal vector at the position of the specified value. The vector is normalized.

Specified by:
getNormal in interface AxisRenderer
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

getPosition

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

Specified by:
getPosition in interface AxisRenderer
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

getSetting

public <T> T getSetting(Settings.Key key)
Description copied from interface: SettingsStorage
Returns the setting with the specified key. If no setting is available, the default setting will be returned.

Specified by:
getSetting in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.
Returns:
Setting.

setSetting

public <T> void setSetting(Settings.Key key,
                           T value)
Description copied from interface: SettingsStorage
Sets the setting with the specified key to the specified value.

Specified by:
setSetting in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.
value - Value to be set.

removeSetting

public <T> void removeSetting(Settings.Key key)
Description copied from interface: SettingsStorage
Removes the setting with the specified key.

Specified by:
removeSetting in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.

setSettingDefault

public <T> void setSettingDefault(Settings.Key key,
                                  T value)
Description copied from interface: SettingsStorage
Sets a default value for the setting with the specified key.

Specified by:
setSettingDefault in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.
value - Value to be set.

removeSettingDefault

public <T> void removeSettingDefault(Settings.Key key)
Description copied from interface: SettingsStorage
Removes the default setting with the specified key.

Specified by:
removeSettingDefault in interface SettingsStorage
Type Parameters:
T - Type of setting.
Parameters:
key - Key.

settingChanged

public void settingChanged(SettingChangeEvent event)
Description copied from interface: SettingsListener
Invoked if a setting has changed.

Specified by:
settingChanged in interface SettingsListener
Parameters:
event - Event containing information about the changed setting.


Copyright © 2009-2010. All Rights Reserved.