EchoPoint
1.0

echopoint
Class FontChooser

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.FontChooser
All Implemented Interfaces:
nextapp.echo.event.ActionListener, java.util.EventListener, MouseCursorable, ReflectionSetter, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class FontChooser
extends EchoPointComponent
implements nextapp.echo.event.ActionListener

See Also:
Serialized Form

Nested Class Summary
protected  class FontChooser.DefaultPreviewPanel
          The default preview pane
static class FontChooser.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String APPEARANCE_CHANGED_PROPERTY
           
static java.lang.String BORDER_COLOR_CHANGED_PROPERTY
           
static java.lang.String BORDER_SIZE_CHANGED_PROPERTY
           
protected  nextapp.echo.Color borderColor
           
protected  int borderSize
           
protected  boolean changeSelectFieldFonts
           
static nextapp.echo.Font DEFAULT_FONT
          the default font
static nextapp.echo.Insets DEFAULT_INSETS
           
protected  java.lang.String[] fntNames
           
protected  int[] fntSizes
           
protected  java.lang.String[] fntStyles
           
static java.lang.String FONT_NAMES_CHANGED_PROPERTY
          the public property change names
static java.lang.String FONT_SIZES_CHANGED_PROPERTY
           
protected  nextapp.echo.Insets insets
           
static java.lang.String INSETS_CHANGED_PROPERTY
           
static java.lang.String PREVIEW_PANEL_CHANGED_PROPERTY
           
protected  nextapp.echo.Component previewPanel
           
protected  nextapp.echo.SelectField selectFontNames
           
protected  nextapp.echo.SelectField selectFontSizes
           
protected  nextapp.echo.SelectField selectFontStyles
           
static java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
           
protected  FontSelectionModel selectionModel
           
protected  boolean showFontNames
           
protected  boolean showFontSizes
           
protected  boolean showFontStyles
           
static java.lang.String STYLE_BORDER_COLOR
          A style constant for the Border Color property.
static java.lang.String STYLE_BORDER_SIZE
          A style constant for the Border Size property.
static java.lang.String STYLE_CHANGE_SELECT_FIELD
          A style constant for the Change Select Field property.
static java.lang.String STYLE_INSETS
          A style constant for the Insets property.
static java.lang.String STYLE_SELECTED_FONT
          A style constant for the Selected Font property.
static java.lang.String TITLE_CHANGED_PROPERTY
           
protected  TitleBar titleBar
           
 
Fields inherited from class echopoint.EchoPointComponent
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.MouseCursorable
borderStyleSymbolics, CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI
 
Constructor Summary
FontChooser()
          Constructs a FontChooser with Color.WHITE selected
FontChooser(nextapp.echo.Font newSelectedFont)
          Constructs a FontChooser with newSelectedFont selected
 
Method Summary
 void actionPerformed(nextapp.echo.event.ActionEvent e)
          The FontChooser listens to its own SelectField events
 void addChangeListener(nextapp.echo.event.ChangeListener l)
          Adds a ChangeListener to the FontChooser.
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 nextapp.echo.Color getBorderColor()
           
 int getBorderSize()
           
 java.lang.String[] getFontNames()
           
 nextapp.echo.SelectField getFontNamesSelectField()
           
 int[] getFontSizes()
           
 nextapp.echo.SelectField getFontSizesSelectField()
           
 nextapp.echo.SelectField getFontStylesSelectField()
           
 nextapp.echo.Insets getInsets()
           
 nextapp.echo.Component getPreviewPanel()
           
 nextapp.echo.Font getSelectedFont()
           
 FontSelectionModel getSelectionModel()
           
 TitleBar getTitle()
           
 boolean isChangeSelectFieldFont()
           
 boolean isFontNamesShowing()
           
 boolean isFontSizesShowing()
           
 boolean isFontStylesShowing()
           
 void removeChangeListener(nextapp.echo.event.ChangeListener l)
          Removes a ChangeListener from this component.
protected  void reRegisterComponents(nextapp.echo.Component oldValue, nextapp.echo.Component newValue)
           
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setBorderColor(nextapp.echo.Color newBorderColor)
          Sets the border Color of the FontChooser.
 void setBorderSize(int newBorderSize)
          Sets the border size of the FontChooser.
 void setChangeSelectFieldFont(boolean newValue)
          Sets whether the font of SelectFields of the FontChooser.is will be changed to reflect the currently selected Font..
 void setEnabled(boolean newValue)
           
 void setFontNames(java.lang.String[] newValue)
          Sets the arrayu of Font Names used by the FontChooser
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.FONT_NAMES_CHANGED_PROPERTY
 void setFontNamesShowing(boolean newValue)
          Sets whether the Font Names SelectField of the FontChooser.is showing.
 void setFontSizes(int[] newValue)
          Sets the array of Font Sizes used by the FontChooser
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.FONT_SIZES_CHANGED_PROPERTY
 void setFontSizesShowing(boolean newValue)
          Sets whether the Font Sizes SelectField of the FontChooser.is showing.
 void setFontStylesShowing(boolean newValue)
          Sets whether the Font Styles SelectField of the FontChooser.is showing.
 void setInsets(nextapp.echo.Insets newValue)
          Sets the Insets used by the FontChooser
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.INSETS_CHANGED_PROPERTY
 void setPreviewPane(nextapp.echo.Component newPreviewPanel)
          Sets the Component used by the FontChooser as a preview panel.
 void setSelectedFont(nextapp.echo.Font newSelectedFont)
          Sets the currently selected Font of the FontChooser
