guicomponents

## Class GOptionGroup

- java.lang.Object
- - guicomponents.GOptionGroup

-     public class GOptionGroup
      extends Object

  This is used to group options together to provide single-selection from 2 or more GOption buttons.
  Author:
    Peter Lager

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GOptionGroup()` Use this constructor to create an option group.
    `GOptionGroup(PApplet theApplet)` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addOption(GOption option)` INTERNAL USE ONLY
    `boolean` | `addOption(int pos, GOption option)` Add a new Option at the given position
    `int` | `deselectedIndex()` INTERNAL USE ONLY Return the index of the option that has just been deselected
    `GOption` | `deselectedOption()` INTERNAL USE ONLY Return the option that has just been deselected
    `String` | `deselectedText()` INTERNAL USE ONLY Return the text of the option that has just been deselected
    `GOption` | `get(int index)` INTERNAL USE ONLY
    `ArrayList<GOption>` | `getOptions()`
    `GOption` | `removeOption(GOption option)` Remove an existing option
    `GOption` | `removeOption(int index)` Remove an option at the given position
    `GOption` | `removeOption(String optText)` Remove an option based on the option's text (this ignores case)
    `int` | `selectedIndex()` INTERNAL USE ONLY
    `GOption` | `selectedOption()` INTERNAL USE ONLY Return the option that has just been selected
    `String` | `selectedText()` INTERNAL USE ONLY
    `void` | `setEnabled(boolean enable)` Enable or disable all the options in this group
    `void` | `setSelected(GOption option)` Make this option the selected one
    `void` | `setSelected(int index)` If index is in range make this one selected
    `void` | `setSelected(String optText)` Set option selected based on the option text (this case insensitive)
    `int` | `size()` Get the number of options in this GOptionGroup

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GOptionGroup

          public GOptionGroup()

      Use this constructor to create an option group.

    - #### GOptionGroup

          public GOptionGroup(PApplet theApplet)

      Deprecated.
      This class does not need a reference to the applet class
      Parameters:
        `theApplet` -

  - ### Method Detail

    - #### getOptions

          public ArrayList<GOption> getOptions()

    - #### setEnabled

          public void setEnabled(boolean enable)

      Enable or disable all the options in this group
      Parameters:
        `enable` -

    - #### get

          public GOption get(int index)

      INTERNAL USE ONLY
      Parameters:
        `index` -
      Returns:
        reference to an option based on it's index.

    - #### addOption

          public boolean addOption(GOption option)

      INTERNAL USE ONLY
      Parameters:
        `option` -
      Returns:
        true if option successfully added else false

    - #### addOption

          public boolean addOption(int pos,
                          GOption option)

      Add a new Option at the given position
      Parameters:
        `pos` -
        `option` -
      Returns:
        true if option successfully added else false

    - #### removeOption

          public GOption removeOption(GOption option)

      Remove an existing option
      Parameters:
        `option` -
      Returns:
        a reference to the option removed

    - #### removeOption

          public GOption removeOption(int index)

      Remove an option at the given position
      Parameters:
        `index` -
      Returns:
        a reference to the option removed

    - #### removeOption

          public GOption removeOption(String optText)

      Remove an option based on the option's text (this ignores case)
      Parameters:
        `optText` -
      Returns:
        a reference to the option removed

    - #### setSelected

          public void setSelected(GOption option)

      Make this option the selected one
      Parameters:
        `option` -

    - #### setSelected

          public void setSelected(int index)

      If index is in range make this one selected
      Parameters:
        `index` -

    - #### setSelected

          public void setSelected(String optText)

      Set option selected based on the option text (this case insensitive)
      Parameters:
        `optText` - the text of the option to select

    - #### selectedOption

          public GOption selectedOption()

      INTERNAL USE ONLY Return the option that has just been selected
      Returns:
        the option that has been selected

    - #### deselectedOption

          public GOption deselectedOption()

      INTERNAL USE ONLY Return the option that has just been deselected
      Returns:
        the option that has been deselected

    - #### selectedIndex

          public int selectedIndex()

      INTERNAL USE ONLY
      Returns:
        the index of the currently selected option

    - #### deselectedIndex

          public int deselectedIndex()

      INTERNAL USE ONLY Return the index of the option that has just been deselected
      Returns:
        the index of the de-selected option

    - #### selectedText

          public String selectedText()

      INTERNAL USE ONLY
      Returns:
        the text of the currently selected option

    - #### deselectedText

          public String deselectedText()

      INTERNAL USE ONLY Return the text of the option that has just been deselected
      Returns:
        the text of the de-selected option

    - #### size

          public int size()

      Get the number of options in this GOptionGroup

Processing library guicomponents by Peter Lager. (C) 2012