Class AbstractUnitOptionUI

  • All Implemented Interfaces:
    java.awt.event.ItemListener, java.util.EventListener, OptionUpdater

    public final class AbstractUnitOptionUI
    extends OptionUI<AbstractUnitOption>
    implements java.awt.event.ItemListener
    This class provides visualization for an AbstractUnitOption in order to enable values to be both seen and changed.
    • Constructor Detail

      • AbstractUnitOptionUI

        public AbstractUnitOptionUI​(AbstractUnitOption option,
                                    boolean editable)
        Creates a new AbstractUnitOptionUI for the given AbstractUnitOption.
        Parameters:
        option - The AbstractUnitOption to make a user interface for
        editable - boolean whether user can modify the setting
    • Method Detail

      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent e)
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
      • getListCellRenderer

        public javax.swing.ListCellRenderer getListCellRenderer()
        Get a ListCellRenderer suitable for the wrapped Option.
        Overrides:
        getListCellRenderer in class OptionUI<AbstractUnitOption>
        Returns:
        A suitable ListCellRenderer.
      • getComponent

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