Class FixedAxisLabelHandler

  • All Implemented Interfaces:
    AxisLabelHandler

    public class FixedAxisLabelHandler
    extends Object
    implements AxisLabelHandler
    Draws pre-defined labels at pre-defined locations.
    Author:
    borkholder
    • Constructor Detail

      • FixedAxisLabelHandler

        public FixedAxisLabelHandler()
    • Method Detail

      • getTickPositions

        public double[] getTickPositions​(Axis1D axis)
        Specified by:
        getTickPositions in interface AxisLabelHandler
        Returns:
        an array containing positions of tick marks in axis coordinates (transformed by any AxisUnitConverter).
      • getTickLabels

        public String[] getTickLabels​(Axis1D axis,
                                      double[] tickPositions)
        Specified by:
        getTickLabels in interface AxisLabelHandler
        tickPositions - the output from getTickPositions( ).
        Returns:
        an array of string labels for the tick marks provided by getTickPositions( ).
      • getMinorTickPositions

        public double[] getMinorTickPositions​(double[] tickPositions)
        Description copied from interface: AxisLabelHandler
        Provides the positions of minor tick marks. How these are rendered differently from regular tick marks can vary, but they will usually be smaller and will not have labels. The positions of the major ticks are provided as input, since the minor tick positions are usually based on these. However, implementations of AxisLabelHandler are free to ignore this argument.
        Specified by:
        getMinorTickPositions in interface AxisLabelHandler
        Returns:
        an array containing positions of minor tick marks in axis coordinates (transformed by any AxisUnitConverter).
      • getAxisLabel

        public String getAxisLabel​(Axis1D axis)
        Specified by:
        getAxisLabel in interface AxisLabelHandler
        Returns:
        a text label describing the axis (the type of data displayed, the units, etc...)
      • setAxisLabel

        public void setAxisLabel​(String label)
        Specified by:
        setAxisLabel in interface AxisLabelHandler
        Parameters:
        label - provides a hint regarding what label information to display
      • clearLabels

        public void clearLabels()
      • setLabels

        public void setLabels​(it.unimi.dsi.fastutil.doubles.Double2ObjectSortedMap<String> labels)
      • setLabels

        public void setLabels​(double[] values,
                              String[] labels)