edu.rice.cs.drjava.ui.config
Class FontOptionComponent

java.lang.Object
  |
  +--edu.rice.cs.drjava.ui.config.OptionComponent
        |
        +--edu.rice.cs.drjava.ui.config.FontOptionComponent

public class FontOptionComponent
extends OptionComponent

The Graphical form of a FontOption.

Version:
$Id: FontOptionComponent.java,v 1.6 2002/09/02 21:24:13 csreis Exp $

Field Summary
private  JButton _button
           
private  Font _currentFont
           
private  JTextField _fontField
           
private  Font _newFont
           
private  JPanel _panel
           
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_label, _option, _parent
 
Constructor Summary
FontOptionComponent(FontOption opt, String text, Frame parent)
           
 
Method Summary
private  void _updateField(Font f)
          Updates the font field to display the given font.
 void chooseFont()
          Shows a custom font chooser dialog to pick a new font.
 JComponent getComponent()
          Return's this OptionComponent's configurable component.
 void setValue(Font value)
          Displays the given value.
 void setValue(Object x0)
          Sets the value that is currently displayed by this component.
 boolean updateConfig()
          Updates the config object with the new setting.
 
Methods inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
getLabel, getLabelText, getOption, resetToCurrent, resetToDefault, showErrorMessage, showErrorMessage
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_button

private JButton _button

_fontField

private JTextField _fontField

_panel

private JPanel _panel

_currentFont

private Font _currentFont

_newFont

private Font _newFont
Constructor Detail

FontOptionComponent

public FontOptionComponent(FontOption opt,
                           String text,
                           Frame parent)
Method Detail

_updateField

private void _updateField(Font f)
Updates the font field to display the given font.

getComponent

public JComponent getComponent()
Return's this OptionComponent's configurable component.
Overrides:
getComponent in class OptionComponent

chooseFont

public void chooseFont()
Shows a custom font chooser dialog to pick a new font.

updateConfig

public boolean updateConfig()
Updates the config object with the new setting.
Overrides:
updateConfig in class OptionComponent
Returns:
true if the new value is set successfully

setValue

public void setValue(Font value)
Displays the given value.

setValue

public void setValue(Object x0)
Description copied from class: OptionComponent
Sets the value that is currently displayed by this component.
Overrides:
setValue in class OptionComponent