|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.LookAndFeelTools
Class LookAndFeelTools contains several static methods
that assist in using the Java look and feel facilities.
Class LookAndFeelTools cannot be instantiated.
In 2.6.0, we needed to supply a workaround to a bug in Java 6. If
you are interested, look up the source and see the comments in the
method adjustAllDefaultFontSizes.
| Field Summary | |
private static int |
MAX_ADJUSTMENT
The maximum font size adjustment shown in the look and feel dialog. |
static float |
MINIMUM_NET_FONT_SIZE_ADJUSTMENT
The lower bound for the net font size adjustment. |
private static float |
netFontSizeAdjustment
The net font size adjustment made after one or more calls of these tools. |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
private |
LookAndFeelTools()
Private constructor to prevent instantiation. |
| Method Summary | |
static void |
adjustAllDefaultFontSizes(float delta)
Adjusts the font size of all default fonts by adding the given delta to the current font size of each font. |
static String[] |
getInstalledLookAndFeelClassNames()
Returns the array of class names of the installed look and feel entities. |
static String[] |
getInstalledLookAndFeelNames()
Returns the array of short names of the installed look and feel entities. |
static float |
getNetFontSizeAdjustment()
Returns the net font size adjustment to the look and feel fonts after one or more calls to the tools in this package. |
static void |
setNetFontSizeAdjustment(float delta)
Sets the net font size adjustment to the look and feel fonts to the given delta. |
static void |
showSelectLookAndFeelDialog()
Displays a dialog that permits the user to select the look and feel from among the look and feel options that are currently installed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final int MAX_ADJUSTMENT
private static float netFontSizeAdjustment
public static final float MINIMUM_NET_FONT_SIZE_ADJUSTMENT
| Constructor Detail |
private LookAndFeelTools()
| Method Detail |
public static void showSelectLookAndFeelDialog()
Displays a dialog that permits the user to select the look and feel from among the look and feel options that are currently installed.
In addition, permits the user to adjust the font size of each default font by a fixed amount specified by a sequence of constants provided in the dialog.
This method must be called before any GUI objects are displayed on
screen. Therefore, it is best to make the following code the first
line of the main method that launches the program:
LookAndFeelTools.showSelectLookAndFeelDialog();
public static String[] getInstalledLookAndFeelNames()
public static String[] getInstalledLookAndFeelClassNames()
public static void adjustAllDefaultFontSizes(float delta)
Adjusts the font size of all default fonts by adding the given delta to the current font size of each font.
The method recognizes a default font by looking for the String "font"
in each key of a UIDefaults object.
This method prevents the net font size adjustment obtained from one or more calls to the tools in this package from becoming less than the lower bound MINIMUM_NET_FONT_SIZE_ADJUSTMENT.
delta - the incremental change in font sizespublic static void setNetFontSizeAdjustment(float delta)
Sets the net font size adjustment to the look and feel fonts to the given delta.
delta - the absolute change in font sizespublic static float getNetFontSizeAdjustment()
Returns the net font size adjustment to the look and feel fonts after one or more calls to the tools in this package.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||