public class ASTStyle
extends java.lang.Object
Defines the fonts and other miscellaneous items that are used for the programs throughout the book. Style settings are collected here to ensure uniformity across all the programs. With JavaFX (rather than Swing), most of these items would normally go into a style sheet.
Copyright (c) 2018
Modifier and Type | Class and Description |
---|---|
static class |
ASTStyle.GUIFocusTraversalPolicy
Create a focus traversal policy for the GUI components that should be
traversed when the tab key is pressed.
|
Modifier and Type | Field and Description |
---|---|
static java.awt.Font |
ABOUTAUTHOR_FONT
Font to use for the Author section of the About box
|
static java.awt.Font |
ABOUTBOOKTITLE_BOLDFONT
Font to use for the Book Title in the About box
|
static java.awt.Font |
ABOUTBTN_FONT
Font to use for the About box buttons
|
static java.awt.Font |
ABOUTCHAPTITLE_BOLDFONT
Font to use for the Chapter Title section of the About box
|
static java.awt.Font |
ABOUTCOPYRIGHT_FONT
Font to use for the Copyright section of the About box
|
static java.awt.Font |
ABOUTEDITION_BOLDFONT
Font to use for the book Edition in the About box.
|
static java.awt.Font |
ABOUTVERSION_FONT
Font to use for the Version number in the About box
|
static java.awt.Color |
BOOK_TITLE_BKG
Color to use for book title background
|
static java.awt.Font |
BOOK_TITLE_BOLDFONT
Font for the Book Title in the Book Title panel of a GUI
|
static java.awt.Color |
BOOK_TITLE_COLOR
Color to use for the Book Title in the Book Title panel of a GUI
|
static java.awt.Font |
BTN_FONT
Font for the buttons a user will click in the GUI
|
static java.awt.Font |
CBOX_FONT
Font for text in the GUI checkboxes
|
static java.awt.Font |
CBOX_FONT_SMALL
Small font for text in the GUI checkboxes
|
static java.lang.String |
decDegFormat
decimal degrees
|
static java.lang.String |
decHoursFormat
decimal hours
|
static java.lang.String |
epochFormat
Format for displaying the Epoch
|
static java.awt.Font |
ERRMSG_BOLDFONT
Font for the error message text.
|
static java.awt.Font |
ERRMSG_BUTTON_FONT
Font for the 'OK' button in the error message window.
|
static java.awt.Font |
FW_OUT_TEXT_FONT
Font for the scrollable text area when a fixed width font is needed
|
static java.lang.String |
genFloatFormat
General format for real numbers
|
static java.lang.String |
genFloatFormat8
Extra digits for general format for real numbers
|
static java.lang.String |
JDFormat
Julian day number format
|
static java.lang.String |
latlonFormat
latitude/longitude format
|
static java.awt.Font |
MENU_FONT
Font to use for menus
|
static java.lang.String |
mVFormat
Format for visual magnitude
|
static java.awt.Font |
OUT_TEXT_FONT
Font for the text written to a scrollable text area when a proportional font is needed
|
static java.awt.Font |
RADBTN_FONT
Font for text in the GUI radio buttons
|
static java.awt.Font |
RADBTN_FONT_SMALL
Small font for text in the GUI radio buttons
|
static java.lang.String |
temperatureFormat
Temperature (C and F)
|
static java.awt.Font |
TEXT_BOLDFONT
Bold font for labels and other test to show the user in the GUI
|
static java.awt.Font |
TEXT_FONT
Plain font for labels and other text to show the user in the GUI
|
Constructor and Description |
---|
ASTStyle() |
Modifier and Type | Method and Description |
---|---|
static void |
setASTStyle()
Sets the look and feel to be whatever is the standard for the underlying OS.
|
static void |
setContainerFonts(java.awt.Component[] comp,
java.awt.Font font)
Sets the fonts used for an arbitrary container.
|
public static final java.awt.Font BOOK_TITLE_BOLDFONT
public static final java.awt.Color BOOK_TITLE_COLOR
public static final java.awt.Color BOOK_TITLE_BKG
public static final java.awt.Font MENU_FONT
public static final java.awt.Font BTN_FONT
public static final java.awt.Font TEXT_FONT
public static final java.awt.Font TEXT_BOLDFONT
public static final java.awt.Font CBOX_FONT
public static final java.awt.Font CBOX_FONT_SMALL
public static final java.awt.Font RADBTN_FONT
public static final java.awt.Font RADBTN_FONT_SMALL
public static final java.awt.Font OUT_TEXT_FONT
public static final java.awt.Font FW_OUT_TEXT_FONT
public static final java.awt.Font ERRMSG_BOLDFONT
public static final java.awt.Font ERRMSG_BUTTON_FONT
public static final java.awt.Font ABOUTBTN_FONT
public static final java.awt.Font ABOUTEDITION_BOLDFONT
public static final java.awt.Font ABOUTCOPYRIGHT_FONT
public static final java.awt.Font ABOUTAUTHOR_FONT
public static final java.awt.Font ABOUTCHAPTITLE_BOLDFONT
public static final java.awt.Font ABOUTVERSION_FONT
public static final java.awt.Font ABOUTBOOKTITLE_BOLDFONT
public static final java.lang.String mVFormat
public static final java.lang.String decDegFormat
public static final java.lang.String decHoursFormat
public static final java.lang.String temperatureFormat
public static final java.lang.String JDFormat
public static final java.lang.String latlonFormat
public static final java.lang.String epochFormat
public static final java.lang.String genFloatFormat
public static final java.lang.String genFloatFormat8
public static void setASTStyle()
public static void setContainerFonts(java.awt.Component[] comp, java.awt.Font font)
This method is specifically intended for the JFileChooser dialog because the UIManager doesn't set all of its fonts. However, note that this is a generic method that will set the fonts for any container, not just a JFileChooser dialog. An example invocation is
setContainerFonts(fc.getComponents(),ASTStyle.TEXT_FONT);
where fc is a JFileChooser instance.
comp
- components in the container to be setfont
- font to use