org.crosswire.common.swing

## Class FontChooser.CustomComboBoxModel

- java.lang.Object
- - javax.swing.AbstractListModel
  - - org.crosswire.common.swing.FontChooser.CustomComboBoxModel

- All Implemented Interfaces:
    Serializable, ComboBoxModel, ListModel
  Enclosing class:
    FontChooser

      static class FontChooser.CustomComboBoxModel
      extends AbstractListModel
      implements ComboBoxModel

  Model for the font style drop down

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `fontCount` The total number of fonts.
    `private Font[]` | `fonts` An array of the fonts themselves.
    `private Object` | `selection` The currently selected item
    `private static long` | `serialVersionUID` Serialization ID

    - ### Fields inherited from class javax.swing.AbstractListModel

      `listenerList`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `FontChooser.CustomComboBoxModel()` Create a custom data model for a JComboBox

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `getElementAt(int index)`
    `Object` | `getSelectedItem()`
    `int` | `getSize()`
    `void` | `setSelectedItem(Object selection)`

    - ### Methods inherited from class javax.swing.AbstractListModel

      `addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener`

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

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

    - ### Methods inherited from interface javax.swing.ListModel

      `addListDataListener, removeListDataListener`

- - ### Field Detail

    - #### fontCount

          private int fontCount

      The total number of fonts. Note, this may be less than or equal to fonts.length.

    - #### fonts

          private Font[] fonts

      An array of the fonts themselves. Note the array is as big as the total number of fonts in the system.

    - #### selection

          private Object selection

      The currently selected item

    - #### serialVersionUID

          private static final long serialVersionUID

      Serialization ID
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FontChooser.CustomComboBoxModel

          protected FontChooser.CustomComboBoxModel()

      Create a custom data model for a JComboBox

  - ### Method Detail

    - #### setSelectedItem

          public void setSelectedItem(Object selection)

      Specified by:
        `setSelectedItem` in interface `ComboBoxModel`

    - #### getSelectedItem

          public Object getSelectedItem()

      Specified by:
        `getSelectedItem` in interface `ComboBoxModel`

    - #### getSize

          public int getSize()

      Specified by:
        `getSize` in interface `ListModel`

    - #### getElementAt

          public Object getElementAt(int index)

      Specified by:
        `getElementAt` in interface `ListModel`