us.zuercher.gpx2map.gui
Class FontComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by javax.swing.DefaultComboBoxModel
          extended by us.zuercher.gpx2map.gui.FontComboBoxModel
All Implemented Interfaces:
Serializable, ComboBoxModel, ListModel, MutableComboBoxModel

public class FontComboBoxModel
extends DefaultComboBoxModel

FontComboBoxModel defines the choices available in the font combo box of the Gpx2Map GUI.

Author:
Stephan Zuercher
See Also:
Serialized Form

Nested Class Summary
static class FontComboBoxModel.FontChoice
          FontChoice represents a choice in the font selection combo box.
 
Field Summary
private static int defaultIndex
          The font to select by default.
private static FontComboBoxModel.FontChoice[] fontChoices
          List of available font choices.
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
FontComboBoxModel()
          Constructs a new FontComboBoxModel with the available FontChoices.
 
Method Summary
private static FontComboBoxModel.FontChoice[] getFontChoices()
          Internal method that generates the available list of fonts.
 
Methods inherited from class javax.swing.DefaultComboBoxModel
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAt, setSelectedItem
 
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

fontChoices

private static FontComboBoxModel.FontChoice[] fontChoices
List of available font choices. Only written to once during the first construction of this class.


defaultIndex

private static int defaultIndex
The font to select by default.

Constructor Detail

FontComboBoxModel

public FontComboBoxModel()
Constructs a new FontComboBoxModel with the available FontChoices.

Method Detail

getFontChoices

private static FontComboBoxModel.FontChoice[] getFontChoices()
Internal method that generates the available list of fonts. The font list is stored in fontChoices and is not regenerated. Also sets the defaultIndex field.

Returns:
Array of FontChoice representing the available fonts on this system.