# Class OrientationPolicy

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

public class OrientationPolicy extends Object
Characterises choices about the orientations of axis numeric labels.

Since:
  10 Sep 2024
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final OrientationPolicy`
`ADAPTIVE`
X labels may be horizontal or angled depending on crowding.
`static final OrientationPolicy`
`ANGLED`
All X labels are at an angle.
`static final OrientationPolicy`
`HORIZONTAL`
All X labels are horizontal.

## Constructor Summary

Constructors
Constructor
Description
`OrientationPolicy(String name, String description, Orientation[] xorients, Orientation[] yorients, Orientation[] x2orients, Orientation[] y2orients)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getDescription()`
Returns the description of this policy.
`String`
`getName()`
Returns the name of this policy.
`static OrientationPolicy[]`
`getOptions()`
Returns a list of the available options.
`Orientation[]`
`getOrientationsX()`
Returns acceptable orientations for X axis labels, in order of preference.
`Orientation[]`
`getOrientationsX2()`
Returns acceptable orientations for secondary X axis labels, in order of preference.
`Orientation[]`
`getOrientationsY()`
Returns acceptable orientations for Y axis labels, in order of preference.
`Orientation[]`
`getOrientationsY2()`
Returns acceptable orientations for secondary Y axis labels, in order of preference.
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### HORIZONTAL

public static final OrientationPolicy HORIZONTAL
All X labels are horizontal.

### ANGLED

public static final OrientationPolicy ANGLED
All X labels are at an angle.

### ADAPTIVE

public static final OrientationPolicy ADAPTIVE
X labels may be horizontal or angled depending on crowding.

## Constructor Details

### OrientationPolicy

public OrientationPolicy(String name, String description, Orientation[] xorients, Orientation[] yorients, Orientation[] x2orients, Orientation[] y2orients)
Constructor.

Parameters:
  `name` - policy name
  `description` - short user-directed description of policy
  `xorients` - acceptable orientations for X axis labels, in order of preference
  `yorients` - acceptable orientations for Y axis labels, in order of preference
  `x2orients` - acceptable orientations for secondary X axis labels, in order of preference
  `y2orients` - acceptable orientations for secondary Y axis labels, in order of preference

## Method Details

### getName

public String getName()
Returns the name of this policy.

Returns:
  name

### getDescription

public String getDescription()
Returns the description of this policy.

Returns:
  user-directed description

### getOrientationsX

public Orientation[] getOrientationsX()
Returns acceptable orientations for X axis labels, in order of preference.

Returns:
  ordered orientation list

### getOrientationsY

public Orientation[] getOrientationsY()
Returns acceptable orientations for Y axis labels, in order of preference.

Returns:
  ordered orientation list

### getOrientationsX2

public Orientation[] getOrientationsX2()
Returns acceptable orientations for secondary X axis labels, in order of preference.

Returns:
  ordered orientation list

### getOrientationsY2

public Orientation[] getOrientationsY2()
Returns acceptable orientations for secondary Y axis labels, in order of preference.

Returns:
  ordered orientation list

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getOptions

public static OrientationPolicy[] getOptions()
Returns a list of the available options.

Returns:
  policy options