|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ast.gui.FontControls
public class FontControls
FontControls add a series of controls for selecting from the available families of fonts and assigning a size and style.
This class assumes that it will be laying out its components using the standard GridBagLayouter.
Users of this class should implement the FontChangedListener interface to be informed when the selected font is updated.
Field Summary | |
---|---|
protected String |
currentFont
Selected font name |
protected int |
currentSize
Selected font size. |
protected int |
currentStyle
Selected font style. |
protected JComboBox |
fontBox
List of all available font families. |
protected EventListenerList |
listeners
|
protected JComboBox |
sizeBox
List of pre-selected sizes. |
protected JComboBox |
styleBox
List of possible styles. |
protected static int[] |
styleInts
Styles as indexed array. |
protected static String[] |
styleStrings
Styles as formatted string. |
Constructor Summary | |
---|---|
FontControls(GridBagLayouter layouter,
String postfix)
Construct an instance. |
Method Summary | |
---|---|
protected void |
addFonts()
Add all the available fonts. |
void |
addListener(FontChangedListener l)
Registers a listener who wants to be informed about font changes. |
protected void |
fireChanged()
Send FontChangedEvent event to all listeners. |
Font |
getSelectedFont()
Get the selected font. |
void |
setDefaults()
Set/reset interface to default values. |
void |
setFont(Font font)
Set the control to match a given font. |
protected void |
setFontName()
Set a new default font name from the value in the font name combobox. |
protected void |
setSize()
Set a new default font size from the value in the size combobox. |
protected void |
setStyle()
Set the font style from the value in the style combobox. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JComboBox styleBox
protected JComboBox sizeBox
protected JComboBox fontBox
protected String currentFont
protected int currentSize
protected int currentStyle
protected static final String[] styleStrings
protected static final int[] styleInts
protected EventListenerList listeners
Constructor Detail |
---|
public FontControls(GridBagLayouter layouter, String postfix)
Method Detail |
---|
public void setDefaults()
protected void addFonts()
protected void setFontName()
protected void setSize()
protected void setStyle()
public Font getSelectedFont()
public void setFont(Font font)
public void addListener(FontChangedListener l)
l
- the FontChangedListener listener.protected void fireChanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |