Class AxisTick

java.lang.Object
org.swtchart.internal.axis.AxisTick
All Implemented Interfaces:
IAxisTick

public class AxisTick extends Object implements IAxisTick
An axis tick.
  • Constructor Details

    • AxisTick

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

    • 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(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 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(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 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(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 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 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.