Class ModOptionUI

  • All Implemented Interfaces:
    OptionUpdater

    public final class ModOptionUI
    extends OptionUI<ModOption>
    This class provides visualization for a ModOption in order to enable values to be both seen and changed.
    • Field Detail

      • box

        private final javax.swing.JComboBox<FreeColModFile> box
        The selection box for the various mod files.
    • Constructor Detail

      • ModOptionUI

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

      • labelModFile

        private static void labelModFile​(javax.swing.JLabel label,
                                         FreeColModFile modFile)
        Add information from a mod file to a label.
        Parameters:
        label - The JLabel to modify.
        modFile - The FreeColModFile to use.
      • getListCellRenderer

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

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