ccs.utils
Class FontDialog

java.lang.Object
  extended by ccs.utils.FontDialog
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, javax.swing.event.ListSelectionListener

public class FontDialog
extends java.lang.Object
implements javax.swing.event.ChangeListener, javax.swing.event.ListSelectionListener

Simple dialog which allows the user to pick a font from the selection the system offers.

Author:
wrd

Constructor Summary
FontDialog(java.awt.Frame parent, java.lang.String title)
          Creates new FontDialog.
 
Method Summary
 java.awt.Font getResult()
          After show has returned, returns the result of the dialog.
 void setWorkingFont(java.awt.Font f)
          Set the working font.
 void show()
          Shows the dialog, modally.
 void stateChanged(javax.swing.event.ChangeEvent e)
          Undocumented.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          Undocumented.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontDialog

public FontDialog(java.awt.Frame parent,
                  java.lang.String title)
Creates new FontDialog. The dialog is always modal. Use show to actually execute the dialog.

Method Detail

setWorkingFont

public void setWorkingFont(java.awt.Font f)
Set the working font. The dialog will be preset to this font.


getResult

public java.awt.Font getResult()
After show has returned, returns the result of the dialog. The return is null if the dialog was cancelled.

Returns:
The result.

show

public void show()
Shows the dialog, modally. The app will block until the user closes the dialog.


stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Undocumented.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Undocumented.

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener