|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ka2ddo.yaac.gui.FontCache
public class FontCache
This is a place to keep the font choices used for some of the GUI rendering in YAAC.
Method Summary | |
---|---|
void |
addFontChangeListener(FontChangeListener l)
Register a listener to be informed when the user changes font selections. |
java.awt.Font |
getFont(java.lang.String category)
Get the font to use for a a particular GUI category. |
static FontCache |
getInstance()
Get a reference to the singleton FontCache |
java.util.Iterator<java.util.Map.Entry<java.lang.String,java.awt.Font>> |
iterator()
Create an Iterator for scanning through the configured Fonts. |
void |
removeFontChangeListener(FontChangeListener l)
Unregister a listener from being informed of user font selection changes. |
void |
setFont(java.lang.String category,
java.awt.Font f)
Set the font to use for the logical font category. |
static void |
setupJComponentForFonts(javax.swing.JComponent comp)
Helper method to configure an arbitrary JComponent to get its font updated when the user font choice is changed. |
static void |
setupJFrameForMenuFonts(javax.swing.JFrame frame)
Helper method for configuring a JFrame to use user-selected fonts for the menu bar. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static FontCache getInstance()
public java.awt.Font getFont(java.lang.String category)
category
- Font family name
public void setFont(java.lang.String category, java.awt.Font f)
category
- String name of font category, as taken from the constant Strings in the Font classf
- the Font to associate with the categorypublic java.util.Iterator<java.util.Map.Entry<java.lang.String,java.awt.Font>> iterator()
iterator
in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.awt.Font>>
public void addFontChangeListener(FontChangeListener l)
l
- FontChangeListener to registerpublic void removeFontChangeListener(FontChangeListener l)
l
- FontChangeListener to unregisterpublic static void setupJFrameForMenuFonts(javax.swing.JFrame frame)
frame
- JFrame to initialize with configured sanserif fontpublic static void setupJComponentForFonts(javax.swing.JComponent comp)
comp
- JComponent to associate with configured font
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |