edu.princeton.wordnet.browser.component.JFontChooser Class Reference

Inherits javax::swing::JComponent.

Collaboration diagram for edu.princeton.wordnet.browser.component.JFontChooser:
Collaboration graph
[legend]

List of all members.

Classes

class  DialogCancelAction
class  DialogOKAction
class  ListSearchTextFieldDocumentHandler
class  ListSelectionHandler
class  TextFieldFocusHandlerForTextSelection
class  TextFieldKeyHandlerForListSelectionUpDown

Public Member Functions

 JFontChooser ()
 JFontChooser (final String[] fontSizeStrings0)
JTextField getFontFamilyTextField ()
JTextField getFontStyleTextField ()
JTextField getFontSizeTextField ()
JList getFontFamilyList ()
JList getFontStyleList ()
JList getFontSizeList ()
String getSelectedFontFamily ()
int getSelectedFontStyle ()
int getSelectedFontSize ()
Font getSelectedFont ()
void setSelectedFontFamily (final String name)
void setSelectedFontStyle (final int style)
void setSelectedFontSize (final int size)
void setSelectedFont (final Font font)
String getVersionString ()
int showDialog (final Component parent)

Static Public Attributes

static final int OK_OPTION = 0
static final int CANCEL_OPTION = 1
static final int ERROR_OPTION = -1

Protected Member Functions

String _ (final String key)
JDialog createDialog (final Component parent)
void updateSampleFont ()
JPanel getFontFamilyPanel ()
JPanel getFontStylePanel ()
JPanel getFontSizePanel ()
JPanel getSamplePanel ()
JTextField getSampleTextField ()
String[] getFontFamilies ()
String[] getFontStyleNames ()

Protected Attributes

int dialogResultValue = JFontChooser.ERROR_OPTION

Detailed Description

The JFontChooser class is a swing component for font selection. This class has JFileChooser like APIs. The following code pops up a font chooser dialog.

 JFontChooser fontChooser = new JFontChooser();
 int result = fontChooser.showDialog(parent);
 if (result == JFontChooser.OK_OPTION)
 {
 	Font font = fontChooser.getSelectedFont();
 	System.out.println("Selected Font : " + font);
 }
 

Constructor & Destructor Documentation

edu.princeton.wordnet.browser.component.JFontChooser.JFontChooser (  ) 

Constructs a JFontChooser object.

edu.princeton.wordnet.browser.component.JFontChooser.JFontChooser ( final String[]  fontSizeStrings0  ) 

Constructs a JFontChooser object using the given font size array.

Parameters:
fontSizeStrings0 the array of font size string.

Member Function Documentation

String edu.princeton.wordnet.browser.component.JFontChooser._ ( final String  key  )  [protected]

Localisation function

Parameters:
key key
Returns:
string value
JDialog edu.princeton.wordnet.browser.component.JFontChooser.createDialog ( final Component  parent  )  [protected]

Create dialog

Parameters:
parent parent
Returns:
dialog
String [] edu.princeton.wordnet.browser.component.JFontChooser.getFontFamilies (  )  [protected]

Get font families

Returns:
font families
JList edu.princeton.wordnet.browser.component.JFontChooser.getFontFamilyList (  ) 

Get font family list

Returns:
font family list
JPanel edu.princeton.wordnet.browser.component.JFontChooser.getFontFamilyPanel (  )  [protected]

Get font family panel

Returns:
font family panel
JTextField edu.princeton.wordnet.browser.component.JFontChooser.getFontFamilyTextField (  ) 

Get font family textfield

Returns:
font family textfield
JList edu.princeton.wordnet.browser.component.JFontChooser.getFontSizeList (  ) 

Get font size list

Returns:
font size list
JPanel edu.princeton.wordnet.browser.component.JFontChooser.getFontSizePanel (  )  [protected]

Get font size panel

Returns:
font size panel
JTextField edu.princeton.wordnet.browser.component.JFontChooser.getFontSizeTextField (  ) 

