Documentation of 'org.jplot2d.element.impl.AxisTickManagerImpl' Java class
AxisTickManagerImpl
org.jplot2d.element.impl

Class AxisTickManagerImpl

    • Constructor Detail

      • AxisTickManagerImpl

        public AxisTickManagerImpl()
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: Element
        Returns the id string of this element
        Specified by:
        getId in interface Element
        Returns:
        the id string
      • getFullId

        public java.lang.String getFullId()
        Description copied from interface: ElementEx
        Returns the full id of this component. The full id is composed of series of ids concatenated with dots. The 1st id is the id of this element, the 2nd id is the id of the parent of this element, etc, until the root plot.
        Specified by:
        getFullId in interface ElementEx
        Overrides:
        getFullId in class ElementImpl
        Returns:
        the full id of this component
      • getInvokeStepFormParent

        public InvokeStep getInvokeStepFormParent()
        Description copied from interface: ElementEx
        Return the invoke step to get this object from its parent.
        Specified by:
        getInvokeStepFormParent in interface ElementEx
        Returns:
        the invoke step
      • getPrim

        public ElementEx getPrim()
        Description copied from interface: Joinable
        Returns the primary referencer.
        Specified by:
        getPrim in interface Joinable
        Returns:
        the primary referencer
      • notify

        public void notify(Notice msg)
        Description copied from interface: ElementEx
        Element call this method to notify message to its parent.
        Specified by:
        notify in interface ElementEx
        Overrides:
        notify in class ElementImpl
        Parameters:
        msg - the notice message
      • setTickTransform

        public void setTickTransform(AxisTickTransform transform)
        Description copied from interface: AxisTickManager
        Sets the AxisTickTransform, which defines The relationship between user value and tick value. The AuxTransform must be efficient immutable.
        Specified by:
        setTickTransform in interface AxisTickManager
        Parameters:
        transform - the AxisTickTransform object.
      • getRange

        public Range getRange()
        Description copied from interface: AxisTickManager
        Returns the tick range of this axis.
        Specified by:
        getRange in interface AxisTickManager
        Returns:
        the tick range of this axis.
      • setRange

        public void setRange(Range range)
        Description copied from interface: AxisTickManager
        Set the tick range of the axis.
        Specified by:
        setRange in interface AxisTickManager
        Parameters:
        range - the new tick range of the axis
      • isAutoAdjustTicks

        public boolean isAutoAdjustTicks()
        Description copied from interface: AxisTickManager
        Returns true if the tick number is allowed to be automatically reduced to avoid tick label overlaps.
        Specified by:
        isAutoAdjustTicks in interface AxisTickManager
        Returns:
        if the tick number is auto calculated.
      • setAutoAdjustTicks

        public void setAutoAdjustTicks(boolean flag)
        Description copied from interface: AxisTickManager
        Set to true to allow the tick number to be automatically reduced to avoid tick label overlaps.
        Specified by:
        setAutoAdjustTicks in interface AxisTickManager
      • getTicks

        public int getTicks()
        Description copied from interface: AxisTickManager
        Returns the proposed number of ticks. The actual number may be different from the given number, to get nice tick values.
        Specified by:
        getTicks in interface AxisTickManager
        Returns:
        the number of ticks
      • setTicks

        public void setTicks(int tickNumber)
        Description copied from interface: AxisTickManager
        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.
        Specified by:
        setTicks in interface AxisTickManager
        Parameters:
        tickNumber - the number of ticks.
      • setAutoTickInterval

        public void setAutoTickInterval(boolean autoInterval)
        Description copied from interface: AxisTickManager
        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.
        Specified by:
        setAutoTickInterval in interface AxisTickManager
        Parameters:
        autoInterval - the flag
      • getTickInterval

        public double getTickInterval()
        Description copied from interface: AxisTickManager
        Return the interval in axis units between two ticks. For LOG axis, interval is the multiplying factor between two ticks.
        Specified by:
        getTickInterval in interface AxisTickManager
        Returns:
        the interval between two ticks
      • setTickInterval

        public void setTickInterval(double interval)
        Description copied from interface: AxisTickManager
        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.

        Specified by:
        setTickInterval in interface AxisTickManager
        Parameters:
        interval - the interval between two major ticks
        See Also:
        #setAutoTickInterval(Boolean)
      • setTickOffset

        public void setTickOffset(double offset)
        Specified by:
        setTickOffset in interface AxisTickManager
        Parameters:
        offset - the offset of ticks
      • isAutoTickValues

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

        public void setAutoTickValues(boolean atv)
        Description copied from interface: AxisTickManager
        Set to true to indicate the tick values need to be auto calculated or false to use user assigned values.
        Specified by:
        setAutoTickValues in interface AxisTickManager
        Parameters:
        atv - the flag
      • setFixedTickValues

        public void setFixedTickValues(java.lang.Object values)
        Description copied from interface: AxisTickManager
        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.

        Specified by:
        setFixedTickValues in interface AxisTickManager
        Parameters:
        values - the values in user unit where ticks are displayed.
      • setFixedMinorTickValues

        public void setFixedMinorTickValues(java.lang.Object minorValues)
        Description copied from interface: AxisTickManager
        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.

        Specified by:
        setFixedMinorTickValues in interface AxisTickManager
      • isAutoMinorTicks

        public boolean isAutoMinorTicks()
        Description copied from interface: AxisTickManager
        Returns true is the minor ticks number is derived from tick interval.
        Specified by:
        isAutoMinorTicks in interface AxisTickManager
        Returns:
        true is the minor ticks number is derived from tick interval.
      • setAutoMinorTicks

        public void setAutoMinorTicks(boolean flag)
        Description copied from interface: AxisTickManager
        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.
        Specified by:
        setAutoMinorTicks in interface AxisTickManager
      • getMinorTicks

        public int getMinorTicks()
        Description copied from interface: AxisTickManager
        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.
        Specified by:
        getMinorTicks in interface AxisTickManager
        Returns:
        the number of minor ticks displayed
      • setMinorTicks

        public void setMinorTicks(int minors)
        Description copied from interface: AxisTickManager
        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.

        Specified by:
        setMinorTicks in interface AxisTickManager
        Parameters:
        minors - the number of minor ticks displayed
      • getActualMinorTicks

        public int getActualMinorTicks()
        Description copied from interface: AxisTickManager
        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).
        Specified by:
        getActualMinorTicks in interface AxisTickManager
        Returns:
        the number of minor ticks displayed
      • getLabelTextFormat

        public java.text.Format getLabelTextFormat()
        Description copied from interface: AxisTickManager
        Returns the format of the labels of ticks.
        Specified by:
        getLabelTextFormat in interface AxisTickManager
        Returns:
        the format of the labels.
      • setLabelTextFormat

        public void setLabelTextFormat(java.text.Format format)
        Description copied from interface: AxisTickManager
        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

        Specified by:
        setLabelTextFormat in interface AxisTickManager
        Parameters:
        format - the format object
      • getLabelFormat

        public java.lang.String getLabelFormat()
        Description copied from interface: AxisTickManager
        Returns the printf-style format of the labels of ticks.
        Specified by:
        getLabelFormat in interface AxisTickManager
        Returns:
        the format of the labels.
      • setLabelFormat

        public void setLabelFormat(java.lang.String format)
        Description copied from interface: AxisTickManager
        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

        Specified by:
        setLabelFormat in interface AxisTickManager
        Parameters:
        format - the format string, or null to used the auto format.
      • getFixedLabelStrings

        public java.lang.String[] getFixedLabelStrings()
        Description copied from interface: AxisTickManager
        Returns the user assigned substitute labels. null has a special meaning of "undecided".
        Specified by:
        getFixedLabelStrings in interface AxisTickManager
        Returns:
        the user assigned substitute labels.
      • setFixedLabelStrings

        public void setFixedLabelStrings(java.lang.String[] labels)
        Description copied from interface: AxisTickManager
        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.

        Specified by:
        setFixedLabelStrings in interface AxisTickManager
        Parameters:
        labels - the new labels to be displayed in the ticks
        See Also:
        AxisTickManager.setFixedTickValues(Object)
      • getLabelInterval

        public int getLabelInterval()
        Description copied from interface: AxisTickManager
        Get the label interval. The tick labels are displayed after that number of ticks
        Specified by:
        getLabelInterval in interface AxisTickManager
        Returns:
        label interval
      • setLabelInterval

        public void setLabelInterval(int n)
        Description copied from interface: AxisTickManager
        Set the tick labels displayed after n ticks
        Specified by:
        setLabelInterval in interface AxisTickManager
        Parameters:
        n - label displayed each n ticks .
      • getTickValues

        public java.lang.Object getTickValues()
        Description copied from interface: AxisTickManager
        Return an array of number representing the tick positions shown in the axis.
        Specified by:
        getTickValues in interface AxisTickManager
        Returns:
        the values of the ticks
      • getMinorTickValues

        public java.lang.Object getMinorTickValues()
        Description copied from interface: AxisTickManager
        Return an array of number representing the minor tick positions shown in the axis.
        Specified by:
        getMinorTickValues in interface AxisTickManager
        Returns:
        the values of the ticks
      • getLabelStrings

        public java.lang.String[] getLabelStrings()
        Description copied from interface: AxisTickManager
        Return an array of string representing the labels shown in the axis.
        Specified by:
        getLabelStrings in interface AxisTickManager
        Returns:
        the labels of the ticks
      • expandRangeToTick

        public Range expandRangeToTick(TransformType txfType,
                                       Range range)
        Description copied from interface: AxisTickManagerEx
        This method not change internal status of TickManager. Only get those values: tickCalculator, tickNumber, labelFormat, labelInterval
        Specified by:
        expandRangeToTick in interface AxisTickManagerEx
        Parameters:
        txfType - transform type
        range - the core range
        Returns:
        the expanded range
      • copyStructure

        public AxisTickManagerImpl copyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)
        Description copied from interface: ElementEx
        Create a structural copy of this element and put them into orig2copyMap. All properties are not copied. The parent of the copy are not set by this method.
        Specified by:
        copyStructure in interface ElementEx
        Overrides:
        copyStructure in class ElementImpl
        Parameters:
        orig2copyMap - original element to copy map
        Returns:
        the structural copy of this element

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.