Class ListOptionUI<T>

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.ListSelectionListener, OptionUpdater

    public final class ListOptionUI<T>
    extends OptionUI<ListOption<T>>
    implements javax.swing.event.ListSelectionListener
    This class provides visualization for a list of AbstractOptions in order to enable values to be both seen and changed.
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • panel

        private final javax.swing.JPanel panel
      • model

        private final javax.swing.DefaultListModel<AbstractOption<T>> model
      • editButton

        private final javax.swing.JButton editButton
      • addButton

        private final javax.swing.JButton addButton
      • removeButton

        private final javax.swing.JButton removeButton
      • upButton

        private final javax.swing.JButton upButton
      • downButton

        private final javax.swing.JButton downButton
    • Constructor Detail

      • ListOptionUI

        public ListOptionUI​(GUI gui,
                            ListOption<T> option,
                            boolean editable)
        Creates a new ListOptionUI for the given ListOption.
        Parameters:
        gui - The GUI to display on.
        option - The ListOption to display.
        editable - boolean whether user can modify the setting
    • Method Detail

      • setCellRenderer

        private void setCellRenderer​(GUI gui,
                                     AbstractOption<T> o,
                                     boolean editable)
      • getComponent

        public javax.swing.JPanel getComponent()
        Get the Component used to set the value of the Option.
        Specified by:
        getComponent in class OptionUI<ListOption<T>>
        Returns:
        a JComponent value
      • valueChanged

        public void valueChanged​(javax.swing.event.ListSelectionEvent e)
        Specified by:
        valueChanged in interface javax.swing.event.ListSelectionListener