Class TickLook

java.lang.Object
uk.ac.starlink.ttools.plot2.TickLook

public abstract class TickLook extends Object
Defines the appearance of tick marks on a plot axis.
Since:
21 Dec 2022
Author:
Mark Taylor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final TickLook
    Old-style look - major tickmarks extend above and below axis.
    static final TickLook
    No ticks are drawn.
    static final TickLook
    Standard look - major tickmarks are twice as high as minor.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static TickLook
    createClassicLook(String name, int unit)
    Returns a look with major ticks extending both below and above the axis, minor ticks only above.
    static TickLook
    createStandardLook(String name, int unit)
    Returns a look with major ticks twice as long as minor ones, all ticks only extending above the axis.
    abstract void
    Draws a major tickmark at the origin, with the axis considered horizontal and the plot in the direction of the positive Y axis.
    abstract void
    Draws a minor tickmark at the origin, with the axis considered horizontal and the plot in the direction of the positive Y axis.
    Returns the name of this style.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • CLASSIC

      public static final TickLook CLASSIC
      Old-style look - major tickmarks extend above and below axis.
    • STANDARD

      public static final TickLook STANDARD
      Standard look - major tickmarks are twice as high as minor.
    • NONE

      public static final TickLook NONE
      No ticks are drawn.
  • Constructor Details

    • TickLook

      protected TickLook(String name)
      Constructor.
      Parameters:
      name - style name
  • Method Details

    • drawMinor

      public abstract void drawMinor(Graphics2D g2)
      Draws a minor tickmark at the origin, with the axis considered horizontal and the plot in the direction of the positive Y axis.
      Parameters:
      g2 - graphics context
    • drawMajor

      public abstract void drawMajor(Graphics2D g2)
      Draws a major tickmark at the origin, with the axis considered horizontal and the plot in the direction of the positive Y axis.
      Parameters:
      g2 - graphics context
    • getName

      public String getName()
      Returns the name of this style.
      Returns:
      look name
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createClassicLook

      public static TickLook createClassicLook(String name, int unit)
      Returns a look with major ticks extending both below and above the axis, minor ticks only above.
      Parameters:
      name - style name
      unit - length in pixels of minor ticks
      Returns:
      new instance
    • createStandardLook

      public static TickLook createStandardLook(String name, int unit)
      Returns a look with major ticks twice as long as minor ones, all ticks only extending above the axis.
      Parameters:
      name - style name
      unit - length in pixels of minor ticks
      Returns:
      new instance