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 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