# Class LegendControl

java.lang.Object
uk.ac.starlink.topcat.plot2.TabberControl
uk.ac.starlink.topcat.plot2.LegendControl

All Implemented Interfaces:
  `Control`

public class LegendControl extends TabberControl
Control for defining legend characteristics.

Since:
  13 Mar 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`LegendControl()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`uk.ac.starlink.ttools.plot2.LegendIcon`
`createLegendIcon(uk.ac.starlink.ttools.plot2.LegendEntry[] entries, uk.ac.starlink.ttools.plot2.config.ConfigMap config)`
Returns the legend icon for the current state of the stack model.
`ToggleButtonModel`
`getInsideModel()`
Returns the model used to specify whether the legend is internal or external to the plot bounds.
`float[]`
`getLegendPosition()`
Returns the requested legend fractional position.

### Methods inherited from class TabberControl

`addActionListener, addControlTab, addZoneTab, getActionForwarder, getControlIcon, getControlLabel, getPanel, getTabber, removeActionListener`

### Methods inherited from class Object

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

## Constructor Details

### LegendControl

public LegendControl()
Constructor.

## Method Details

### createLegendIcon

public uk.ac.starlink.ttools.plot2.LegendIcon createLegendIcon(uk.ac.starlink.ttools.plot2.LegendEntry[] entries, uk.ac.starlink.ttools.plot2.config.ConfigMap config)
Returns the legend icon for the current state of the stack model.

Parameters:
  `entries` - entries to include in legend
  `config` - legend configuration options to control text style etc
Returns:
  legend icon, or null if not visible

### getLegendPosition

public float[] getLegendPosition()
Returns the requested legend fractional position.

Returns:
  2-element array giving x, y fractional positions for legend (each in range 0..1), or null for absent or external legend

### getInsideModel

public ToggleButtonModel getInsideModel()
Returns the model used to specify whether the legend is internal or external to the plot bounds.

Returns:
  inside model