Get font size textfield

Returns:
font size textfield
JList edu.princeton.wordnet.browser.component.JFontChooser.getFontStyleList (  ) 

Get font size list

Returns:
font size list
String [] edu.princeton.wordnet.browser.component.JFontChooser.getFontStyleNames (  )  [protected]

Get font style names

Returns:
font style names
JPanel edu.princeton.wordnet.browser.component.JFontChooser.getFontStylePanel (  )  [protected]

Get font style panel

Returns:
font style panel
JTextField edu.princeton.wordnet.browser.component.JFontChooser.getFontStyleTextField (  ) 

Get font style textfield

Returns:
font style textfield
JPanel edu.princeton.wordnet.browser.component.JFontChooser.getSamplePanel (  )  [protected]

Get sample panel

Returns:
sample panel
JTextField edu.princeton.wordnet.browser.component.JFontChooser.getSampleTextField (  )  [protected]

Get sample textfield

Returns:
sample textfield
Font edu.princeton.wordnet.browser.component.JFontChooser.getSelectedFont (  ) 

Get the selected font.

Returns:
the selected font
See also:
setSelectedFont
java.awt.Font
String edu.princeton.wordnet.browser.component.JFontChooser.getSelectedFontFamily (  ) 

Get the family name of the selected font.

Returns:
the font family of the selected font.
See also:
setSelectedFontFamily
int edu.princeton.wordnet.browser.component.JFontChooser.getSelectedFontSize (  ) 

Get the size of the selected font.

Returns:
the size of the selected font
See also:
setSelectedFontSize
int edu.princeton.wordnet.browser.component.JFontChooser.getSelectedFontStyle (  ) 

Get the style of the selected font.

Returns:
the style of the selected font. Font.PLAIN, Font.BOLD, Font.ITALIC, Font.BOLD|Font.ITALIC
See also:
java.awt.Font.PLAIN
java.awt.Font.BOLD
java.awt.Font.ITALIC
setSelectedFontStyle
String edu.princeton.wordnet.browser.component.JFontChooser.getVersionString (  ) 

Get localized "version" string

Returns:
localized "version" string
void edu.princeton.wordnet.browser.component.JFontChooser.setSelectedFont ( final Font  font  ) 

Set the selected font.

Parameters:
font the selected font
See also:
getSelectedFont
java.awt.Font
void edu.princeton.wordnet.browser.component.JFontChooser.setSelectedFontFamily ( final String  name  ) 

Set the family name of the selected font.

Parameters:
name the family name of the selected font.
void edu.princeton.wordnet.browser.component.JFontChooser.setSelectedFontSize ( final int  size  ) 

Set the size of the selected font.

Parameters:
size the size of the selected font
See also:
getSelectedFontSize
void edu.princeton.wordnet.browser.component.JFontChooser.setSelectedFontStyle ( final int  style  ) 

Set the style of the selected font.

Parameters:
style the size of the selected font. Font.PLAIN, Font.BOLD, Font.ITALIC, or Font.BOLD|Font.ITALIC.
See also:
java.awt.Font.PLAIN
java.awt.Font.BOLD
java.awt.Font.ITALIC
getSelectedFontStyle
int edu.princeton.wordnet.browser.component.JFontChooser.showDialog ( final Component  parent  ) 

Show font selection dialog.

Parameters:
parent Dialog's Parent component.
Returns:
OK_OPTION, CANCEL_OPTION or ERROR_OPTION
See also:
OK_OPTION
CANCEL_OPTION
ERROR_OPTION
void edu.princeton.wordnet.browser.component.JFontChooser.updateSampleFont (  )  [protected]

Update sample


Member Data Documentation

Return value from showDialog().

See also:
showDialog

Dialog result value

Return value from showDialog().

See also:
showDialog

Return value from showDialog().

See also:
showDialog

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations
Generated on Tue May 25 16:43:51 2010 for WordNetScope by  doxygen 1.6.3