adams.gui.goe
Class PdfFontEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by adams.gui.goe.AbstractPropertyEditorSupport
          extended by adams.gui.goe.PdfFontEditor
All Implemented Interfaces:
CustomStringRepresentationHandler, PropertyEditor

public class PdfFontEditor
extends AbstractPropertyEditorSupport
implements CustomStringRepresentationHandler

A PropertyEditor for iText Font objects that lets the user select a font from the font dialog.

Version:
$Revision: 4943 $
Author:
FracPete (fracpete at waikato dot ac dot nz)

Field Summary
protected  JButton m_ButtonClose
          the close button.
protected  JButton m_ButtonOK
          the OK button.
protected  PdfFontChooserPanel m_FontChooserPanel
          The Font chooser used for selecting colors.
 
Fields inherited from class adams.gui.goe.AbstractPropertyEditorSupport
APPROVE_OPTION, CANCEL_OPTION, m_ChosenOption, m_CustomEditor, m_WindowAdapter
 
Constructor Summary
PdfFontEditor()
           
 
Method Summary
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.
static String toString(AbstractOption option, Object object)
          Returns the color as string.
static Object valueOf(AbstractOption option, String str)
          Returns a color generated from the string.
 
Methods inherited from class adams.gui.goe.AbstractPropertyEditorSupport
addWindowAdapter, cleanUp, closeDialog, createPopup, createWindowAdapter, getChosenOption, getCustomEditor, initialize, isPaintable, resetChosenOption, setValue, supportsCustomEditor
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getAsText, getSource, getTags, getValue, removePropertyChangeListener, setAsText, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_FontChooserPanel

protected PdfFontChooserPanel m_FontChooserPanel
The Font chooser used for selecting colors.


m_ButtonOK

protected JButton m_ButtonOK
the OK button.


m_ButtonClose

protected JButton m_ButtonClose
the close button.

Constructor Detail

PdfFontEditor

public PdfFontEditor()
Method Detail

toString

public static String toString(AbstractOption option,
                              Object object)
Returns the color as string.

Parameters:
option - the current option
object - the color object to convert
Returns:
the generated string

valueOf

public static Object valueOf(AbstractOption option,
                             String str)
Returns a color generated from the string.

Parameters:
option - the current option
str - the string to convert to a color
Returns:
the generated color

toCustomStringRepresentation

public String toCustomStringRepresentation(Object obj)
Returns a custom string representation of the object.

Specified by:
toCustomStringRepresentation in interface CustomStringRepresentationHandler
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 interface CustomStringRepresentationHandler
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 interface PropertyEditor
Overrides:
getJavaInitializationString in class PropertyEditorSupport
Returns:
always "null"

createCustomEditor

protected JComponent createCustomEditor()
Gets the custom editor component.

Specified by:
createCustomEditor in class AbstractPropertyEditorSupport
Returns:
a value of type 'Component'

initForDisplay

protected void initForDisplay()
Initializes the display of the value.

Overrides:
initForDisplay in class AbstractPropertyEditorSupport

paintValue

public void paintValue(Graphics gfx,
                       Rectangle box)
Paints a representation of the current Object.

Specified by:
paintValue in interface PropertyEditor
Overrides:
paintValue in class PropertyEditorSupport
Parameters:
gfx - the graphics context to use
box - the area we are allowed to paint into


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.