T
- Used to enforce that this instance only accepts
AxisScalePolicyTransformation
and subtypes.public abstract class AAxisTransformation<T extends AxisScalePolicyTransformation> extends AAxis<T>
Note that instances of this implementations will only accept subtypes of
AxisScalePolicyTransformation
for the method
AAxis.setAxisScalePolicy(IAxisScalePolicy)
.
Modifier and Type | Class and Description |
---|---|
protected class |
AAxisTransformation.XDataAccessor
An accessor for the x axis of a chart.
|
protected class |
AAxisTransformation.YDataAccessor
Accesses the y axis of the
Chart2D . |
AAxis.AChart2DDataAccessor
IAxis.AxisTitle
Modifier and Type | Field and Description |
---|---|
protected long |
m_outputErrorTstamp
Internal timestamp of the last transformation error reporting.
|
DEBUG, m_accessor, m_formatter, m_majorTickSpacing, m_max, m_min, m_minorTickSpacing, m_needsFullRescale, m_rangePolicy
PROPERTY_ADD_REMOVE_TRACE, PROPERTY_AXIS_SCALE_POLICY_CHANGED, PROPERTY_LABELFORMATTER, PROPERTY_PAINTGRID, PROPERTY_PAINTSCALE, PROPERTY_RANGEPOLICY
Constructor and Description |
---|
AAxisTransformation()
Creates a default instance that will use a
LabelFormatterAutoUnits
for formatting labels. |
AAxisTransformation(IAxisLabelFormatter formatter,
T scalePolicy)
Creates an instance that will the given label formatter for formatting
labels.
|
Modifier and Type | Method and Description |
---|---|
protected AAxis.AChart2DDataAccessor |
createAccessor(Chart2D chart,
int dimension,
int position)
Template method to create the proper
implementation. |
double |
getMaxTransformed()
Returns the transformed max with additional error treatment in case of
empty traces.
|
double |
getMinTransformed()
Returns the transformed min with additional error treatment in case of
empty traces.
|
double |
getScaledValue(double absolute)
Scales the given absolute value into a value between 0 and 1.0 (if it is in
the range of the data).
|
void |
scaleTrace(ITrace2D trace)
Overridden to incorporate transformation.
|
abstract double |
transform(double in)
Template method for performing the axis transformation.
|
double |
translateMousePosition(MouseEvent mouseEvent)
Returns the translation of the mouse event coordinates of the given mouse
event to the value within the chart for the dimension (x,y) covered by this
axis.
|
double |
translatePxToValue(int pixel)
Transforms the given pixel value (which has to be a awt value like
MouseEvent.getY() into the chart value. |
abstract double |
untransform(double in)
Template method for performing the reverse axis transformation.
|
addPropertyChangeListener, addTrace, ensureInitialized, equals, findMax, findMin, getAccessor, getAxisPosition, getAxisScalePolicy, getAxisTitle, getDimension, getDimensionString, getFormatter, getHeight, getMajorTickSpacing, getMax, getMaxValue, getMin, getMinorTickSpacing, getMinValue, getPixelXLeft, getPixelXRight, getPixelYBottom, getPixelYTop, getPropertyChangeListeners, getRange, getRangePolicy, getTitle, getTitlePainter, getTraces, getValueDistanceForPixel, getWidth, hashCode, hasTrace, initPaintIteration, isDirtyScaling, isPaintGrid, isPaintScale, isStartMajorTick, isVisible, paint, paintTitle, propertyChange, removeAllTraces, removeAxisTitle, removePropertyChangeListener, removeTrace, scale, scalePoint, setAccessor, setAxisPosition, setAxisScalePolicy, setAxisTitle, setChart, setFormatter, setMajorTickSpacing, setMinorTickSpacing, setPaintGrid, setPaintScale, setPixelXLeft, setPixelXRight, setPixelYBottom, setPixelYTop, setRange, setRangePolicy, setStartMajorTick, setTitle, setTitlePainter, setVisible, translateValueToPx
protected long m_outputErrorTstamp
public AAxisTransformation()
LabelFormatterAutoUnits
for formatting labels.
public AAxisTransformation(IAxisLabelFormatter formatter, T scalePolicy)
formatter
- needed for formatting labels of this axis.scalePolicy
- controls the ticks/labels and their distance.protected AAxis.AChart2DDataAccessor createAccessor(Chart2D chart, int dimension, int position)
AAxis
AAxis.AChart2DDataAccessor
implementation.
createAccessor
in class AAxis<T extends AxisScalePolicyTransformation>
chart
- the chart to access.dimension
- Chart2D.X
or Chart2D.Y
.position
- Chart2D.CHART_POSITION_BOTTOM
,
Chart2D.CHART_POSITION_LEFT
,
Chart2D.CHART_POSITION_RIGHT
or
Chart2D.CHART_POSITION_TOP
.AAxis.AChart2DDataAccessor
implementation.AAxis.createAccessor(info.monitorenter.gui.chart.Chart2D,
int, int)
public double getMaxTransformed()
AAxis.getMax()
public double getMinTransformed()
AAxis.getMin()
public final double getScaledValue(double absolute)
IAxis
If the given absolute value is not in the display- range of the
Chart2D
, negative values or values greater than 1.0 may
result.
absolute
- a value in the real value range of the corresponding chart.IAxis.getScaledValue(double)
public void scaleTrace(ITrace2D trace)
scaleTrace
in interface IAxis<T extends AxisScalePolicyTransformation>
scaleTrace
in class AAxis<T extends AxisScalePolicyTransformation>
trace
- the trace to scale.IAxis.scaleTrace(info.monitorenter.gui.chart.ITrace2D)
public abstract double transform(double in) throws IllegalArgumentException
The argument should not be negative, so only normalized values (no chart values but their scaled values or pixel values) should be given here.
in
- the value to transform.IllegalArgumentException
- if scaling is impossible (due to some mathematical transformation
in implementations like
AxisLog10
public final double translateMousePosition(MouseEvent mouseEvent) throws IllegalArgumentException
AAxis
Note that the mouse event has to be an event fired on the correspondinig chart component!
translateMousePosition
in class AAxis<T extends AxisScalePolicyTransformation>
mouseEvent
- a mouse event that has been fired on this component.IllegalArgumentException
- if the given mouse event is out of the current graphics context
(not a mouse event of the chart component).AAxis.translateMousePosition(java.awt.event.MouseEvent)
public double translatePxToValue(int pixel)
IAxis
MouseEvent.getY()
into the chart value.
Internal use only, the interface does not guarantee that the pixel corresponds to any valid awt pixel value within the chart component.
translatePxToValue
in interface IAxis<T extends AxisScalePolicyTransformation>
translatePxToValue
in class AAxis<T extends AxisScalePolicyTransformation>
pixel
- a pixel value of the chart component as used by awt.AAxis.translatePxToValue(int)
public abstract double untransform(double in)
This is the counterpart to transform(double)
.
in
- the transformed value.Copyright © 2001 - 2010 LGPL, All Rights Footloose.