JComponentPack 1.5.0

com.zfqjava.swing
Class JFontChooser

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.zfqjava.swing.JFontChooser
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JFontChooser
extends JComponent
implements Accessible

JFontChooser provides a pane of controls designed to allow a user to manipulate and select a font.

Client Property:

NameValueDefault Value
JFontChooser.forContentType
  • text/plain
  • text/rtf
  • text/html
text/plain
JFontChooser.defaultEffectEnabled
  • Boolean.TRUE
  • Boolean.FALSE
Boolean.FALSE

See Also:
Serialized Form

Nested Class Summary
protected  class JFontChooser.AccessibleJFontChooser
          This class implements accessibility support for the JFontChooser class.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  AccessibleContext accessibleContext
           
static int CANCEL_OPTION
          Return value if cancel is chosen.
static int OK_OPTION
          Return value if ok is chosen.
 
Fields inherited from class javax.swing.JComponent
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
JFontChooser()
          Constructs a JFontChooser.
 
Method Summary
protected  JDialog createDialog(Component parent, String title, JFontChooser fontChooser, ActionListener okListener, ActionListener cancelListener)
          Creates the dialog for the JFontChooser.
 AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JFontChooser.
 Object[] getEffectSet()
          Returns the font effects which can be selected.
 Color getFontColor()
          Returns the current font color.
 Locale getFontLocale()
          Returns the current font locale.
 Object[] getSelectedEffects()
          Returns the selected font effects.
 Font getSelectedFont()
          Returns the selected font.
 FontChooserUI getUI()
          Gets the UI object which implements the L&F for this component.
 String getUIClassID()
          Returns a string that specifies the name of the L&F class that renders this component.
protected  String paramString()
          Returns a string representation of this JFontChooser.
 void setEffectSet(Object[] effects)
          Sets the font effects which can be selected.
 void setFontColor(Color fontColor)
          Sets the current font color.
 void setFontLocale(Locale fontLocale)
          Sets the current font locale.
 void setSelectedEffects(Object[] selectedEffects)
          Sets the selected font effects.
 void setSelectedFont(Font font)
          Sets the font to be selected.
 int showDialog(Component parent)
          Pops up a dialog contains the JFontChooser and parented to parent with the dialog having a default title.
 int showDialog(Component parent, String title)
          Pops up a dialog contains the JFontChooser and parented to parent with the dialog having a title title.
 void updateUI()
          Notification from the UIFactory that the L&F has changed.
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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

OK_OPTION

public static final int OK_OPTION
Return value if ok is chosen.

See Also:
Constant Field Values

CANCEL_OPTION

public static final int CANCEL_OPTION
Return value if cancel is chosen.

See Also:
Constant Field Values

accessibleContext

protected AccessibleContext accessibleContext
Constructor Detail

JFontChooser

public JFontChooser()
Constructs a JFontChooser.

See Also:
JFontChooser()
Method Detail

updateUI

public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JComponent
See Also:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
Returns a string that specifies the name of the L&F class that renders this component.

Overrides:
getUIClassID in class JComponent
Returns:
the string "FileChooserUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

getUI

public FontChooserUI getUI()
Gets the UI object which implements the L&F for this component.

Returns:
the FileChooserUI object that implements the FileChooserUI L&F

getSelectedFont

public Font getSelectedFont()
Returns the selected font.

Returns:
the selected font
See Also:
setSelectedFont(java.awt.Font)

setSelectedFont

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

Parameters:
font - the font to be selected
See Also:
getSelectedFont

setEffectSet

public void setEffectSet(Object[] effects)
Sets the font effects which can be selected.

Parameters:
effects - the font effects
See Also:
getEffectSet()

getEffectSet

public Object[] getEffectSet()
Returns the font effects which can be selected.

Returns:
the font effects
See Also:
setEffectSet(java.lang.Object[])

setSelectedEffects

public void setSelectedEffects(Object[] selectedEffects)
Sets the selected font effects.

Parameters:
selectedEffects - the selected font effects
See Also:
getSelectedEffects()

getSelectedEffects

public Object[] getSelectedEffects()
Returns the selected font effects.

Returns:
the selected font effects
See Also:
setSelectedEffects(java.lang.Object[])

setFontColor

public void setFontColor(Color fontColor)
Sets the current font color.

Parameters:
fontColor - the current font color
See Also:
getFontColor()

getFontColor

public Color getFontColor()
Returns the current font color.

Returns:
the current font color
See Also:
setFontColor(java.awt.Color)

setFontLocale

public void setFontLocale(Locale fontLocale)
Sets the current font locale.

Parameters:
fontLocale - the current font locale
See Also:
getFontLocale()

getFontLocale

public Locale getFontLocale()
Returns the current font locale.

Returns:
the current font localej
See Also:
setFontLocale(java.util.Locale)

showDialog

public int showDialog(Component parent)
Pops up a dialog contains the JFontChooser and parented to parent with the dialog having a default title.

Parameters:
parent - the parent of the dialog
See Also:
showDialog(java.awt.Component)

showDialog

public int showDialog(Component parent,
                      String title)
Pops up a dialog contains the JFontChooser and parented to parent with the dialog having a title title.

Parameters:
parent - the parent of the dialog
title - the title for the dialog
See Also:
showDialog(java.awt.Component)

createDialog

protected JDialog createDialog(Component parent,
                               String title,
                               JFontChooser fontChooser,
                               ActionListener okListener,
                               ActionListener cancelListener)
Creates the dialog for the JFontChooser.

Parameters:
parent - the parent of the dialog

paramString

protected String paramString()
Returns a string representation of this JFontChooser. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString in class JComponent
Returns:
a string representation of this JFontChooser

getAccessibleContext

public AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JFontChooser. For color choosers, the AccessibleContext takes the form of an AccessibleJFontChooser. A new AccessibleJFontChooser instance is created if necessary.

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
an AccessibleJFontChooser that serves as the AccessibleContext of this JFontChooser

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.