Class AAxisTransformation<T extends AxisScalePolicyTransformation>

    • Field Detail

      • m_outputErrorTstamp

        protected long m_outputErrorTstamp
        Internal timestamp of the last transformation error reporting.
    • Constructor Detail

      • AAxisTransformation

        public AAxisTransformation()
        Creates a default instance that will use a LabelFormatterAutoUnits for formatting labels.

      • AAxisTransformation

        public AAxisTransformation​(IAxisLabelFormatter formatter,
                                   T scalePolicy)
        Creates an instance that will the given label formatter for formatting labels.

        Parameters:
        formatter - needed for formatting labels of this axis.
        scalePolicy - controls the ticks/labels and their distance.
    • Method Detail

      • getMaxTransformed

        public double getMaxTransformed()
        Returns the transformed max with additional error treatment in case of empty traces.

        Returns:
        the transformed max with additional error treatment in case of empty traces.
        See Also:
        AAxis.getMax()
      • getMinTransformed

        public double getMinTransformed()
        Returns the transformed min with additional error treatment in case of empty traces.

        Returns:
        the transformed min with additional error treatment in case of empty traces.
        See Also:
        AAxis.getMin()
      • getScaledValue

        public final double getScaledValue​(double absolute)
        Description copied from interface: IAxis
        Scales the given absolute value into a value between 0 and 1.0 (if it is in the range of the data).

        If the given absolute value is not in the display- range of the Chart2D, negative values or values greater than 1.0 may result.

        Parameters:
        absolute - a value in the real value range of the corresponding chart.
        Returns:
        a value between 0.0 and 1.0 that is mapped to a position within the chart.
        See Also:
        IAxis.getScaledValue(double)
      • transform

        public abstract double transform​(double in)
                                  throws java.lang.IllegalArgumentException
        Template method for performing the axis transformation.

        The argument should not be negative, so only normalized values (no chart values but their scaled values or pixel values) should be given here.

        Parameters:
        in - the value to transform.
        Returns:
        the transformed value.
        Throws:
        java.lang.IllegalArgumentException - if scaling is impossible (due to some mathematical transformation in implementations like AxisLog10
      • translateMousePosition

        public final double translateMousePosition​(java.awt.event.MouseEvent mouseEvent)
                                            throws java.lang.IllegalArgumentException
        Description copied from class: AAxis
        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.

        Note that the mouse event has to be an event fired on the correspondinig chart component!

        Overrides:
        translateMousePosition in class AAxis<T extends AxisScalePolicyTransformation>
        Parameters:
        mouseEvent - a mouse event that has been fired on this component.
        Returns:
        the translation of the mouse event coordinates of the given mouse event to the value within the chart for the dimension covered by this axis (x or y) or null if no calculations could be performed as the chart was not painted before.
        Throws:
        java.lang.IllegalArgumentException - if the given mouse event is out of the current graphics context (not a mouse event of the chart component).
        See Also:
        AAxis.translateMousePosition(java.awt.event.MouseEvent)
      • translatePxToValue

        public double translatePxToValue​(int pixel)
        Description copied from interface: IAxis
        Transforms the given pixel value (which has to be a awt value like 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.

        Specified by:
        translatePxToValue in interface IAxis<T extends AxisScalePolicyTransformation>
        Overrides:
        translatePxToValue in class AAxis<T extends AxisScalePolicyTransformation>
        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:
        AAxis.translatePxToValue(int)
      • untransform

        public abstract double untransform​(double in)
        Template method for performing the reverse axis transformation.

        This is the counterpart to transform(double).

        Parameters:
        in - the transformed value.
        Returns:
        the normal value;