com.connectina.swing.fontchooser
Interface FontSelectionModel

All Known Implementing Classes:
DefaultFontSelectionModel

public interface FontSelectionModel

A model that supports selecting a Font.

See Also:
Font

Method Summary
 void addChangeListener(ChangeListener listener)
          Adds listener as a listener to changes in the model.
 List<String> getAvailableFontNames()
          Gets the available font names.
 Font getSelectedFont()
          Returns the selected Font which should be non-null.
 void removeChangeListener(ChangeListener listener)
          Removes listener as a listener to changes in the model.
 void setSelectedFont(Font font)
          Sets the selected font to font.
 

Method Detail

getSelectedFont

Font getSelectedFont()
Returns the selected Font which should be non-null.

Returns:
the selected Font
See Also:
setSelectedFont(java.awt.Font)

setSelectedFont

void setSelectedFont(Font font)
Sets the selected font to font. Note that setting the font to null is undefined and may have unpredictable results. This method fires a state changed event if it sets the current font to a new non-null font.

Parameters:
font - the new Font
See Also:
getSelectedFont(), addChangeListener(javax.swing.event.ChangeListener)

getAvailableFontNames

List<String> getAvailableFontNames()
Gets the available font names. Returns a list containing the names of all font families in this GraphicsEnvironment localized for the default locale, as returned by Locale.getDefault().

Returns:
a list of String containing font family names localized for the default locale, or a suitable alternative name if no name exists for this locale

addChangeListener

void addChangeListener(ChangeListener listener)
Adds listener as a listener to changes in the model.

Parameters:
listener - the ChangeListener to be added

removeChangeListener

void removeChangeListener(ChangeListener listener)
Removes listener as a listener to changes in the model.

Parameters:
listener - the ChangeListener to be removed