This methods causes the underlying FontSelectionModel to change.
 void setSelectionModel(FontSelectionModel newModel)
          Sets the FontSelectionModel model used by the FontChooser.
 void setTitle(java.lang.String newTitleText)
          Sets the text of the title TitleBar used by the FontChooser.
 void setTitle(TitleBar newTitleBar)
          Sets the title used by the FontChooser.
 
Methods inherited from class echopoint.EchoPointComponent
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText, validate
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STYLE_BORDER_COLOR

public static final java.lang.String STYLE_BORDER_COLOR
A style constant for the Border Color property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_BORDER_SIZE

public static final java.lang.String STYLE_BORDER_SIZE
A style constant for the Border Size property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_CHANGE_SELECT_FIELD

public static final java.lang.String STYLE_CHANGE_SELECT_FIELD
A style constant for the Change Select Field property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_INSETS

public static final java.lang.String STYLE_INSETS
A style constant for the Insets property. Values of this key must be of type nextapp.echo.Insets.

See Also:
Constant Field Values

STYLE_SELECTED_FONT

public static final java.lang.String STYLE_SELECTED_FONT
A style constant for the Selected Font property. Values of this key must be of type nextapp.echo.Font.

See Also:
Constant Field Values

SELECTION_MODEL_CHANGED_PROPERTY

public static final java.lang.String SELECTION_MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

PREVIEW_PANEL_CHANGED_PROPERTY

public static final java.lang.String PREVIEW_PANEL_CHANGED_PROPERTY
See Also:
Constant Field Values

TITLE_CHANGED_PROPERTY

public static final java.lang.String TITLE_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_COLOR_CHANGED_PROPERTY

public static final java.lang.String BORDER_COLOR_CHANGED_PROPERTY
See Also:
Constant Field Values

BORDER_SIZE_CHANGED_PROPERTY

public static final java.lang.String BORDER_SIZE_CHANGED_PROPERTY
See Also:
Constant Field Values

INSETS_CHANGED_PROPERTY

public static final java.lang.String INSETS_CHANGED_PROPERTY
See Also:
Constant Field Values

DEFAULT_INSETS

public static final nextapp.echo.Insets DEFAULT_INSETS

borderColor

protected nextapp.echo.Color borderColor

borderSize

protected int borderSize

insets

protected nextapp.echo.Insets insets

previewPanel

protected nextapp.echo.Component previewPanel

selectionModel

protected FontSelectionModel selectionModel

APPEARANCE_CHANGED_PROPERTY

public static final java.lang.String APPEARANCE_CHANGED_PROPERTY
See Also:
Constant Field Values

FONT_NAMES_CHANGED_PROPERTY

public static final java.lang.String FONT_NAMES_CHANGED_PROPERTY
the public property change names

See Also:
Constant Field Values

FONT_SIZES_CHANGED_PROPERTY

public static final java.lang.String FONT_SIZES_CHANGED_PROPERTY
See Also:
Constant Field Values

DEFAULT_FONT

public static final nextapp.echo.Font DEFAULT_FONT
the default font


changeSelectFieldFonts

protected boolean changeSelectFieldFonts

fntNames

protected java.lang.String[] fntNames

fntSizes

protected int[] fntSizes

fntStyles

protected java.lang.String[] fntStyles

selectFontNames

protected nextapp.echo.SelectField selectFontNames

selectFontSizes

protected nextapp.echo.SelectField selectFontSizes

selectFontStyles

protected nextapp.echo.SelectField selectFontStyles

showFontNames

protected boolean showFontNames

showFontSizes

protected boolean showFontSizes

showFontStyles

protected boolean showFontStyles

titleBar

protected TitleBar titleBar
Constructor Detail

FontChooser

public FontChooser()
Constructs a FontChooser with Color.WHITE selected


FontChooser

public FontChooser(nextapp.echo.Font newSelectedFont)
Constructs a FontChooser with newSelectedFont selected

Method Detail

actionPerformed

public void actionPerformed(nextapp.echo.event.ActionEvent e)
The FontChooser listens to its own SelectField events

Specified by:
actionPerformed in interface nextapp.echo.event.ActionListener

addChangeListener

public void addChangeListener(nextapp.echo.event.ChangeListener l)
Adds a ChangeListener to the FontChooser.

Parameters:
l - The ChangeListener to be added.

applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Specified by:
applyStyle in interface MouseCursorable
Overrides:
applyStyle in class EchoPointComponent
See Also:
Component.applyStyle(nextapp.echo.Style)

