Package info.monitorenter.gui.chart.axis
Class AAxisTransformation.XDataAccessor
- All Implemented Interfaces:
Serializable
- Enclosing class:
- AAxisTransformation<T extends AxisScalePolicyTransformation>
An accessor for the x axis of a chart.
- Author:
- <a href="mailto:Achim.Westermann@gmx.de>Achim Westermann
- See Also:
-
Field Summary
Fields inherited from class info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor
m_chart -
Constructor Summary
ConstructorsConstructorDescriptionXDataAccessor(Chart2D chart) Creates an instance that accesses the given chart's x axis. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidscaleTrace(ITrace2D trace, Range range) Scales the given trace in the dimension represented by this axis.doubletranslatePxToValue(int pixel) Transforms the given pixel value (which has to be a awt value likeMouseEvent.getX()into the chart value.final inttranslateValueToPx(double value) Transforms the given chart data value into the corresponding awt pixel value for the chart.Methods inherited from class info.monitorenter.gui.chart.axis.AAxis.XDataAccessor
getDimension, getHeight, getMaximumPixelForLabel, getMaxValue, getMinimumValueDistanceForLabels, getMinValue, getPixelRange, getValue, getValueDistanceForPixel, getWidth, toString, translateMousePositionMethods inherited from class info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor
getChart
-
Constructor Details
-
XDataAccessor
Creates an instance that accesses the given chart's x axis.- Parameters:
chart- the chart to access.
-
-
Method Details
-
scaleTrace
Description copied from class:AAxis.AChart2DDataAccessorScales the given trace in the dimension represented by this axis.This method is not deadlock - safe and should be called by the
only!Chart2D- Overrides:
scaleTracein classAAxis<T extends AxisScalePolicyTransformation>.XDataAccessor- Parameters:
trace- the trace to scale.range- the range to use as scaler.- See Also:
-
translatePxToValue
public double translatePxToValue(int pixel) Description copied from class:AAxis.AChart2DDataAccessorTransforms the given pixel value (which has to be a awt value likeMouseEvent.getX()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.
Warning: A value transformed to a pixel by
AAxis.AChart2DDataAccessor.translateValueToPx(double)and then retransformed byAAxis.AChart2DDataAccessor.translatePxToValue(int)will most often have changed, as the transformation from value to px a) has to hit an exact int b) most often will map from a bigger domain (value range) to a smaller one (range of chart on the screen).- Overrides:
translatePxToValuein classAAxis<T extends AxisScalePolicyTransformation>.XDataAccessor- Parameters:
pixel- a pixel value of the chart component as used by awt.- Returns:
- the awt pixel value transformed to the chart value.
- See Also:
-
translateValueToPx
public final int translateValueToPx(double value) Description copied from class:AAxis.AChart2DDataAccessorTransforms the given chart data value into the corresponding awt pixel value for the chart.The inverse transformation to
AAxis.AChart2DDataAccessor.translatePxToValue(int).- Overrides:
translateValueToPxin classAAxis<T extends AxisScalePolicyTransformation>.XDataAccessor- Parameters:
value- a chart data value.- Returns:
- the awt pixel value corresponding to the chart data value.
- See Also:
-