Class AAxis<T extends IAxisScalePolicy>

java.lang.Object
info.monitorenter.gui.chart.axis.AAxis<T>
Type Parameters:
T - Subtypes may be more picky which scale policies the accept to disallow incorrect scales: This supports it (see IAxis.setAxisScalePolicy(IAxisScalePolicy)).
All Implemented Interfaces:
IAxis<T>, PropertyChangeListener, Serializable, EventListener
Direct Known Subclasses:
AAxisTransformation, AxisInverse, AxisLinear

public abstract class AAxis<T extends IAxisScalePolicy> extends Object implements IAxis<T>, PropertyChangeListener
The base class for an axis of the Chart2D.

Normally - as the design and interaction of an Axis with the Chart2DD is very fine-grained - it is not instantiated by users of jchart2d: It is automatically instantiated by the constructor of Chart2D. It then may be retrieved from the Chart2D by the methods Chart2D.getAxisX() and Chart2D.getAxisY() for further configuration.

Version:
$Revision: 1.61 $
Author:
Achim Westermann
See Also:
  • Field Details

    • DEBUG

      public static final boolean DEBUG
      Debugging flag for sysouts.
      See Also:
    • m_accessor

      protected AAxis<T extends IAxisScalePolicy>.AChart2DDataAccessor m_accessor
      The accessor to the Chart2D.

      It determines, which axis (x or y) this instance is representing.

    • m_formatter

      protected IAxisLabelFormatter m_formatter
      Formatting of the labels.
    • m_majorTickSpacing

      protected double m_majorTickSpacing
      The major tick spacing for label generations.

      See Also:
    • m_max

      protected double m_max
      The current maximum value for all points in all traces.
    • m_min

      protected double m_min
      The current minimum value for all points in all traces.
    • m_minorTickSpacing

      protected double m_minorTickSpacing
      The minor tick spacing for label generations.

      See Also:
    • m_needsFullRescale

      protected boolean m_needsFullRescale
      Flag to detect if a re-scaling has to be done.

      It is set to false in scale() which is triggered from the painting Thread. Whenever a bound change is detected in propertyChange(PropertyChangeEvent) this is set to true.

      Please remind: In previous versions there was only a test if the bounds had changed since the last scaling. This was not always correct: If in between two paint cycles the bounds were changed and new points added but at the point in time when the 2nd paint cycle starts the bounds would be equal no full rescaling would be performed even if the added points would have been scaled in relation to the changed bounds at their adding time: Bounds checks are not sufficient!

    • m_rangePolicy

      protected IRangePolicy m_rangePolicy
      A plugable range policy.
  • Constructor Details

    • AAxis

      public AAxis()
      Default constructor that uses a LabelFormatterAutoUnits for formatting labels.

    • AAxis

      public AAxis(IAxisLabelFormatter formatter, T scalePolicy)
      Constructor that uses 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 Details