javax.swing.plaf.metal
Class DefaultMetalTheme

java.lang.Object
  extended byjavax.swing.plaf.metal.MetalTheme
      extended byjavax.swing.plaf.metal.DefaultMetalTheme
Direct Known Subclasses:
MetalHighContrastTheme

public class DefaultMetalTheme
extends MetalTheme

This class describes the default Metal Theme.

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.

Author:
Steve Wilson

Nested Class Summary
private static class DefaultMetalTheme.FontDelegate
          FontDelegates add an extra level of indirection to obtaining fonts.
private static class DefaultMetalTheme.WindowsFontDelegate
          The WindowsFontDelegate uses DesktopProperties to obtain fonts.
 
Field Summary
private static String[] defaultNames
          System property names used to look up fonts.
private  DefaultMetalTheme.FontDelegate fontDelegate
           
private static String[] fontNames
          Names of the fonts to use.
private static int[] fontSizes
          Sizes for the fonts.
private static int[] fontStyles
          Styles for the fonts.
private static ColorUIResource primary1
           
private static ColorUIResource primary2
           
private static ColorUIResource primary3
           
private static ColorUIResource secondary1
           
private static ColorUIResource secondary2
           
private static ColorUIResource secondary3
           
 
Fields inherited from class javax.swing.plaf.metal.MetalTheme
CONTROL_TEXT_FONT, MENU_TEXT_FONT, SUB_TEXT_FONT, SYSTEM_TEXT_FONT, USER_TEXT_FONT, WINDOW_TITLE_FONT
 
Constructor Summary
DefaultMetalTheme()
           
 
Method Summary
 FontUIResource getControlTextFont()
           
(package private) static String getDefaultFontName(int key)
          Returns the ideal font name for the font identified by key.
(package private) static int getDefaultFontSize(int key)
          Returns the ideal font size for the font identified by key.
(package private) static int getDefaultFontStyle(int key)
          Returns the ideal font style for the font identified by key.
(package private) static String getDefaultPropertyName(int key)
          Returns the default used to look up the specified font.
private  FontUIResource getFont(int key)
           
 FontUIResource getMenuTextFont()
           
 String getName()
           
protected  ColorUIResource getPrimary1()
           
protected  ColorUIResource getPrimary2()
           
protected  ColorUIResource getPrimary3()
           
protected  ColorUIResource getSecondary1()
           
protected  ColorUIResource getSecondary2()
           
protected  ColorUIResource getSecondary3()
           
 FontUIResource getSubTextFont()
           
 FontUIResource getSystemTextFont()
           
 FontUIResource getUserTextFont()
           
 FontUIResource getWindowTitleFont()
           
(package private)  void install()
          This is invoked when a MetalLookAndFeel is installed and about to start using this theme.
(package private)  boolean isSystemTheme()
          Returns true if this is a theme provided by the core platform.
 
Methods inherited from class javax.swing.plaf.metal.MetalTheme
addCustomEntriesToTable, getAcceleratorForeground, getAcceleratorSelectedForeground, getBlack, getControl, getControlDarkShadow, getControlDisabled, getControlHighlight, getControlInfo, getControlShadow, getControlTextColor, getDesktopColor, getFocusColor, getHighlightedTextColor, getInactiveControlTextColor, getInactiveSystemTextColor, getMenuBackground, getMenuDisabledForeground, getMenuForeground, getMenuSelectedBackground, getMenuSelectedForeground, getPrimaryControl, getPrimaryControlDarkShadow, getPrimaryControlHighlight, getPrimaryControlInfo, getPrimaryControlShadow, getSeparatorBackground, getSeparatorForeground, getSystemTextColor, getTextHighlightColor, getUserTextColor, getWhite, getWindowBackground, getWindowTitleBackground, getWindowTitleForeground, getWindowTitleInactiveBackground, getWindowTitleInactiveForeground
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fontNames

private static final String[] fontNames
Names of the fonts to use.


fontStyles

private static final int[] fontStyles
Styles for the fonts.


fontSizes

private static final int[] fontSizes
Sizes for the fonts.


defaultNames

private static final String[] defaultNames
System property names used to look up fonts.


primary1

private static final ColorUIResource primary1

primary2

private static final ColorUIResource primary2

primary3

private static final ColorUIResource primary3

secondary1

private static final ColorUIResource secondary1

secondary2

private static final ColorUIResource secondary2

secondary3

private static final ColorUIResource secondary3

fontDelegate

private DefaultMetalTheme.FontDelegate fontDelegate
Constructor Detail

DefaultMetalTheme

public DefaultMetalTheme()
Method Detail

getDefaultFontName

static String getDefaultFontName(int key)
Returns the ideal font name for the font identified by key.


getDefaultFontSize

static int getDefaultFontSize(int key)
Returns the ideal font size for the font identified by key.


getDefaultFontStyle

static int getDefaultFontStyle(int key)
Returns the ideal font style for the font identified by key.


getDefaultPropertyName

static String getDefaultPropertyName(int key)
Returns the default used to look up the specified font.


getName

public String getName()
Specified by:
getName in class MetalTheme

getPrimary1

protected ColorUIResource getPrimary1()
Specified by:
getPrimary1 in class MetalTheme

getPrimary2

protected ColorUIResource getPrimary2()
Specified by:
getPrimary2 in class MetalTheme

getPrimary3

protected ColorUIResource getPrimary3()
Specified by:
getPrimary3 in class MetalTheme

getSecondary1

protected ColorUIResource getSecondary1()
Specified by:
getSecondary1 in class MetalTheme

getSecondary2

protected ColorUIResource getSecondary2()
Specified by:
getSecondary2 in class MetalTheme

getSecondary3

protected ColorUIResource getSecondary3()
Specified by:
getSecondary3 in class MetalTheme

getControlTextFont

public FontUIResource getControlTextFont()
Specified by:
getControlTextFont in class MetalTheme

getSystemTextFont

public FontUIResource getSystemTextFont()
Specified by:
getSystemTextFont in class MetalTheme

getUserTextFont

public FontUIResource getUserTextFont()
Specified by:
getUserTextFont in class MetalTheme

getMenuTextFont

public FontUIResource getMenuTextFont()
Specified by:
getMenuTextFont in class MetalTheme

getWindowTitleFont

public FontUIResource getWindowTitleFont()
Specified by:
getWindowTitleFont in class MetalTheme

getSubTextFont

public FontUIResource getSubTextFont()
Specified by:
getSubTextFont in class MetalTheme

getFont

private FontUIResource getFont(int key)

install

void install()
Description copied from class: MetalTheme
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.

Overrides:
install in class MetalTheme

isSystemTheme

boolean isSystemTheme()
Returns true if this is a theme provided by the core platform.

Overrides:
isSystemTheme in class MetalTheme