org.jfree.ui

Class FontChooserPanel

public class FontChooserPanel extends JPanel

A panel for choosing a font from the available system fonts - still a bit of a hack at the moment, but good enough for demonstration applications.

Author: David Gilbert

Field Summary
protected static ResourceBundlelocalizationResources
The resourceBundle for the localization.
static String[]SIZES
The font sizes that can be selected.
Constructor Summary
FontChooserPanel(Font font)
Standard constructor - builds a FontChooserPanel initialised with the specified font.
Method Summary
FontgetSelectedFont()
Returns a Font object representing the selection in the panel.
StringgetSelectedName()
Returns the selected name.
intgetSelectedSize()
Returns the selected size.
intgetSelectedStyle()
Returns the selected style.
voidsetSelectedFont(Font font)
Initializes the contents of the dialog from the given font object.

Field Detail

localizationResources

protected static ResourceBundle localizationResources
The resourceBundle for the localization.

SIZES

public static final String[] SIZES
The font sizes that can be selected.

Constructor Detail

FontChooserPanel

public FontChooserPanel(Font font)
Standard constructor - builds a FontChooserPanel initialised with the specified font.

Parameters: font the initial font to display.

Method Detail

getSelectedFont

public Font getSelectedFont()
Returns a Font object representing the selection in the panel.

Returns: the font.

getSelectedName

public String getSelectedName()
Returns the selected name.

Returns: the name.

getSelectedSize

public int getSelectedSize()
Returns the selected size.

Returns: the size.

getSelectedStyle

public int getSelectedStyle()
Returns the selected style.

Returns: the style.

setSelectedFont

public void setSelectedFont(Font font)
Initializes the contents of the dialog from the given font object.

Parameters: font the font from which to read the properties.