Documentation of 'org.jplot2d.element.AxisTickManager' Java class
AxisTickManager
org.jplot2d.element

Interface AxisTickManager

  • All Superinterfaces:
    Element
    All Known Subinterfaces:
    AxisTickManagerEx
    All Known Implementing Classes:
    AxisTickManagerImpl


    public interface AxisTickManager
    extends Element
    Manage ticks of axes. Axes may have the same tick manager. Their ticks are exactly same.

    The tick decision rules

    1. if autoValues is false, the values can be set by #setFixedTickValues(double[])
    2. if autoInterval is false, the interval can be set by setTickInterval(double)
    3. the interval is calculated according to tick number. If autoAdjustNumber is true, the number can be adjusted to derive better values.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      int getActualMinorTicks()
      Return the number of minor ticks displayed between two major ticks.
      Axis[] getAxes()
      Returns all axes whose ticks are controlled by this tick manager.
      AxisTransform getAxisTransform() 
      java.lang.String[] getFixedLabelStrings()
      Returns the user assigned substitute labels.
      java.lang.Object getFixedMinorTickValues()
      Return an array of double representing the fixed minor tick positions set by setFixedMinorTickValues(Object)
      java.lang.Object getFixedTickValues()
      Return an array of number to representing the fixed tick positions set by setFixedTickValues(Object)
      java.lang.String getLabelFormat()
      Returns the printf-style format of the labels of ticks.
      int getLabelInterval()
      Get the label interval.
      java.lang.String[] getLabelStrings()
      Return an array of string representing the labels shown in the axis.
      java.text.Format getLabelTextFormat()
      Returns the format of the labels of ticks.
      int getMinorTicks()
      Return the number of minor ticks displayed between two major ticks.
      java.lang.Object getMinorTickValues()
      Return an array of number representing the minor tick positions shown in the axis.
      Range getRange()
      Returns the tick range of this axis.
      double getTickInterval()
      Return the interval in axis units between two ticks.
      double getTickOffset()
      Return the offset of ticks.
      int getTicks()
      Returns the proposed number of ticks.
      AxisTickTransform getTickTransform()
      Returns the AxisTickTransform, which defines The relationship between user value and tick value.
      java.lang.Object getTickValues()
      Return an array of number representing the tick positions shown in the axis.
      boolean isAutoAdjustTicks()
      Returns true if the tick number is allowed to be automatically reduced to avoid tick label overlaps.
      boolean isAutoLabelFormat()
      Returns true if labels format is auto calculated or assigned by setLabelFormat(String)
      boolean isAutoMinorTicks()
      Returns true is the minor ticks number is derived from tick interval.
      boolean isAutoTickInterval()
      Returns true if the tick interval is auto calculated from tick number and range, or false if the tick interval is assigned by setTickInterval(double)
      boolean isAutoTickValues()
      Returns true if tick values is auto calculated from interval, or false if tick values is assigned by #setFixedTickValues(double[]).
      void setAutoAdjustTicks(boolean flag)
      Set to true to allow the tick number to be automatically reduced to avoid tick label overlaps.
      void setAutoLabelFormat(boolean alf)
      Sets true to auto calculate proper labels format.
      void setAutoMinorTicks(boolean flag)
      When autoTickInterval is set to true: if tick interval is 1, the minor interval is 0.2, create 4 minor ticks if tick interval is 2, the minor interval is 0.5, create 3 minor ticks if tick interval is 3, the minor interval is 1, create 2 minor ticks if tick interval is 4, the minor interval is 1, create 3 minor ticks if tick interval is 5, the minor interval is 1, create 4 minor ticks if tick interval is 6, the minor interval is 2, create 2 minor ticks if tick interval is 7, the minor interval is 1, create 6 minor ticks if tick interval is 8, the minor interval is 2, create 3 minor ticks if tick interval is 9, the minor interval is 3, create 2 minor ticks if tick interval is not integer, create 0 minor ticks when autoTickInterval is set to false: minor ticks is exactly the user set by #setMinorTicks(Integer).
      void setAutoTickInterval(boolean ati)
      Set to true to indicate the tick interval need to be auto calculated, or false to disable auto-calculation and keep using the current interval.
      void setAutoTickValues(boolean atv)
      Set to true to indicate the tick values need to be auto calculated or false to use user assigned values.
      void setAxisTransform(AxisTransform rangeManager) 
      void setFixedLabelStrings(java.lang.String[] labels)
      Set an array of String to substitute the labels of the fixed ticks.
      void setFixedMinorTickValues(java.lang.Object minorValues)
      Set an array of double.
      void setFixedTickValues(java.lang.Object values)
      Set an array of values that ticks will show.
      void setLabelFormat(java.lang.String format)
      Sets the printf-style format that is used to format the tick labels from tick values.
      void setLabelInterval(int n)
      Set the tick labels displayed after n ticks
      void setLabelTextFormat(java.text.Format format)
      Sets the format object that is used to format the tick labels from tick values.
      void setMinorTicks(int minors)
      Set the number of minor ticks displayed between two major ticks.
      void setRange(Range range)
      Set the tick range of the axis.
      void setTickInterval(double interval)
      Set the interval in axis units between two ticks.
      void setTickOffset(double offset) 
      void setTicks(int tickNumber)
      Set the proposed number of ticks in the axis.
      void setTickTransform(AxisTickTransform transform)
      Sets the AxisTickTransform, which defines The relationship between user value and tick value.
    • Method Detail

      • setAxisTransform

        void setAxisTransform(AxisTransform rangeManager)
      • getAxes

        Axis[] getAxes()
        Returns all axes whose ticks are controlled by this tick manager.
        Returns:
        all axes whose ticks are controlled by this tick manager
      • getTickTransform

        AxisTickTransform getTickTransform()
        Returns the AxisTickTransform, which defines The relationship between user value and tick value.
        Returns:
        the AxisTickTransform.
      • setTickTransform

        void setTickTransform(AxisTickTransform transform)
        Sets the AxisTickTransform, which defines The relationship between user value and tick value. The AuxTransform must be efficient immutable.
        Parameters:
        transform - the AxisTickTransform object.
      • getRange

        Range getRange()
        Returns the tick range of this axis.
        Returns:
        the tick range of this axis.
      • setRange

        void setRange(Range range)
        Set the tick range of the axis.
        Parameters:
        range - the new tick range of the axis
      • isAutoTickValues

        boolean isAutoTickValues()
        Returns true if tick values is auto calculated from interval, or false if tick values is assigned by #setFixedTickValues(double[]).
        Returns:
        true if tick values is auto calculated.
      • setAutoTickValues

        void setAutoTickValues(boolean atv)
        Set to true to indicate the tick values need to be auto calculated or false to use user assigned values.
        Parameters:
        atv - the flag
      • getFixedTickValues

        java.lang.Object getFixedTickValues()
        Return an array of number to representing the fixed tick positions set by setFixedTickValues(Object)
        Returns:
        the labels of the ticks
      • setFixedTickValues

        void setFixedTickValues(java.lang.Object values)
        Set an array of values that ticks will show. If the given values is null or a empty array, no tick will be drawn.

        The autoValues will be set to false when this method is called. The minor values will be cleared by this method.

        Parameters:
        values - the values in user unit where ticks are displayed.
      • getFixedMinorTickValues

        java.lang.Object getFixedMinorTickValues()
        Return an array of double representing the fixed minor tick positions set by setFixedMinorTickValues(Object)
        Returns:
        the labels of the ticks
      • setFixedMinorTickValues

        void setFixedMinorTickValues(java.lang.Object minorValues)
        Set an array of double. If the given values is null or a empty array, no tick will be drawn.

        This method must be called after #setFixedTickValues(double[]) is called. #setFixedTickValues(double[]) calling will clear the minor values.

        Parameters:
        values - the values in user unit where minor ticks are displayed.
      • isAutoTickInterval

        boolean isAutoTickInterval()
        Returns true if the tick interval is auto calculated from tick number and range, or false if the tick interval is assigned by setTickInterval(double)
        Returns:
        if the tick number is auto calculated.
      • setAutoTickInterval

        void setAutoTickInterval(boolean ati)
        Set to true to indicate the tick interval need to be auto calculated, or false to disable auto-calculation and keep using the current interval.
        Parameters:
        ati - the flag
      • getTickInterval

        double getTickInterval()
        Return the interval in axis units between two ticks. For LOG axis, interval is the multiplying factor between two ticks.
        Returns:
        the interval between two ticks
      • setTickInterval

        void setTickInterval(double interval)
        Set the interval in axis units between two ticks. It change the number of ticks displayed in the axis. For LOG axis, interval is the multiplying factor between two ticks.

        Setting a new interval will set autoInterval to false.

        Parameters:
        interval - the interval between two major ticks
        See Also:
        #setAutoTickInterval(Boolean)
      • getTickOffset

        double getTickOffset()
        Return the offset of ticks.
        Returns:
        the offset.
      • setTickOffset

        void setTickOffset(double offset)
        Parameters:
        offset - the offset of ticks
      • getTicks

        int getTicks()
        Returns the proposed number of ticks. The actual number may be different from the given number, to get nice tick values.
        Returns:
        the number of ticks
      • setTicks

        void setTicks(int tickNumber)
        Set the proposed number of ticks in the axis. The actual number may be different from the given number, to get nice tick values. If the ticks may cause the tick interval close to precision limit, the actual ticks may be less than the given value without throw PrecisionException.
        Parameters:
        tickNumber - the number of ticks.
      • isAutoAdjustTicks

        boolean isAutoAdjustTicks()
        Returns true if the tick number is allowed to be automatically reduced to avoid tick label overlaps.
        Returns:
        if the tick number is auto calculated.
      • setAutoAdjustTicks

        void setAutoAdjustTicks(boolean flag)
        Set to true to allow the tick number to be automatically reduced to avoid tick label overlaps.
        Parameters:
        flag -
      • isAutoMinorTicks

        boolean isAutoMinorTicks()
        Returns true is the minor ticks number is derived from tick interval.
        Returns:
        true is the minor ticks number is derived from tick interval.
      • setAutoMinorTicks

        void setAutoMinorTicks(boolean flag)
        When autoTickInterval is set to true:
        • if tick interval is 1, the minor interval is 0.2, create 4 minor ticks
        • if tick interval is 2, the minor interval is 0.5, create 3 minor ticks
        • if tick interval is 3, the minor interval is 1, create 2 minor ticks
        • if tick interval is 4, the minor interval is 1, create 3 minor ticks
        • if tick interval is 5, the minor interval is 1, create 4 minor ticks
        • if tick interval is 6, the minor interval is 2, create 2 minor ticks
        • if tick interval is 7, the minor interval is 1, create 6 minor ticks
        • if tick interval is 8, the minor interval is 2, create 3 minor ticks
        • if tick interval is 9, the minor interval is 3, create 2 minor ticks
        • if tick interval is not integer, create 0 minor ticks
        when autoTickInterval is set to false: minor ticks is exactly the user set by #setMinorTicks(Integer). The Default number is zero, means not shown by default.
        Parameters:
        flag -
      • getMinorTicks

        int getMinorTicks()
        Return the number of minor ticks displayed between two major ticks. This method always returns the number set by #setMinorTicks(Integer), no matter if the actual number has been adjusted.
        Returns:
        the number of minor ticks displayed
      • setMinorTicks

        void setMinorTicks(int minors)
        Set the number of minor ticks displayed between two major ticks. The actual number may be adjusted, and not equal the number set by this method.

        Setting a new minor number will set autoMinornumber to false.

        Parameters:
        minors - the number of minor ticks displayed
      • getActualMinorTicks

        int getActualMinorTicks()
        Return the number of minor ticks displayed between two major ticks. This method returns the actual number, might be different form the number set by #setMinorTicks(Integer).
        Returns:
        the number of minor ticks displayed
      • getTickValues

        java.lang.Object getTickValues()
        Return an array of number representing the tick positions shown in the axis.
        Returns:
        the values of the ticks
      • getMinorTickValues

        java.lang.Object getMinorTickValues()
        Return an array of number representing the minor tick positions shown in the axis.
        Returns:
        the values of the ticks
      • getLabelInterval

        int getLabelInterval()
        Get the label interval. The tick labels are displayed after that number of ticks
        Returns:
        label interval
      • setLabelInterval

        void setLabelInterval(int n)
        Set the tick labels displayed after n ticks
        Parameters:
        n - label displayed each n ticks .
      • isAutoLabelFormat

        boolean isAutoLabelFormat()
        Returns true if labels format is auto calculated or assigned by setLabelFormat(String)
        Returns:
        true if labels format is auto calculated
      • setAutoLabelFormat

        void setAutoLabelFormat(boolean alf)
        Sets true to auto calculate proper labels format. Or sets false to assign a label format by setLabelFormat(String)
        Parameters:
        alf - the flag
      • getLabelTextFormat

        java.text.Format getLabelTextFormat()
        Returns the format of the labels of ticks.
        Returns:
        the format of the labels.
      • setLabelTextFormat

        void setLabelTextFormat(java.text.Format format)
        Sets the format object that is used to format the tick labels from tick values. If this text format is null, the printf-style format will be used to format the labels.

        Setting a new labelTextFormat will set autoLabelFormat to false

        Parameters:
        format - the format object
      • getLabelFormat

        java.lang.String getLabelFormat()
        Returns the printf-style format of the labels of ticks.
        Returns:
        the format of the labels.
      • setLabelFormat

        void setLabelFormat(java.lang.String format)
        Sets the printf-style format that is used to format the tick labels from tick values. The syntax of format string is described in Formatter. Beside the standard Java formatter conversions, a special conversion 'm' can be used to produce labels in n_10^e format. The usage of conversion 'm' is like the standard conversion 'e'.

        Setting a new labelFormat will set autoLabelFormat to false

        Parameters:
        format - the format string, or null to used the auto format.
      • getFixedLabelStrings

        java.lang.String[] getFixedLabelStrings()
        Returns the user assigned substitute labels. null has a special meaning of "undecided".
        Returns:
        the user assigned substitute labels.
      • setFixedLabelStrings

        void setFixedLabelStrings(java.lang.String[] labels)
        Set an array of String to substitute the labels of the fixed ticks. If the length of the array is shorter then the number of fixed ticks, only the first ticks are changed, if the length of the array is longer then the number of ticks only the first labels are used. null in the array means not substitute the label. The given labels can be null or a empty array.

        If the tick is autoValues mode (a.k.a. no fixedValues assigned), the given fixedLabels will substitute the auto labels of visible ticks.

        Parameters:
        labels - the new labels to be displayed in the ticks
        See Also:
        setFixedTickValues(Object)
      • getLabelStrings

        java.lang.String[] getLabelStrings()
        Return an array of string representing the labels shown in the axis.
        Returns:
        the labels of the ticks

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.