Package uk.ac.starlink.ttools.plot2
Class TickLook
java.lang.Object
uk.ac.starlink.ttools.plot2.TickLook
Defines the appearance of tick marks on a plot axis.
- Since:
- 21 Dec 2022
- Author:
- Mark Taylor
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
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.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.getName()
Returns the name of this style.toString()
-
Field Details
-
CLASSIC
Old-style look - major tickmarks extend above and below axis. -
STANDARD
Standard look - major tickmarks are twice as high as minor. -
NONE
No ticks are drawn.
-
-
Constructor Details
-
TickLook
Constructor.- Parameters:
name
- style name
-
-
Method Details
-
drawMinor
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
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
Returns the name of this style.- Returns:
- look name
-
toString
-
createClassicLook
Returns a look with major ticks extending both below and above the axis, minor ticks only above.- Parameters:
name
- style nameunit
- length in pixels of minor ticks- Returns:
- new instance
-
createStandardLook
Returns a look with major ticks twice as long as minor ones, all ticks only extending above the axis.- Parameters:
name
- style nameunit
- length in pixels of minor ticks- Returns:
- new instance
-