|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.LookAndFeel javax.swing.plaf.basic.BasicLookAndFeel javax.swing.plaf.metal.MetalLookAndFeel
Implements the Java look and feel (codename: Metal).
For the keyboard keys defined for each component in this look and feel, see Component Keystroke Actions for the Java Look and Feel.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans
package.
Please see XMLEncoder
.
Nested Class Summary | |
private static class |
MetalLookAndFeel.FontActiveValue
FontActiveValue redirects to the appropriate metal theme method. |
private static class |
MetalLookAndFeel.MetalLazyValue
MetalLazyValue is a slimmed down version of ProxyLaxyValue .
|
Nested classes inherited from class javax.swing.plaf.basic.BasicLookAndFeel |
|
Field Summary | |
private static sun.awt.AppContext |
cachedAppContext
|
private static boolean |
checkedSystemFontSettings
Set to true first time we've checked swing.useSystemFontSettings. |
private static boolean |
checkedWindows
True if checked for windows yet. |
private static MetalTheme |
currentTheme
|
private static boolean |
isOnlyOneContext
|
private static boolean |
isWindows
True if running on Windows. |
private static boolean |
METAL_LOOK_AND_FEEL_INITED
|
private static boolean |
useSystemFonts
True indicates we should use system fonts, unless the developer has specified otherwise with Application.useSystemFontSettings. |
Fields inherited from class javax.swing.plaf.basic.BasicLookAndFeel |
|
Constructor Summary | |
MetalLookAndFeel()
|
Method Summary | |
protected void |
createDefaultTheme()
|
static ColorUIResource |
getAcceleratorForeground()
|
static ColorUIResource |
getAcceleratorSelectedForeground()
|
static ColorUIResource |
getBlack()
|
static ColorUIResource |
getControl()
|
static ColorUIResource |
getControlDarkShadow()
|
static ColorUIResource |
getControlDisabled()
|
static ColorUIResource |
getControlHighlight()
|
static ColorUIResource |
getControlInfo()
|
static ColorUIResource |
getControlShadow()
|
static ColorUIResource |
getControlTextColor()
|
static FontUIResource |
getControlTextFont()
|
private static MetalTheme |
getCurrentTheme()
|
UIDefaults |
getDefaults()
This method is called once by UIManager.setLookAndFeel to create the look and feel specific defaults table. |
String |
getDescription()
Return a one line description of this look and feel implementation, e.g. |
static ColorUIResource |
getDesktopColor()
|
static ColorUIResource |
getFocusColor()
|
static ColorUIResource |
getHighlightedTextColor()
|
String |
getID()
Return a string that identifies this look and feel. |
static ColorUIResource |
getInactiveControlTextColor()
|
static ColorUIResource |
getInactiveSystemTextColor()
|
static ColorUIResource |
getMenuBackground()
|
static ColorUIResource |
getMenuDisabledForeground()
|
static ColorUIResource |
getMenuForeground()
|
static ColorUIResource |
getMenuSelectedBackground()
|
static ColorUIResource |
getMenuSelectedForeground()
|
static FontUIResource |
getMenuTextFont()
|
String |
getName()
Return a short string that identifies this look and feel, e.g. |
static ColorUIResource |
getPrimaryControl()
|
static ColorUIResource |
getPrimaryControlDarkShadow()
|
static ColorUIResource |
getPrimaryControlHighlight()
|
static ColorUIResource |
getPrimaryControlInfo()
|
static ColorUIResource |
getPrimaryControlShadow()
|
static ColorUIResource |
getSeparatorBackground()
|
static ColorUIResource |
getSeparatorForeground()
|
static FontUIResource |
getSubTextFont()
|
boolean |
getSupportsWindowDecorations()
Returns true if the LookAndFeel returned
RootPaneUI instances support providing Window decorations
in a JRootPane .
|
static ColorUIResource |
getSystemTextColor()
|
static FontUIResource |
getSystemTextFont()
|
static ColorUIResource |
getTextHighlightColor()
|
static ColorUIResource |
getUserTextColor()
|
static FontUIResource |
getUserTextFont()
|
static ColorUIResource |
getWhite()
|
static ColorUIResource |
getWindowBackground()
|
static ColorUIResource |
getWindowTitleBackground()
|
static FontUIResource |
getWindowTitleFont()
|
static ColorUIResource |
getWindowTitleForeground()
|
static ColorUIResource |
getWindowTitleInactiveBackground()
|
static ColorUIResource |
getWindowTitleInactiveForeground()
|
protected void |
initClassDefaults(UIDefaults table)
Creates the mapping from UI class IDs to ComponentUI classes,
putting the ID-ComponentUI pairs
in the passed-in defaults table.
|
protected void |
initComponentDefaults(UIDefaults table)
|
private void |
initResourceBundle(UIDefaults table)
Initialize the defaults table with the name of the ResourceBundle used for getting localized defaults. |
protected void |
initSystemColorDefaults(UIDefaults table)
Load the SystemColors into the defaults table. |
boolean |
isNativeLookAndFeel()
If the underlying platform has a "native" look and feel, and this is an implementation of it, return true. |
boolean |
isSupportedLookAndFeel()
Return true if the underlying platform supports and or permits this look and feel. |
(package private) static boolean |
isWindows()
Returns true if running on Windows. |
void |
provideErrorFeedback(Component component)
Invoked when the user attempts an invalid operation, such as pasting into an uneditable JTextField
that has focus.
|
static void |
setCurrentTheme(MetalTheme theme)
|
private static boolean |
useHighContrastTheme()
Returns true if the high contrast theme should be used as the default theme. |
(package private) static boolean |
useSystemFonts()
Returns true if system fonts should be used, this is only useful for windows. |
Methods inherited from class javax.swing.plaf.basic.BasicLookAndFeel |
createAudioAction, getAudioActionMap, loadSystemColors, playSound |
Methods inherited from class javax.swing.LookAndFeel |
getDesktopPropertyValue, initialize, installBorder, installColors, installColorsAndFont, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, toString, uninitialize, uninstallBorder |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static boolean METAL_LOOK_AND_FEEL_INITED
private static MetalTheme currentTheme
private static boolean isOnlyOneContext
private static sun.awt.AppContext cachedAppContext
private static boolean checkedWindows
private static boolean isWindows
private static boolean checkedSystemFontSettings
private static boolean useSystemFonts
Constructor Detail |
public MetalLookAndFeel()
Method Detail |
static boolean isWindows()
static boolean useSystemFonts()
private static boolean useHighContrastTheme()
public String getName()
LookAndFeel
getName
in class LookAndFeel
public String getID()
LookAndFeel
getID
in class LookAndFeel
public String getDescription()
LookAndFeel
getDescription
in class LookAndFeel
public boolean isNativeLookAndFeel()
LookAndFeel
isNativeLookAndFeel
in class LookAndFeel
public boolean isSupportedLookAndFeel()
LookAndFeel
isSupportedLookAndFeel
in class LookAndFeel
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public boolean getSupportsWindowDecorations()
LookAndFeel
returned
RootPaneUI
instances support providing Window decorations
in a JRootPane
.
This implementation returns true, since it does support providing these border and window title pane decorations.
getSupportsWindowDecorations
in class LookAndFeel
JDialog.setDefaultLookAndFeelDecorated(boolean)
,
JFrame.setDefaultLookAndFeelDecorated(boolean)
,
JRootPane.setWindowDecorationStyle(int)
protected void initClassDefaults(UIDefaults table)
ComponentUI
classes,
putting the ID-ComponentUI
pairs
in the passed-in defaults table.
Each JComponent
class
specifies its own UI class ID string.
For example,
JButton
has the UI class ID "ButtonUI",
which this method maps to "javax.swing.plaf.metal.MetalButtonUI".
initClassDefaults
in class BasicLookAndFeel
BasicLookAndFeel.getDefaults()
,
JComponent.getUIClassID()
protected void initSystemColorDefaults(UIDefaults table)
initSystemColorDefaults
in class BasicLookAndFeel
private void initResourceBundle(UIDefaults table)
protected void initComponentDefaults(UIDefaults table)
initComponentDefaults
in class BasicLookAndFeel
protected void createDefaultTheme()
public UIDefaults getDefaults()
LookAndFeel
getDefaults
in class BasicLookAndFeel
public void provideErrorFeedback(Component component)
Invoked when the user attempts an invalid operation,
such as pasting into an uneditable JTextField
that has focus.
If the user has enabled visual error indication on the desktop, this method will flash the caption bar of the active window. The user can also set the property awt.visualbell=true to achieve the same results.
provideErrorFeedback
in class LookAndFeel
component
- Component the error occured in, may be
null indicating the error condition is
not directly associated with a
Component
.LookAndFeel.provideErrorFeedback(java.awt.Component)
public static void setCurrentTheme(MetalTheme theme)
private static MetalTheme getCurrentTheme()
public static FontUIResource getControlTextFont()
public static FontUIResource getSystemTextFont()
public static FontUIResource getUserTextFont()
public static FontUIResource getMenuTextFont()
public static FontUIResource getWindowTitleFont()
public static FontUIResource getSubTextFont()
public static ColorUIResource getDesktopColor()
public static ColorUIResource getFocusColor()
public static ColorUIResource getWhite()
public static ColorUIResource getBlack()
public static ColorUIResource getControl()
public static ColorUIResource getControlShadow()
public static ColorUIResource getControlDarkShadow()
public static ColorUIResource getControlInfo()
public static ColorUIResource getControlHighlight()
public static ColorUIResource getControlDisabled()
public static ColorUIResource getPrimaryControl()
public static ColorUIResource getPrimaryControlShadow()
public static ColorUIResource getPrimaryControlDarkShadow()
public static ColorUIResource getPrimaryControlInfo()
public static ColorUIResource getPrimaryControlHighlight()
public static ColorUIResource getSystemTextColor()
public static ColorUIResource getControlTextColor()
public static ColorUIResource getInactiveControlTextColor()
public static ColorUIResource getInactiveSystemTextColor()
public static ColorUIResource getUserTextColor()
public static ColorUIResource getTextHighlightColor()
public static ColorUIResource getHighlightedTextColor()
public static ColorUIResource getWindowBackground()
public static ColorUIResource getWindowTitleBackground()
public static ColorUIResource getWindowTitleForeground()
public static ColorUIResource getWindowTitleInactiveBackground()
public static ColorUIResource getWindowTitleInactiveForeground()
public static ColorUIResource getMenuBackground()
public static ColorUIResource getMenuForeground()
public static ColorUIResource getMenuSelectedBackground()
public static ColorUIResource getMenuSelectedForeground()
public static ColorUIResource getMenuDisabledForeground()
public static ColorUIResource getSeparatorBackground()
public static ColorUIResource getSeparatorForeground()
public static ColorUIResource getAcceleratorForeground()
public static ColorUIResource getAcceleratorSelectedForeground()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |