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

java.lang.Object
  extended by edu.rice.cs.drjava.ui.config.OptionComponent<java.awt.Font,javax.swing.JPanel>
      extended by edu.rice.cs.drjava.ui.config.FontOptionComponent
All Implemented Interfaces:
java.io.Serializable

public class FontOptionComponent
extends OptionComponent<java.awt.Font,javax.swing.JPanel>

The Graphical form of a FontOption.

Version:
$Id: FontOptionComponent.java 5232 2010-04-24 00:14:05Z mgricken $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
OptionComponent.ChangeListener
 
Field Summary
private  javax.swing.JButton _button
           
private  java.awt.Font _font
           
private  javax.swing.JTextField _fontField
           
private  javax.swing.JPanel _panel
           
 
Fields inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
_entireColumn, _guiComponent, _label, _labelText, _option, _parent
 
Constructor Summary
FontOptionComponent(FontOption opt, java.lang.String text, SwingFrame parent)
           
FontOptionComponent(FontOption opt, java.lang.String text, SwingFrame parent, java.lang.String description)
          Constructor that allows for a tooltip description.
 
Method Summary
private  void _updateField(java.awt.Font f)
          Updates the font field to display the given font.
 void chooseFont()
          Shows a custom font chooser dialog to pick a new font.
 void setDescription(java.lang.String description)
          Sets the tooltip description text for this option.
 void setValue(java.awt.Font value)
          Displays the given value.
 boolean updateConfig()
          Updates the config object with the new setting.
 
Methods inherited from class edu.rice.cs.drjava.ui.config.OptionComponent
addChangeListener, getComponent, getEntireColumn, getLabel, getLabelText, getOption, notifyChangeListeners, removeChangeListener, resetToCurrent, resetToDefault, setComponent, setEntireColumn, showErrorMessage, showErrorMessage, useEntireColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_button

private final javax.swing.JButton _button

_fontField

private final javax.swing.JTextField _fontField

_panel

private final javax.swing.JPanel _panel

_font

private volatile java.awt.Font _font
Constructor Detail

FontOptionComponent

public FontOptionComponent(FontOption opt,
                           java.lang.String text,
                           SwingFrame parent)

FontOptionComponent

public FontOptionComponent(FontOption opt,
                           java.lang.String text,
                           SwingFrame parent,
                           java.lang.String description)
Constructor that allows for a tooltip description.

Method Detail

setDescription

public void setDescription(java.lang.String description)
Sets the tooltip description text for this option.

Specified by:
setDescription in class OptionComponent<java.awt.Font,javax.swing.JPanel>
Parameters:
description - the tooltip text

_updateField

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


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.

Specified by:
updateConfig in class OptionComponent<java.awt.Font,javax.swing.JPanel>
Returns:
true if the new value is set successfully

setValue

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

Specified by:
setValue in class OptionComponent<java.awt.Font,javax.swing.JPanel>