MetalTheme providing
the original look of the Java Look and Feel, code-named "Steel". Refer
to MetalLookAndFeel#setCurrentTheme for details on changing
the default theme.
All colors returned by DefaultMetalTheme are completely
opaque.
DefaultMetalTheme uses bold fonts for many controls. To make all
controls (with the exception of the internal frame title bars and
client decorated frame title bars) use plain fonts you can do either of
the following:
swing.boldMetal to
false. For example,
java -Dswing.boldMetal=false MyApp.
swing.boldMetal to
Boolean.FALSE. For example:
UIManager.put("swing.boldMetal", Boolean.FALSE);
swing.boldMetal, if set,
takes precedence over the system property of the same name. After
setting this defaults property you need to re-install
MetalLookAndFeel, as well as update the UI
of any previously created widgets. Otherwise the results are undefined.
The following illustrates how to do this:
// turn off bold fonts
UIManager.put("swing.boldMetal", Boolean.FALSE);
// re-install the Metal Look and Feel
UIManager.setLookAndFeel(new MetalLookAndFeel());
// Update the ComponentUIs for all Components. This
// needs to be invoked for all windows.
SwingUtilities.updateComponentTreeUI(rootComponent);
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 JavaBeans
has been added to the java.beans package.
Please see java..
MetalLookAndFeel, MetalLookAndFeel#setCurrentTheme
| Modifier and Type | Class and Description |
|---|---|
| private static class | DefaultMetalTheme.
FontDelegates add an extra level of indirection to obtaining fonts. |
| private static class | DefaultMetalTheme.
The WindowsFontDelegate uses DesktopProperties to obtain fonts. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String[] | defaultNames
System property names used to look up fonts. |
| private DefaultMetalTheme. | |
| private static final String[] | fontNames
Names of the fonts to use. |
| private static final int[] | fontSizes
Sizes for the fonts. |
| private static final int[] | fontStyles
Styles for the fonts. |
| private static final boolean | PLAIN_FONTS
Whether or not fonts should be plain. |
| private static final ColorUIResource | |
| private static final ColorUIResource | |
| private static final ColorUIResource | |
| private static final ColorUIResource | |
| private static final ColorUIResource | |
| private static final ColorUIResource |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FontUIResource | Returns: the control text fontImplements abstract javax. Returns the control text font. |
| pack-priv static String | |
| pack-priv static int | |
| pack-priv static int | |
| pack-priv static String | |
| private FontUIResource | |
| public FontUIResource | Returns: the menu text fontImplements abstract javax. Returns the menu text font. |
| public String | Returns: the name of this theme.Implements abstract javax. Returns the name of this theme. |
| protected ColorUIResource | Returns: the primary 1 colorImplements abstract javax. Returns the primary 1 color. |
| protected ColorUIResource | Returns: the primary 2 colorImplements abstract javax. Returns the primary 2 color. |
| protected ColorUIResource | Returns: the primary 3 colorImplements abstract javax. Returns the primary 3 color. |
| protected ColorUIResource | Returns: the secondary 1 colorImplements abstract javax. Returns the secondary 1 color. |
| protected ColorUIResource | Returns: the secondary 2 colorImplements abstract javax. Returns the secondary 2 color. |
| protected ColorUIResource | Returns: the secondary 3 colorImplements abstract javax. Returns the secondary 3 color. |
| public FontUIResource | Returns: the sub-text fontImplements abstract javax. Returns the sub-text font. |
| public FontUIResource | Returns: the system text fontImplements abstract javax. Returns the system text font. |
| public FontUIResource | Returns: the user text fontImplements abstract javax. Returns the user text font. |
| public FontUIResource | Returns: the window title fontImplements abstract javax. Returns the window title font. |
| pack-priv void | install()
Overrides javax. This is invoked when a MetalLookAndFeel is installed and about to start using this theme. |
| pack-priv boolean | isSystemTheme()
Overrides javax. Returns true if this is a theme provided by the core platform. |
| defaultNames | back to summary |
|---|---|
| private static final String[] defaultNames System property names used to look up fonts. | |
| fontDelegate | back to summary |
|---|---|
| private DefaultMetalTheme. | |
| fontNames | back to summary |
|---|---|
| private static final String[] fontNames Names of the fonts to use. | |
| fontSizes | back to summary |
|---|---|
| private static final int[] fontSizes Sizes for the fonts. | |
| fontStyles | back to summary |
|---|---|
| private static final int[] fontStyles Styles for the fonts. This is ignored if the defaults property
| |
| PLAIN_FONTS | back to summary |
|---|---|
| private static final boolean PLAIN_FONTS Whether or not fonts should be plain. This is only used if the defaults property 'swing.boldMetal' == "false". | |
| primary1 | back to summary |
|---|---|
| private static final ColorUIResource primary1 | |
| primary2 | back to summary |
|---|---|
| private static final ColorUIResource primary2 | |
| primary3 | back to summary |
|---|---|
| private static final ColorUIResource primary3 | |
| secondary1 | back to summary |
|---|---|
| private static final ColorUIResource secondary1 | |
| secondary2 | back to summary |
|---|---|
| private static final ColorUIResource secondary2 | |
| secondary3 | back to summary |
|---|---|
| private static final ColorUIResource secondary3 | |
| DefaultMetalTheme | back to summary |
|---|---|
| public DefaultMetalTheme() Creates and returns an instance of | |
| getControlTextFont | back to summary |
|---|---|
| public FontUIResource getControlTextFont() Implements abstract javax. Returns the control text font. This returns Dialog, 12pt. If plain fonts have been enabled as described in font style, the font style is plain. Otherwise the font style is bold.
| |
| getDefaultFontName | back to summary |
|---|---|
| pack-priv static String getDefaultFontName(int key) Returns the ideal font name for the font identified by key. | |
| getDefaultFontSize | back to summary |
|---|---|
| pack-priv static int getDefaultFontSize(int key) Returns the ideal font size for the font identified by key. | |
| getDefaultFontStyle | back to summary |
|---|---|
| pack-priv static int getDefaultFontStyle(int key) Returns the ideal font style for the font identified by key. | |
| getDefaultPropertyName | back to summary |
|---|---|
| pack-priv static String getDefaultPropertyName(int key) Returns the default used to look up the specified font. | |
| getFont | back to summary |
|---|---|
| private FontUIResource getFont(int key) | |
| getMenuTextFont | back to summary |
|---|---|
| public FontUIResource getMenuTextFont() Implements abstract javax. Returns the menu text font. This returns Dialog, 12pt. If plain fonts have been enabled as described in font style, the font style is plain. Otherwise the font style is bold.
| |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract javax. Returns the name of this theme. This returns
| |
| getPrimary1 | back to summary |
|---|---|
| protected ColorUIResource getPrimary1() Implements abstract javax. Returns the primary 1 color. This returns a color with rgb values of 102, 102, and 153, respectively.
| |
| getPrimary2 | back to summary |
|---|---|
| protected ColorUIResource getPrimary2() Implements abstract javax. Returns the primary 2 color. This returns a color with rgb values of 153, 153, 204, respectively.
| |
| getPrimary3 | back to summary |
|---|---|
| protected ColorUIResource getPrimary3() Implements abstract javax. Returns the primary 3 color. This returns a color with rgb values 204, 204, 255, respectively.
| |
| getSecondary1 | back to summary |
|---|---|
| protected ColorUIResource getSecondary1() Implements abstract javax. Returns the secondary 1 color. This returns a color with rgb values 102, 102, and 102, respectively.
| |
| getSecondary2 | back to summary |
|---|---|
| protected ColorUIResource getSecondary2() Implements abstract javax. Returns the secondary 2 color. This returns a color with rgb values 153, 153, and 153, respectively.
| |
| getSecondary3 | back to summary |
|---|---|
| protected ColorUIResource getSecondary3() Implements abstract javax. Returns the secondary 3 color. This returns a color with rgb values 204, 204, and 204, respectively.
| |
| getSubTextFont | back to summary |
|---|---|
| public FontUIResource getSubTextFont() Implements abstract javax. Returns the sub-text font. This returns Dialog, 10pt, plain.
| |
| getSystemTextFont | back to summary |
|---|---|
| public FontUIResource getSystemTextFont() Implements abstract javax. Returns the system text font. This returns Dialog, 12pt, plain.
| |
| getUserTextFont | back to summary |
|---|---|
| public FontUIResource getUserTextFont() Implements abstract javax. Returns the user text font. This returns Dialog, 12pt, plain.
| |
| getWindowTitleFont | back to summary |
|---|---|
| public FontUIResource getWindowTitleFont() Implements abstract javax. Returns the window title font. This returns Dialog, 12pt, bold.
| |
| install | back to summary |
|---|---|
| pack-priv void install() Overrides javax. Doc from javax. This is invoked when a MetalLookAndFeel is installed and about to start using this theme. When we can add API this should be nuked in favor of DefaultMetalTheme overriding addCustomEntriesToTable. | |
| isSystemTheme | back to summary |
|---|---|
| pack-priv boolean isSystemTheme() Overrides javax. Returns true if this is a theme provided by the core platform. | |
| Modifier and Type | Field and Description |
|---|---|
| private static int[] | |
| pack-priv FontUIResource[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FontUIResource | |
| protected Font |
| defaultMapping | back to summary |
|---|---|
| private static int[] defaultMapping | |
| fonts | back to summary |
|---|---|
| pack-priv FontUIResource[] fonts | |
| FontDelegate | back to summary |
|---|---|
| public FontDelegate() | |
| getFont | back to summary |
|---|---|
| public FontUIResource getFont(int type) | |
| getFontForType | back to summary |
|---|---|
| protected Font getFontForType(final int key) This is the same as invoking
| |
| Modifier and Type | Field and Description |
|---|---|
| private boolean[] | |
| private MetalFontDesktopProperty[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public FontUIResource |
| checked | back to summary |
|---|---|
| private boolean[] checked | |
| props | back to summary |
|---|---|
| private MetalFontDesktopProperty[] props | |
| WindowsFontDelegate | back to summary |
|---|---|
| public WindowsFontDelegate() | |
| getFont | back to summary |
|---|---|
| public FontUIResource getFont(int type) Overrides javax. | |