JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.swing
Class JCFontChooserPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.util.swing.JCFontChooser
                          |
                          +--com.klg.jclass.util.swing.JCFontChooserPane
All Implemented Interfaces:
ActionListener, EventListener, FocusListener, ImageObserver, ListSelectionListener, MenuContainer, Serializable

public class JCFontChooserPane
extends JCFontChooser
implements ActionListener, FocusListener, ListSelectionListener, Serializable

JCFontChooserPane provides a pane of controls designed to allow a user to manipulate and select a font. It is suitable for use in a tab pane or a dialog window.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int ALL
          The all styles support constant.
static int BOLD
          The bold style support constant.
protected  JCheckBox boldCheckbox
           
protected  JList fontNameList
           
protected  JTextField fontNameTextField
           
protected  JList fontSizeList
           
protected  JTextField fontSizeTextField
           
static int ITALIC
          The italic style support constant.
protected  JCheckBox italicCheckbox
           
static int NONE
          The no style support constant.
protected  int styleControls
           
protected  JPanel stylePanel
           
protected  boolean toolTipEnabled
           
static int UNDERLINE
          The underline style support constant.
protected  JCheckBox underlineCheckbox
           
 
Fields inherited from class com.klg.jclass.util.swing.JCFontChooser
oldFont, oldUnderline
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCFontChooserPane()
          Creates a font chooser pane with default initial font.
JCFontChooserPane(Font font)
          Creates a font chooser pane with a specified initial font.
JCFontChooserPane(Font font, boolean underline)
          Creates a font chooser pane with a specified initial font and underline.
JCFontChooserPane(String name, int style, int size, boolean underline)
          Creates a font chooser pane with a specified initial font and underline.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Implementation for the ActionListener.
protected  void fireJCFontEvent(int event)
          Fires the font changing and font changed events.
 void focusGained(FocusEvent e)
          Implementation for the FocusListener.
 void focusLost(FocusEvent e)
           
 String getAbout()
          Returns vendor information.
 int getStyleControls()
          Gets the font style support variable.
protected  void init()
          Initializes the component.
 boolean isToolTipEnabled()
          Gets the tool tips text enabled indication.
protected  void processFontSizeTextChange()
          Helper method that processes font size text field changes.
 void setAbout(String s)
          Provided for Beans property editors - has no effect.
protected  void setFontChooserPane()
          Sets the UI.
 void setNameList(String[] nameList)
          Sets the font name list.
 void setSelectedFont(Font font)
          Sets the selected font.
 void setSelectedFont(Font font, boolean underline)
          Sets the selected font.
 void setSelectedFont(String name, int style, int size, boolean underline)
          Sets the selected font.
 void setStyleControls(int controls)
          Sets the font style support variable.
 void setToolTipEnabled(boolean toolTipEnabled)
          Sets the tool tips text enabled indication.If enabled (the default setting), the parts of the fontchooserpane will have individual tooltips suggesting their purpose.
static Font showDialog(Component component, String title, int controls, Font initialFont)
          Shows a modal font-chooser dialog and blocks until the dialog is hidden.
protected  void updateControls()
          Updates the dialog controls.
protected  void updateSamplePanel()
          Updates the sample text area.
 void valueChanged(ListSelectionEvent e)
          Implementation for the ListSelectionListener.
 
Methods inherited from class com.klg.jclass.util.swing.JCFontChooser
addJCFontListener, fireJCFontChangedEvent, fireJCFontChangingEvent, getFontName, getFontSize, getNameList, getSelectedFont, getSizeList, isBold, isItalic, isUnderline, isUnderline, removeJCFontListener, setBold, setFontName, setFontSize, setFontValues, setFontValues, setItalic, setNameList, setOldFont, setUnderline, setUnderline
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
The no style support constant.

See Also:
Constant Field Values

BOLD

public static final int BOLD
The bold style support constant.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
The italic style support constant.

See Also:
Constant Field Values

UNDERLINE

public static final int UNDERLINE
The underline style support constant.

See Also:
Constant Field Values

ALL

public static final int ALL
The all styles support constant.

See Also:
Constant Field Values

fontNameTextField

protected JTextField fontNameTextField

fontNameList

protected JList fontNameList

fontSizeTextField

protected JTextField fontSizeTextField

fontSizeList

protected JList fontSizeList

