Class GUIHelper.InputPanelWithButtons

    • Field Detail

      • m_Value

        protected String m_Value
        the selected value.
      • m_LabelMessage

        protected JLabel m_LabelMessage
        the label for the message.
      • m_PanelButtons

        protected JPanel m_PanelButtons
        the panel with the buttons.
    • Constructor Detail

      • InputPanelWithButtons

        public InputPanelWithButtons​(String msg,
                                     String initial,
                                     String[] options,
                                     boolean horizontal)
        Initializes the panel. Uses FlowLayout.CENTER as justification.
        Parameters:
        msg - the message to display
        initial - the initial value to use for the input value
        options - the options to select from
        horizontal - whether to use horizontal or vertical buttons
      • InputPanelWithButtons

        public InputPanelWithButtons​(String msg,
                                     String initial,
                                     String[] options,
                                     boolean horizontal,
                                     int btnJustification)
        Initializes the panel.
        Parameters:
        msg - the message to display
        initial - the initial value to use for the input value
        options - the options to select from
        horizontal - whether to use horizontal or vertical buttons
        btnJustification - the justification of the buttons for horizontal layout (see FlowLayout)
      • InputPanelWithButtons

        public InputPanelWithButtons​(String msg,
                                     String initial,
                                     String[] options,
                                     boolean horizontal,
                                     int btnJustification,
                                     String icon)
        Initializes the panel.
        Parameters:
        msg - the message to display
        initial - the initial value to use for the input value
        options - the options to select from
        horizontal - whether to use horizontal or vertical buttons
        btnJustification - the justification of the buttons for horizontal layout (see FlowLayout)
        icon - the icon to use, null for none
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • getButtons

        public List<BaseButton> getButtons()
        Gives access to the underlying buttons.
        Returns:
        the buttons in use
      • setOptions

        public void setOptions​(String[] options,
                               boolean horizontal,
                               int btnJustification)
        Sets the options to display.
        Parameters:
        options - the options
        horizontal - whether to use horizontal or vertical buttons
        btnJustification - the justification of the buttons for horizontal layout (see FlowLayout)
      • getInitialButton

        public BaseButton getInitialButton​(String initial)
        Returns the initial button to focus.
        Parameters:
        initial - the initial selection
        Returns:
        the initial button, null if not found