Package uk.ac.starlink.topcat.plot2

# Class SpecifierArrayPanel<T>

java.lang.Object
uk.ac.starlink.topcat.plot2.SpecifierArrayPanel<T>

public class SpecifierArrayPanel<T> extends Object
Displays a variable number of Specifiers for a given ConfigKey.

Since:
  21 Sep 2023
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`SpecifierArrayPanel(uk.ac.starlink.ttools.plot2.config.ConfigKey<T> key)`
Constructs a panel with default specifiers.
`SpecifierArrayPanel(uk.ac.starlink.ttools.plot2.config.ConfigKey<T> key, IntFunction<String> labelFunc, IntFunction<uk.ac.starlink.ttools.plot2.config.Specifier<T>> specifierFunc)`
Constructs a panel with custom labels and specifiers.

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionListener(ActionListener l)`
Adds a listener for changes to the specifiers.
`JComponent`
`getComponent()`
Returns the GUI component containing this panel.
`uk.ac.starlink.ttools.plot2.config.Specifier<T>`
`getSpecifier(int index)`
Returns the specifier for a given index.
`void`
`removeActionListener(ActionListener l)`
Removes a listener for changes to the specifiers.
`void`
`showElements(int count)`
Updates the display to show a given number of specifiers.

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

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

## Constructor Details

### SpecifierArrayPanel

public SpecifierArrayPanel(uk.ac.starlink.ttools.plot2.config.ConfigKey<T> key)
Constructs a panel with default specifiers.

Parameters:
  `key` - config key to use for all specifiers

### SpecifierArrayPanel

public SpecifierArrayPanel(uk.ac.starlink.ttools.plot2.config.ConfigKey<T> key, IntFunction<String> labelFunc, IntFunction<uk.ac.starlink.ttools.plot2.config.Specifier<T>> specifierFunc)
Constructs a panel with custom labels and specifiers.

Parameters:
  `key` - config key by which configured values will be identified
  `labelFunc` - generates a specifier label for a given index
  `specifierFunc` - generates a specifier for a given index

## Method Details

### getSpecifier

public uk.ac.starlink.ttools.plot2.config.Specifier<T> getSpecifier(int index)
Returns the specifier for a given index.

Parameters:
  `index` - array index
Returns:
  specifier

### getComponent

public JComponent getComponent()
Returns the GUI component containing this panel.

Returns:
  panel

### addActionListener

public void addActionListener(ActionListener l)
Adds a listener for changes to the specifiers.

Parameters:
  `l` - listener to add

### removeActionListener

public void removeActionListener(ActionListener l)
Removes a listener for changes to the specifiers.

Parameters:
  `l` - listener to remove

### showElements

public void showElements(int count)
Updates the display to show a given number of specifiers. Ones not seen before are lazily created as required.

Parameters:
  `count` - number of specifiers to display