# Class TrimmingSpec.LegendSpec

java.lang.Object
uk.ac.starlink.ttools.plot2.task.TrimmingSpec.LegendSpec

Enclosing class:
  `TrimmingSpec`

public static class TrimmingSpec.LegendSpec extends Object
Specification for legend display options.

Since:
  29 Aug 2023
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`LegendSpec(boolean hasBorder, boolean isOpaque, float[] legPos)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`float[]`
`getPosition()`
Returns fractional legend position.
`boolean`
`hasBorder()`
Returns border flag.
`boolean`
`isOpaque()`
Returns legend opacity.

### Methods inherited from class Object

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

## Constructor Details

### LegendSpec

public LegendSpec(boolean hasBorder, boolean isOpaque, float[] legPos)
Constructor.

Parameters:
  `hasBorder` - true if border is to be drawn
  `isOpaque` - true for opaque background
  `legPos` - 2-element x,y array for fractional internal legend position, null for external

## Method Details

### hasBorder

public boolean hasBorder()
Returns border flag.

Returns:
  true for border, false for none

### isOpaque

public boolean isOpaque()
Returns legend opacity.

Returns:
  true for opaque legend, false for transparent

### getPosition

public float[] getPosition()
Returns fractional legend position.

Returns:
  2-element x,y array for fractional internal legend position, null for external