getBorderColor

public nextapp.echo.Color getBorderColor()
Returns:
The Color of the FontChooser's border.

getBorderSize

public int getBorderSize()
Returns:
The size of the FontChooser's border.

getFontNames

public java.lang.String[] getFontNames()

getFontNamesSelectField

public nextapp.echo.SelectField getFontNamesSelectField()
Returns:
the Font Names SelectField of the FontChooser.

getFontSizes

public int[] getFontSizes()
Returns:
The array of Font Sizes used by the FontChooser.

getFontSizesSelectField

public nextapp.echo.SelectField getFontSizesSelectField()
Returns:
the Font Sizes SelectField of the FontChooser.

getFontStylesSelectField

public nextapp.echo.SelectField getFontStylesSelectField()
Returns:
the Font Styles SelectField of the FontChooser.

getInsets

public nextapp.echo.Insets getInsets()
Returns:
the Insets (margins) of the FontChooser.

getPreviewPanel

public nextapp.echo.Component getPreviewPanel()
Returns:
the preview paneComponent currently used by the FontChooser.

getSelectedFont

public nextapp.echo.Font getSelectedFont()

getSelectionModel

public FontSelectionModel getSelectionModel()
Returns:
the FontSelectionModel model of the FontChooser.

getTitle

public TitleBar getTitle()
Returns:
the title of the FontChooser.

isChangeSelectFieldFont

public boolean isChangeSelectFieldFont()
Returns:
true if the chaning the font select field will change the displayed font

isFontNamesShowing

public boolean isFontNamesShowing()

isFontSizesShowing

public boolean isFontSizesShowing()

isFontStylesShowing

public boolean isFontStylesShowing()

removeChangeListener

public void removeChangeListener(nextapp.echo.event.ChangeListener l)
Removes a ChangeListener from this component.

Parameters:
l - the ChangeListener to remove

reRegisterComponents

protected void reRegisterComponents(nextapp.echo.Component oldValue,
                                    nextapp.echo.Component newValue)

setBorderColor

public void setBorderColor(nextapp.echo.Color newBorderColor)
Sets the border Color of the FontChooser.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.BORDER_COLOR_CHANGED_PROPERTY


setBorderSize

public void setBorderSize(int newBorderSize)
Sets the border size of the FontChooser.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.BORDER_SIZE_CHANGED_PROPERTY


setChangeSelectFieldFont

public void setChangeSelectFieldFont(boolean newValue)
Sets whether the font of SelectFields of the FontChooser.is will be changed to reflect the currently selected Font..
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.APPEARANCE_CHANGED_PROPERTY


setFontNames

public void setFontNames(java.lang.String[] newValue)
Sets the arrayu of Font Names used by the FontChooser
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.FONT_NAMES_CHANGED_PROPERTY


setFontNamesShowing

public void setFontNamesShowing(boolean newValue)
Sets whether the Font Names SelectField of the FontChooser.is showing.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.APPEARANCE_CHANGED_PROPERTY


setFontSizes

public void setFontSizes(int[] newValue)
Sets the array of Font Sizes used by the FontChooser
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.FONT_SIZES_CHANGED_PROPERTY


setFontSizesShowing

public void setFontSizesShowing(boolean newValue)
Sets whether the Font Sizes SelectField of the FontChooser.is showing.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.APPEARANCE_CHANGED_PROPERTY


setFontStylesShowing

public void setFontStylesShowing(boolean newValue)
Sets whether the Font Styles SelectField of the FontChooser.is showing.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.APPEARANCE_CHANGED_PROPERTY


setInsets

public void setInsets(nextapp.echo.Insets newValue)
Sets the Insets used by the FontChooser
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.INSETS_CHANGED_PROPERTY


setPreviewPane

public void setPreviewPane(nextapp.echo.Component newPreviewPanel)
Sets the Component used by the FontChooser as a preview panel.
This Component should implement ChangeEventListener and then call addChangeListener to ensure it is notified of changes to the underlying ColorSelectionModel model.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.PREVIEW_PANEL_CHANGED_PROPERTY


setSelectedFont

public void setSelectedFont(nextapp.echo.Font newSelectedFont)
Sets the currently selected Font of the FontChooser
This methods causes the underlying FontSelectionModel to change.


setSelectionModel

public void setSelectionModel(FontSelectionModel newModel)
Sets the FontSelectionModel model used by the FontChooser.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.SELECTION_MODEL_CHANGED_PROPERTY


setTitle

public void setTitle(TitleBar newTitleBar)
Sets the title used by the FontChooser.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.TITLE_CHANGED_PROPERTY


setTitle

public void setTitle(java.lang.String newTitleText)
Sets the text of the title TitleBar used by the FontChooser.
This methods fires a PropertyChangeEvent with a getPropertyName() value of FontChooser.TITLE_CHANGED_PROPERTY


setEnabled

public void setEnabled(boolean newValue)
See Also:
Component.setEnabled(boolean)

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0