Class AxisTick

  • All Implemented Interfaces:
    IAxisTick

    public class AxisTick
    extends java.lang.Object
    implements IAxisTick
    An axis tick.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AxisTick​(Chart chart, Axis axis)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AxisTickLabels getAxisTickLabels()
      Gets the axis tick labels.
      AxisTickMarks getAxisTickMarks()
      Gets the axis tick marks.
      org.eclipse.swt.graphics.Rectangle getBounds()
      Gets the bounds of axis tick.
      org.eclipse.swt.graphics.Font getFont()
      Gets the font for tick labels.
      org.eclipse.swt.graphics.Color getForeground()
      Gets the foreground color of axis tick.
      java.text.Format getFormat()
      Gets the format for axis tick label.
      int getTickLabelAngle()
      Gets the tick label angle.
      double[] getTickLabelValues()
      Gets the tick label values.
      int getTickMarkStepHint()
      Gets the tick mark step hint in pixels.
      boolean isVisible()
      Gets the state indicating if tick marks are visible.
      void setFont​(org.eclipse.swt.graphics.Font font)
      Sets the font for tick labels.
      void setForeground​(org.eclipse.swt.graphics.Color color)
      Sets the foreground color of axis tick.
      void setFormat​(java.text.Format format)
      Sets the format for axis tick label.
      void setTickLabelAngle​(int angle)
      Sets the tick label angle.
      void setTickMarkStepHint​(int tickMarkStepHint)
      Sets the tick mark step hint in pixels.
      void setVisible​(boolean isVisible)
      Sets the state indicating if tick marks are visible.
      protected void updateLayoutData()
      Updates the tick layout.
      void updateTick​(int length)
      Updates the tick around per 64 pixel.
      • Methods inherited from class java.lang.Object

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

      • AxisTick

        protected AxisTick​(Chart chart,
                           Axis axis)
        Constructor.
        Parameters:
        chart - the chart
        axis - the axis
    • Method Detail

      • getAxisTickMarks

        public AxisTickMarks getAxisTickMarks()
        Gets the axis tick marks.
        Returns:
        the axis tick marks
      • getAxisTickLabels

        public AxisTickLabels getAxisTickLabels()
        Gets the axis tick labels.
        Returns:
        the axis tick labels
      • setForeground

        public void setForeground​(org.eclipse.swt.graphics.Color color)
        Description copied from interface: IAxisTick
        Sets the foreground color of axis tick.
        Specified by:
        setForeground in interface IAxisTick
        Parameters:
        color - the foreground color of axis tick
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground()
        Description copied from interface: IAxisTick
        Gets the foreground color of axis tick.
        Specified by:
        getForeground in interface IAxisTick
        Returns:
        the foreground color of axis tick
      • setFont

        public void setFont​(org.eclipse.swt.graphics.Font font)
        Description copied from interface: IAxisTick
        Sets the font for tick labels.
        Specified by:
        setFont in interface IAxisTick
        Parameters:
        font - the font for tick labels
      • getFont

        public org.eclipse.swt.graphics.Font getFont()
        Description copied from interface: IAxisTick
        Gets the font for tick labels.
        Specified by:
        getFont in interface IAxisTick
        Returns:
        the font for tick labels
      • isVisible

        public boolean isVisible()
        Description copied from interface: IAxisTick
        Gets the state indicating if tick marks are visible.
        Specified by:
        isVisible in interface IAxisTick
        Returns:
        true if tick marks are visible
      • setVisible

        public void setVisible​(boolean isVisible)
        Description copied from interface: IAxisTick
        Sets the state indicating if tick marks are visible.
        Specified by:
        setVisible in interface IAxisTick
        Parameters:
        isVisible - true to make the tick marks visible
      • getTickMarkStepHint

        public int getTickMarkStepHint()
        Description copied from interface: IAxisTick
        Gets the tick mark step hint in pixels.
        Specified by:
        getTickMarkStepHint in interface IAxisTick
        Returns:
        the tick mark step hint in pixels
      • setTickMarkStepHint

        public void setTickMarkStepHint​(int tickMarkStepHint)
        Description copied from interface: IAxisTick
        Sets the tick mark step hint in pixels.
        Specified by:
        setTickMarkStepHint in interface IAxisTick
        Parameters:
        tickMarkStepHint - the tick mark step hint with pixels (> IAxisTick.MIN_GRID_STEP_HINT)
      • getTickLabelAngle

        public int getTickLabelAngle()
        Description copied from interface: IAxisTick
        Gets the tick label angle.
        Specified by:
        getTickLabelAngle in interface IAxisTick
        Returns:
        the tick label angle in degree
      • setTickLabelAngle

        public void setTickLabelAngle​(int angle)
        Description copied from interface: IAxisTick
        Sets the tick label angle.
        Specified by:
        setTickLabelAngle in interface IAxisTick
        Parameters:
        angle - the angle in degree between 0 and 90. The default value is 0. If setting 0, tick labels are horizontally shown. If setting 90, tick labels are vertically shown.
      • setFormat

        public void setFormat​(java.text.Format format)
        Description copied from interface: IAxisTick
        Sets the format for axis tick label. DecimalFormat and DateFormat should be used for double[] series and Date[] series respectively.
        Specified by:
        setFormat in interface IAxisTick
        Parameters:
        format - the format
      • getFormat

        public java.text.Format getFormat()
        Description copied from interface: IAxisTick
        Gets the format for axis tick label.
        Specified by:
        getFormat in interface IAxisTick
        Returns:
        the format
      • getBounds

        public org.eclipse.swt.graphics.Rectangle getBounds()
        Description copied from interface: IAxisTick
        Gets the bounds of axis tick.

        This method is typically used for mouse listener to check whether mouse cursor is on axis tick. Mouse listener can be added to Chart.

        Specified by:
        getBounds in interface IAxisTick
        Returns:
        the bounds of axis tick.
      • getTickLabelValues

        public double[] getTickLabelValues()
        Description copied from interface: IAxisTick
        Gets the tick label values.
        Specified by:
        getTickLabelValues in interface IAxisTick
        Returns:
        the tick label values
      • updateTick

        public void updateTick​(int length)
        Updates the tick around per 64 pixel.
        Parameters:
        length - the axis length
      • updateLayoutData

        protected void updateLayoutData()
        Updates the tick layout.