|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.swing.LookAndFeel
public class LookAndFeel
Swing Look and Feel.
Swing allows changing the "skin" or "look and feel" of windows on the fly. The methods here support a variety of built-in and third-party skins.
Nested Class Summary | |
---|---|
static class |
LookAndFeel.ExtendedLookAndFeelInfo
|
Field Summary | |
---|---|
protected static java.lang.String |
lookAndFeelDirectory
|
static LookAndFeel.ExtendedLookAndFeelInfo[] |
lookAndFeels
|
Constructor Summary | |
---|---|
LookAndFeel()
|
Method Summary | |
---|---|
static void |
changefontSizes(int fontDelta)
Changes the current font size for all user interface objects. |
static void |
enableAntialiasedFontRendering()
Enable antialiased font rendering in Java 5 or later. |
static java.lang.String |
getActiveLookAndFeel()
Get the class name of the currently active look and feel. |
static java.lang.Class |
getActiveLookAndFeelClass()
Get the class of the currently active look and feel. |
static LookAndFeel.ExtendedLookAndFeelInfo[] |
getExtendedLookAndFeelInfo()
Get list of available look and feels. |
static boolean |
isMetal()
Check if Metal look and feel is the current look and feel. |
static boolean |
isNativeLookAndFeel()
Checks if current Look and Feel is system default. |
static boolean |
setLookAndFeel(java.lang.String lookAndFeelName)
Sets a new Swing look and feel. |
static boolean |
setLookAndFeelByClassName(java.lang.String lookAndFeelClassName)
Sets a new Swing look and feel by class name. |
static boolean |
setLookAndFeelByClassName(java.lang.String lookAndFeelClassName,
boolean updateWindows)
Sets a new Swing look and feel by class name. |
static void |
setNativeLookAndFeel()
Sets Swing look and feel to native look and feel. |
static void |
setNiceLookAndFeel()
Sets Swing look and feel to a "nice" look and feel. |
static void |
updateLookAndFeel()
Updates look and feel of all existing windows to new look and feel. |
static void |
updateLookAndFeelOfChildWindows(java.awt.Window window)
Updates look and feel of child windows to new current look and feel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.lang.String lookAndFeelDirectory
public static LookAndFeel.ExtendedLookAndFeelInfo[] lookAndFeels
Constructor Detail |
---|
public LookAndFeel()
Method Detail |
---|
public static java.lang.Class getActiveLookAndFeelClass()
public static java.lang.String getActiveLookAndFeel()
public static LookAndFeel.ExtendedLookAndFeelInfo[] getExtendedLookAndFeelInfo()
The complete list of possible look and feels is pruned to those for which the implementing class actually exists.
public static boolean isMetal()
public static boolean setLookAndFeel(java.lang.String lookAndFeelName)
lookAndFeelName
- The name of the new look and feel.
This is converted to appropriate
class name and/or file name
references to load the selected
look and feel. If the selected
look and feel is not available,
the default system look and feel
is used instead.
Reflection is used to invoke the alternative look and feel classes so no errors will occur if the libraries implementing the new interfaces are missing from the client system. Some interfaces (e.g., "windows") only work on certain systems because of licensing issues.
public static void setNativeLookAndFeel()
public static void setNiceLookAndFeel()
We start by checking if the current look and feel is the native look and feel. If not, we leave it alone and do nothing here.
For Windows, a custom look and feel is used which adds font smoothing to the standard native look and feel.
For Mac OS X, the standard native look and feel is always used.
For other systems, we get the currently defined look and feel and see if it is the native look and feel. If so, we substitute the JGoodies Plastic 3D look and feel instead.
public static boolean isNativeLookAndFeel()
public static boolean setLookAndFeelByClassName(java.lang.String lookAndFeelClassName, boolean updateWindows)
lookAndFeelClassName
- The class name of the new look
and feel.updateWindows
- True to update all existing windows
to new look and feel.
public static boolean setLookAndFeelByClassName(java.lang.String lookAndFeelClassName)
lookAndFeelClassName
- Class name of new look and feel.
public static void updateLookAndFeel()
public static void updateLookAndFeelOfChildWindows(java.awt.Window window)
window
- The parent window whose children should be updated
to the new current look and feel. public static void changefontSizes(int fontDelta)
fontDelta
- The number of points by which to increase
or decrease all font sizes for user interface
objects. public static void enableAntialiasedFontRendering()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |