Documentation of 'info.monitorenter.gui.chart.axis.scalepolicy.AxisScalePolicyAutomaticBestFit' Java class
AxisScalePolicyAutomaticBestFit
info.monitorenter.gui.chart.axis.scalepolicy

Class AxisScalePolicyAutomaticBestFit

  • All Implemented Interfaces:
    IAxisScalePolicy


    public class AxisScalePolicyAutomaticBestFit
    extends java.lang.Object
    implements IAxisScalePolicy
    Very basic and fast scale policy implementation that ensures the following:
    • Every scale tick is a minor or major tick of the corresponding axis.
    • If a scale tick was found that matches a major and a minor tick it is judged as major tick.
    • Every major tick is a multiple of minor ticks: It is not possible for the sum minor ticks to "skip" a major tick.
    • There is no guarantee that the labels of ticks will overwrite each others.
    • There is no guarantee that the major and minor ticks of the axis are chosen in a reasonable manner: You could get no labels at all if the values are too high or thousands of labels with a weird output.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.List<LabeledValue> getScaleValues(java.awt.Graphics g2d, IAxis<?> axis)
      Returns the array of labeled values that will be used by the Chart2D to paint labels.
      void initPaintIteration(IAxis<?> axis)
      Performs expensive calculations for various values that are used by many calls throughout a paint iterations.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AxisScalePolicyAutomaticBestFit

        public AxisScalePolicyAutomaticBestFit()
    • Method Detail

      • getScaleValues

        public java.util.List<LabeledValue> getScaleValues(java.awt.Graphics g2d,
                                                           IAxis<?> axis)
        Description copied from interface: IAxisScalePolicy
        Returns the array of labeled values that will be used by the Chart2D to paint labels.

        Specified by:
        getScaleValues in interface IAxisScalePolicy
        Parameters:
        g2d - Provides information about the graphic context (e.g. font metrics).
        axis - the axis to work for.
        Returns:
        the labeled values that will be used by the Chart2D to paint labels.
      • initPaintIteration

        public void initPaintIteration(IAxis<?> axis)
        Description copied from interface: IAxisScalePolicy
        Performs expensive calculations for various values that are used by many calls throughout a paint iterations.

        These values are constant throughout a paint iteration by the contract that no point is added removed or changed in this period. Because these values are used from many methods it is impossible to calculate them at a "transparent" method that may perform this caching over a paint period without knowledge from outside. The first method called in a paint iteration is called several further times in the iteration. So this is the common hook to invoke before painting a chart.

        Specified by:
        initPaintIteration in interface IAxisScalePolicy
        Parameters:
        axis - the axis to read data from.
        See Also:
        IAxisScalePolicy.initPaintIteration(info.monitorenter.gui.chart.IAxis)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.