Package adams.gui.goe
Class FontEditor
- java.lang.Object
-
- java.beans.PropertyEditorSupport
-
- adams.gui.goe.AbstractPropertyEditorSupport
-
- adams.gui.goe.FontEditor
-
- All Implemented Interfaces:
HelpProvider
,CustomStringRepresentationHandler
,PropertyEditor
public class FontEditor extends AbstractPropertyEditorSupport implements CustomStringRepresentationHandler
A PropertyEditor for Font objects that lets the user select a font from the font dialog.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseButton
m_ButtonClose
the close button.protected BaseButton
m_ButtonOK
the OK button.protected FontChooserPanelWithPreview
m_fontChooserPanelWithPreview
The Font chooser used for selecting colors.-
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, EMPTY, m_ChosenOption, m_CustomEditor, m_WindowAdapter, NULL
-
-
Constructor Summary
Constructors Constructor Description FontEditor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JComponent
createCustomEditor()
Gets the custom editor component.Object
fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.String
getJavaInitializationString()
Returns a representation of the current property value as java source.protected void
initForDisplay()
Initializes the display of the value.void
paintValue(Graphics gfx, Rectangle box)
Paints a representation of the current Object.String
toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.-
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createTipText, createWindowAdapter, getChosenOption, getCustomEditor, getHelpDescription, getHelpIcon, getHelpTitle, getHelpURL, getParentDialog, getParentFrame, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
-
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
-
-
-
-
Field Detail
-
m_fontChooserPanelWithPreview
protected FontChooserPanelWithPreview m_fontChooserPanelWithPreview
The Font chooser used for selecting colors.
-
m_ButtonOK
protected BaseButton m_ButtonOK
the OK button.
-
m_ButtonClose
protected BaseButton m_ButtonClose
the close button.
-
-
Method Detail
-
toCustomStringRepresentation
public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.- Specified by:
toCustomStringRepresentation
in interfaceCustomStringRepresentationHandler
- Parameters:
obj
- the object to turn into a string- Returns:
- the string representation
-
fromCustomStringRepresentation
public Object fromCustomStringRepresentation(String str)
Returns an object created from the custom string representation.- Specified by:
fromCustomStringRepresentation
in interfaceCustomStringRepresentationHandler
- Parameters:
str
- the string to turn into an object- Returns:
- the object
-
getJavaInitializationString
public String getJavaInitializationString()
Returns a representation of the current property value as java source.- Specified by:
getJavaInitializationString
in interfacePropertyEditor
- Overrides:
getJavaInitializationString
in classPropertyEditorSupport
- Returns:
- always "null"
-
createCustomEditor
protected JComponent createCustomEditor()
Gets the custom editor component.- Specified by:
createCustomEditor
in classAbstractPropertyEditorSupport
- Returns:
- a value of type 'Component'
-
initForDisplay
protected void initForDisplay()
Initializes the display of the value.- Overrides:
initForDisplay
in classAbstractPropertyEditorSupport
-
paintValue
public void paintValue(Graphics gfx, Rectangle box)
Paints a representation of the current Object.- Specified by:
paintValue
in interfacePropertyEditor
- Overrides:
paintValue
in classPropertyEditorSupport
- Parameters:
gfx
- the graphics context to usebox
- the area we are allowed to paint into
-
-