boldCheckbox

protected JCheckBox boldCheckbox

italicCheckbox

protected JCheckBox italicCheckbox

underlineCheckbox

protected JCheckBox underlineCheckbox

stylePanel

protected JPanel stylePanel

toolTipEnabled

protected boolean toolTipEnabled

styleControls

protected int styleControls
Constructor Detail

JCFontChooserPane

public JCFontChooserPane()
Creates a font chooser pane with default initial font.


JCFontChooserPane

public JCFontChooserPane(Font font)
Creates a font chooser pane with a specified initial font.

Parameters:
font - the initial font

JCFontChooserPane

public JCFontChooserPane(Font font,
                         boolean underline)
Creates a font chooser pane with a specified initial font and underline.

Parameters:
font - the initial font
underline - true if underline is on

JCFontChooserPane

public JCFontChooserPane(String name,
                         int style,
                         int size,
                         boolean underline)
Creates a font chooser pane with a specified initial font and underline.

Parameters:
name - the font name
style - the style constant for the font
size - the point size of the font
underline - true if underline is on
Method Detail

init

protected void init()
Initializes the component.


setNameList

public void setNameList(String[] nameList)
Sets the font name list.

Overrides:
setNameList in class JCFontChooser
Parameters:
nameList - array of font names

setFontChooserPane

protected void setFontChooserPane()
Sets the UI.


updateSamplePanel

protected void updateSamplePanel()
Updates the sample text area.


updateControls

protected void updateControls()
Updates the dialog controls.


setAbout

public void setAbout(String s)
Provided for Beans property editors - has no effect.

Parameters:
s -

getAbout

public String getAbout()
Returns vendor information.

Returns:
vendor information

setStyleControls

public void setStyleControls(int controls)
Sets the font style support variable.

Parameters:
controls -

getStyleControls

public int getStyleControls()
Gets the font style support variable.

Returns:
font style support variable

setToolTipEnabled

public void setToolTipEnabled(boolean toolTipEnabled)
Sets the tool tips text enabled indication.If enabled (the default setting), the parts of the fontchooserpane will have individual tooltips suggesting their purpose. Setting the toolTipText for the JCFontChooserPane after this method is called, will make the general fontchooserpane tooltip enabled, in spite of this setting.

Parameters:
toolTipEnabled - true to enable

isToolTipEnabled

public boolean isToolTipEnabled()
Gets the tool tips text enabled indication.

Returns:
tool tips text enabled

actionPerformed

public void actionPerformed(ActionEvent e)
Implementation for the ActionListener.

Specified by:
actionPerformed in interface ActionListener
Parameters:
e -

focusGained

public void focusGained(FocusEvent e)
Implementation for the FocusListener.

Specified by:
focusGained in interface FocusListener
Parameters:
e -

focusLost

public void focusLost(FocusEvent e)
Specified by:
focusLost in interface FocusListener

valueChanged

public void valueChanged(ListSelectionEvent e)
Implementation for the ListSelectionListener.

Specified by:
valueChanged in interface ListSelectionListener
Parameters:
e -

processFontSizeTextChange

protected void processFontSizeTextChange()
Helper method that processes font size text field changes.


fireJCFontEvent

protected void fireJCFontEvent(int event)
Fires the font changing and font changed events.

Parameters:
event - the font change event

setSelectedFont

public void setSelectedFont(String name,
                            int style,
                            int size,
                            boolean underline)
Sets the selected font.

Overrides:
setSelectedFont in class JCFontChooser
Parameters:
name - the font name
style - the style constant for the font
size - the point size of the font
underline - true if underline is on

setSelectedFont

public void setSelectedFont(Font font,
                            boolean underline)
Sets the selected font.

Overrides:
setSelectedFont in class JCFontChooser
Parameters:
font - the selected font
underline - true if underline is on

setSelectedFont

public void setSelectedFont(Font font)
Sets the selected font.

Overrides:
setSelectedFont in class JCFontChooser
Parameters:
font - the selected font

showDialog

public static Font showDialog(Component component,
                              String title,
                              int controls,
                              Font initialFont)
Shows a modal font-chooser dialog and blocks until the dialog is hidden.

Parameters:
component -
controls -
initialFont -
title -
Returns:

Copyright © 2004 Quest Software Inc..
All rights reserved.