| |
|
| java.lang.Object javax.swing.plaf.metal.MetalTheme javax.swing.plaf.metal.DefaultMetalTheme
All known Subclasses: javax.swing.plaf.metal.OceanTheme, javax.swing.plaf.metal.MetalHighContrastTheme,
DefaultMetalTheme | public class DefaultMetalTheme extends MetalTheme (Code) | | A concrete implementation of
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.
Font Style
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:
- Set the system property
swing.boldMetal to
false . For example,
java -Dswing.boldMetal=false MyApp .
- Set the defaults property
swing.boldMetal to
Boolean.FALSE . For example:
UIManager.put("swing.boldMetal", Boolean.FALSE);
The defaults property swing.boldMetal , if set,
takes precendence 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 JavaBeansTM
has been added to the java.beans package.
Please see
java.beans.XMLEncoder .
See Also: MetalLookAndFeel See Also: MetalLookAndFeel.setCurrentTheme version: 1.37 05/05/07 author: Steve Wilson |
Constructor Summary | |
public | DefaultMetalTheme() Creates and returns an instance of
DefaultMetalTheme . |
DefaultMetalTheme | public DefaultMetalTheme()(Code) | | Creates and returns an instance of
DefaultMetalTheme .
|
getControlTextFont | public FontUIResource getControlTextFont()(Code) | | 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.
the control text font |
getDefaultFontName | static String getDefaultFontName(int key)(Code) | | Returns the ideal font name for the font identified by key.
|
getDefaultFontSize | static int getDefaultFontSize(int key)(Code) | | Returns the ideal font size for the font identified by key.
|
getDefaultFontStyle | static int getDefaultFontStyle(int key)(Code) | | Returns the ideal font style for the font identified by key.
|
getDefaultPropertyName | static String getDefaultPropertyName(int key)(Code) | | Returns the default used to look up the specified font.
|
getMenuTextFont | public FontUIResource getMenuTextFont()(Code) | | 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.
the menu text font |
getName | public String getName()(Code) | | Returns the name of this theme. This returns
"Steel" .
the name of this theme. |
getPrimary1 | protected ColorUIResource getPrimary1()(Code) | | Returns the primary 1 color. This returns a color with rgb values
of 102, 102, and 153, respectively.
the primary 1 color |
getPrimary2 | protected ColorUIResource getPrimary2()(Code) | | Returns the primary 2 color. This returns a color with rgb values
of 153, 153, 204, respectively.
the primary 2 color |
getPrimary3 | protected ColorUIResource getPrimary3()(Code) | | Returns the primary 3 color. This returns a color with rgb values
204, 204, 255, respectively.
the primary 3 color |
getSecondary1 | protected ColorUIResource getSecondary1()(Code) | | Returns the secondary 1 color. This returns a color with rgb values
102, 102, and 102, respectively.
the secondary 1 color |
getSecondary2 | protected ColorUIResource getSecondary2()(Code) | | Returns the secondary 2 color. This returns a color with rgb values
153, 153, and 153, respectively.
the secondary 2 color |
getSecondary3 | protected ColorUIResource getSecondary3()(Code) | | Returns the secondary 3 color. This returns a color with rgb values
204, 204, and 204, respectively.
the secondary 3 color |
getSubTextFont | public FontUIResource getSubTextFont()(Code) | | Returns the sub-text font. This returns Dialog, 10pt, plain.
the sub-text font |
getSystemTextFont | public FontUIResource getSystemTextFont()(Code) | | Returns the system text font. This returns Dialog, 12pt, plain.
the sytem text font |
getUserTextFont | public FontUIResource getUserTextFont()(Code) | | Returns the user text font. This returns Dialog, 12pt, plain.
the user text font |
getWindowTitleFont | public FontUIResource getWindowTitleFont()(Code) | | Returns the window title font. This returns Dialog, 12pt, bold.
the window title font |
isSystemTheme | boolean isSystemTheme()(Code) | | Returns true if this is a theme provided by the core platform.
|
|
|
|