Save This Page
Home » openjdk-7 » javax » swing » plaf » metal » [javadoc | source]
javax.swing.plaf.metal
public class: DefaultMetalTheme [javadoc | source]
java.lang.Object
   javax.swing.plaf.metal.MetalTheme
      javax.swing.plaf.metal.DefaultMetalTheme

Direct Known Subclasses:
    MetalHighContrastTheme, OceanTheme

A concrete implementation of {@code 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 {@code DefaultMetalTheme} are completely opaque.

Font Style

{@code 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: 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 .

Fields inherited from javax.swing.plaf.metal.MetalTheme:
CONTROL_TEXT_FONT,  SYSTEM_TEXT_FONT,  USER_TEXT_FONT,  MENU_TEXT_FONT,  WINDOW_TITLE_FONT,  SUB_TEXT_FONT,  white
Constructor:
 public DefaultMetalTheme() 
Method from javax.swing.plaf.metal.DefaultMetalTheme Summary:
getControlTextFont,   getDefaultFontName,   getDefaultFontSize,   getDefaultFontStyle,   getDefaultPropertyName,   getMenuTextFont,   getName,   getPrimary1,   getPrimary2,   getPrimary3,   getSecondary1,   getSecondary2,   getSecondary3,   getSubTextFont,   getSystemTextFont,   getUserTextFont,   getWindowTitleFont,   install,   isSystemTheme
Methods from javax.swing.plaf.metal.MetalTheme:
addCustomEntriesToTable,   getAcceleratorForeground,   getAcceleratorSelectedForeground,   getBlack,   getControl,   getControlDarkShadow,   getControlDisabled,   getControlHighlight,   getControlInfo,   getControlShadow,   getControlTextColor,   getControlTextFont,   getDesktopColor,   getFocusColor,   getHighlightedTextColor,   getInactiveControlTextColor,   getInactiveSystemTextColor,   getMenuBackground,   getMenuDisabledForeground,   getMenuForeground,   getMenuSelectedBackground,   getMenuSelectedForeground,   getMenuTextFont,   getName,   getPrimary1,   getPrimary2,   getPrimary3,   getPrimaryControl,   getPrimaryControlDarkShadow,   getPrimaryControlHighlight,   getPrimaryControlInfo,   getPrimaryControlShadow,   getSecondary1,   getSecondary2,   getSecondary3,   getSeparatorBackground,   getSeparatorForeground,   getSubTextFont,   getSystemTextColor,   getSystemTextFont,   getTextHighlightColor,   getUserTextColor,   getUserTextFont,   getWhite,   getWindowBackground,   getWindowTitleBackground,   getWindowTitleFont,   getWindowTitleForeground,   getWindowTitleInactiveBackground,   getWindowTitleInactiveForeground,   install,   isSystemTheme
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.plaf.metal.DefaultMetalTheme Detail:
 public FontUIResource getControlTextFont() 
    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.
 static String getDefaultFontName(int key) 
    Returns the ideal font name for the font identified by key.
 static int getDefaultFontSize(int key) 
    Returns the ideal font size for the font identified by key.
 static int getDefaultFontStyle(int key) 
    Returns the ideal font style for the font identified by key.
 static String getDefaultPropertyName(int key) 
    Returns the default used to look up the specified font.
 public FontUIResource getMenuTextFont() 
    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.
 public String getName() 
    Returns the name of this theme. This returns {@code "Steel"}.
 protected ColorUIResource getPrimary1() 
    Returns the primary 1 color. This returns a color with rgb values of 102, 102, and 153, respectively.
 protected ColorUIResource getPrimary2() 
    Returns the primary 2 color. This returns a color with rgb values of 153, 153, 204, respectively.
 protected ColorUIResource getPrimary3() 
    Returns the primary 3 color. This returns a color with rgb values 204, 204, 255, respectively.
 protected ColorUIResource getSecondary1() 
    Returns the secondary 1 color. This returns a color with rgb values 102, 102, and 102, respectively.
 protected ColorUIResource getSecondary2() 
    Returns the secondary 2 color. This returns a color with rgb values 153, 153, and 153, respectively.
 protected ColorUIResource getSecondary3() 
    Returns the secondary 3 color. This returns a color with rgb values 204, 204, and 204, respectively.
 public FontUIResource getSubTextFont() 
    Returns the sub-text font. This returns Dialog, 10pt, plain.
 public FontUIResource getSystemTextFont() 
    Returns the system text font. This returns Dialog, 12pt, plain.
 public FontUIResource getUserTextFont() 
    Returns the user text font. This returns Dialog, 12pt, plain.
 public FontUIResource getWindowTitleFont() 
    Returns the window title font. This returns Dialog, 12pt, bold.
  void install() 
 boolean isSystemTheme() 
    Returns true if this is a theme provided by the core platform.