Package uk.ac.starlink.topcat.plot2

# Class SingleAdapterAxesController<P,A>

java.lang.Object
uk.ac.starlink.topcat.plot2.SingleAdapterAxesController<P,A>

All Implemented Interfaces:
  `AxesController<P,A>`, `Configger`

public class SingleAdapterAxesController<P,A> extends Object implements AxesController<P,A>
AxesController implementation for use with one-zone plots. This is a wrapper around the legacy `AxisController` class.

Since:
  18 Aug 2023
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`SingleAdapterAxesController(AxisController<P,A> axisController)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionListener(ActionListener listener)`
Adds a listener notified when any of the controls changes.
`void`
`configureForLayers(LayerControl[] layerControls)`
Provides a hook for implementations to adjust their GUI state based on the layer controls which will be supplying layers for them to plot.
`static <P, A> SingleAdapterAxesController<P,A>`
`create(AxisController<P,A> axisController)`
Utiilty method for instance construction.
`uk.ac.starlink.ttools.plot2.config.ConfigMap`
`getConfig()`
Returns a configuration map.
`Control[]`
`getStackControls()`
Returns all the controls for user configuration of this controller.
`List<ZoneController<P,A>>`
`getZoneControllers(uk.ac.starlink.ttools.plot2.Ganger<P,A> ganger)`
Returns a list of zone contollers, one for each zone defined by a supplied ganger.
`void`
`removeActionListener(ActionListener listener)`
Removes a listener previously added by addActionListener.

### Methods inherited from class java.lang.Object

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

## Constructor Details

### SingleAdapterAxesController

public SingleAdapterAxesController(AxisController<P,A> axisController)
Constructor. The supplied axisController provides the behaviour for the methods of both this instance and of the sole ZoneController which it dispenses.

Parameters:
  `axisController` - object to which behaviour is delegated
See Also:
  - `create(uk.ac.starlink.topcat.plot2.AxisController<P, A>)`

## Method Details

### configureForLayers

public void configureForLayers(LayerControl[] layerControls)
Description copied from interface: `AxesController`
Provides a hook for implementations to adjust their GUI state based on the layer controls which will be supplying layers for them to plot.

Specified by:
  `configureForLayers` in interface `AxesController<P,A>`
Parameters:
  `layerControls` - layer controls expected to provide layers to be plotted on these axes

### getZoneControllers

public List<ZoneController<P,A>> getZoneControllers(uk.ac.starlink.ttools.plot2.Ganger<P,A> ganger)
Description copied from interface: `AxesController`
Returns a list of zone contollers, one for each zone defined by a supplied ganger.

Specified by:
  `getZoneControllers` in interface `AxesController<P,A>`
Parameters:
  `ganger` - ganger, assumed to be compatible with this controller
Returns:
  list of zone controllers, one for each zone defined by the ganger

### getStackControls

public Control[] getStackControls()
Description copied from interface: `AxesController`
Returns all the controls for user configuration of this controller. This includes the main control and possibly others.

Specified by:
  `getStackControls` in interface `AxesController<P,A>`
Returns:
  user controls

### getConfig

public uk.ac.starlink.ttools.plot2.config.ConfigMap getConfig()
Description copied from interface: `Configger`
Returns a configuration map. Calling this method will typically gather information from a GUI to return.

Specified by:
  `getConfig` in interface `Configger`
Returns:
  config map

### addActionListener

public void addActionListener(ActionListener listener)
Description copied from interface: `AxesController`
Adds a listener notified when any of the controls changes.

Specified by:
  `addActionListener` in interface `AxesController<P,A>`
Parameters:
  `listener` - listener to add

### removeActionListener

public void removeActionListener(ActionListener listener)
Description copied from interface: `AxesController`
Removes a listener previously added by addActionListener.

Specified by:
  `removeActionListener` in interface `AxesController<P,A>`
Parameters:
  `listener` - listener to remove

### create

public static <P, A> SingleAdapterAxesController<P,A> create(AxisController<P,A> axisController)
Utiilty method for instance construction. Convenient for use with generics.

Parameters:
  `axisController` - object to which behaviour is delegated
Returns:
  new instance