Package uk.ac.starlink.topcat.plot2
Class SpecifierArrayPanel<T>
java.lang.Object
uk.ac.starlink.topcat.plot2.SpecifierArrayPanel<T>
Displays a variable number of Specifiers for a given ConfigKey.
- Since:
- 21 Sep 2023
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionSpecifierArrayPanel
(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 TypeMethodDescriptionvoid
Adds a listener for changes to the specifiers.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
Removes a listener for changes to the specifiers.void
showElements
(int count) Updates the display to show a given number of specifiers.
-
Constructor Details
-
SpecifierArrayPanel
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 identifiedlabelFunc
- generates a specifier label for a given indexspecifierFunc
- generates a specifier for a given index
-
-
Method Details
-
getSpecifier
Returns the specifier for a given index.- Parameters:
index
- array index- Returns:
- specifier
-
getComponent
Returns the GUI component containing this panel.- Returns:
- panel
-
addActionListener
Adds a listener for changes to the specifiers.- Parameters:
l
- listener to add
-
removeActionListener
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
-