JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.swing
Class JCFontChooserBar

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

public class JCFontChooserBar
extends JCFontChooser
implements ActionListener, ItemListener

JCFontChooserBar provides a pane of controls designed to allow a user to manipulate and select a font. It is suitable for use in a JToolbar.

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  JToggleButton boldStyleButton
           
static int ITALIC
          The italic style support constant.
protected  JToggleButton italicStyleButton
           
protected  JComboBox nameCombobox
           
static int NONE
          The no style support constant.
protected  JComboBox sizeCombobox
           
protected  int styleControls
           
protected  boolean toolTipEnabled
           
static int UNDERLINE
          The underline style support constant.
protected  JToggleButton underlineStyleButton
           
 
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
JCFontChooserBar()
          Creates a font chooser bar with default initial font.
JCFontChooserBar(Font font)
          Creates a font chooser bar with a specified initial font.
JCFontChooserBar(Font font, boolean underline)
          Creates a font chooser bar with a specified initial font and underline.
JCFontChooserBar(String name, int style, int size, boolean underline)
          Creates a font chooser bar 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 event.
 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.
 void itemStateChanged(ItemEvent e)
          Implementation for the ItemListener.
 void setAbout(String s)
          Provided for Beans property editors - has no effect.
protected  void setFontChooserBar()
          Sets the UI.
protected  void setNameCombobox()
          Populates the font name combobox.
 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.
protected  void updateControls()
          Updates the control buttons.
 
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

nameCombobox

protected JComboBox nameCombobox

sizeCombobox

protected JComboBox sizeCombobox

boldStyleButton

protected JToggleButton boldStyleButton

italicStyleButton

protected JToggleButton italicStyleButton

underlineStyleButton

protected JToggleButton underlineStyleButton

styleControls

protected int styleControls

toolTipEnabled

protected boolean toolTipEnabled
Constructor Detail

JCFontChooserBar

public JCFontChooserBar()
Creates a font chooser bar with default initial font.


JCFontChooserBar

public JCFontChooserBar(Font font)
Creates a font chooser bar with a specified initial font.

Parameters:
font - the initial font

JCFontChooserBar

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

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

JCFontChooserBar

public JCFontChooserBar(String name,
                        int style,
                        int size,
                        boolean underline)
Creates a font chooser bar 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.


setNameCombobox

protected void setNameCombobox()
Populates the font name combobox.


setNameList

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

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

updateControls

protected void updateControls()
Updates the control buttons.


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

setFontChooserBar

protected void setFontChooserBar()
Sets the UI.


setToolTipEnabled

public void setToolTipEnabled(boolean toolTipEnabled)
Sets the tool tips text enabled indication.

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 -

itemStateChanged

public void itemStateChanged(ItemEvent e)
Implementation for the ItemListener.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
e -

fireJCFontEvent

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

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

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