# Class TickSkyAxisLabeller

java.lang.Object
uk.ac.starlink.ttools.plot2.geom.TickSkyAxisLabeller

All Implemented Interfaces:
  `SkyAxisLabeller`

public abstract class TickSkyAxisLabeller extends Object implements SkyAxisLabeller
Partial SkyAxisLabeller implementation that labels axes with positioned numeric labels.

Since:
  21 Feb 2013
Author:
  Mark Taylor

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`TickSkyAxisLabeller.SkyTick`
Aggregates a line label, graphics position and text anchor.

## Field Summary

Fields
Modifier and Type
Field
Description
`static Anchor`
`X_ANCHOR`
`static Anchor`
`Y_ANCHOR`

## Constructor Summary

Constructors
Constructor
Description
`TickSkyAxisLabeller(String name, String description, boolean labelSys)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected abstract TickSkyAxisLabeller.SkyTick[]`
`calculateTicks(double[][][] lines, Caption[] labels, Rectangle plotBounds)`
Returns a list of ticks for labelling lines produced by a GridLiner.
`AxisAnnotation`
`createAxisAnnotation(GridLiner gridLiner, Captioner captioner, SkySys skySys)`
Returns an axis annotation object for a given grid painter and captioner.
`static TickSkyAxisLabeller.SkyTick`
`createExternalTick(Caption label, double[][] line, Rectangle bounds)`
Constructs a single tick that sits outside the plot bounding box for a given grid line.
`static TickSkyAxisLabeller.SkyTick`
`createInternalTick(Caption label, double[][] line)`
Constructs a single tick that sits inside the plot bounding box for a given grid line.
`String`
`getLabellerDescription()`
Returns a description for this mode.
`String`
`getLabellerName()`
Returns a name for this axis labelling mode.
`protected TickSkyAxisLabeller.SkyTick[]`
`removeOverlaps(TickSkyAxisLabeller.SkyTick[] ticks, Captioner captioner)`
Takes a list of ticks and removes some elements if they are so crowded together the labels overlap.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### X_ANCHOR

public static Anchor X_ANCHOR

### Y_ANCHOR

public static Anchor Y_ANCHOR

## Constructor Details

### TickSkyAxisLabeller

public TickSkyAxisLabeller(String name, String description, boolean labelSys)
Constructor.

Parameters:
  `name` - labeller name
  `description` - labeller description
  `labelSys` - labelSys determines whether the sky system coordinate names are written on the axes

## Method Details

### getLabellerName

public String getLabellerName()
Description copied from interface: `SkyAxisLabeller`
Returns a name for this axis labelling mode.

Specified by:
  `getLabellerName` in interface `SkyAxisLabeller`
Returns:
  one-word name

### getLabellerDescription

public String getLabellerDescription()
Description copied from interface: `SkyAxisLabeller`
Returns a description for this mode.

Specified by:
  `getLabellerDescription` in interface `SkyAxisLabeller`
Returns:
  description

### createAxisAnnotation

public AxisAnnotation createAxisAnnotation(GridLiner gridLiner, Captioner captioner, SkySys skySys)
Description copied from interface: `SkyAxisLabeller`
Returns an axis annotation object for a given grid painter and captioner.

Specified by:
  `createAxisAnnotation` in interface `SkyAxisLabeller`
Parameters:
  `gridLiner` - grid lines for a sky plot
  `captioner` - text renderer
  `skySys` - sky coordinate system
Returns:
  axis annotation

### calculateTicks

protected abstract TickSkyAxisLabeller.SkyTick[] calculateTicks(double[][][] lines, Caption[] labels, Rectangle plotBounds)
Returns a list of ticks for labelling lines produced by a GridLiner.

Parameters:
  `lines` - gridliner line point array
  `labels` - gridliner line label array
  `plotBounds` - extent of plot region in graphics coordinates
See Also:
  - `GridLiner`

### removeOverlaps

protected TickSkyAxisLabeller.SkyTick[] removeOverlaps(TickSkyAxisLabeller.SkyTick[] ticks, Captioner captioner)
Takes a list of ticks and removes some elements if they are so crowded together the labels overlap.

Parameters:
  `ticks` - input tick list
  `captioner` - text renderer
Returns:
  output tick list, with some items removed if necessary

### createExternalTick

public static TickSkyAxisLabeller.SkyTick createExternalTick(Caption label, double[][] line, Rectangle bounds)
Constructs a single tick that sits outside the plot bounding box for a given grid line.

Parameters:
  `label` - tick text
  `line` - grid line coordinates - array of (x,y) arrays
  `bounds` - plot region bounds

### createInternalTick

public static TickSkyAxisLabeller.SkyTick createInternalTick(Caption label, double[][] line)
Constructs a single tick that sits inside the plot bounding box for a given grid line.

Parameters:
  `label` - tick text
  `line` - grid line coordinates - array of (x,y) arrays