com.jgoodies.looks.plastic
Class PlasticLookAndFeel

java.lang.Object
  extended by javax.swing.LookAndFeel
      extended by javax.swing.plaf.basic.BasicLookAndFeel
          extended by javax.swing.plaf.metal.MetalLookAndFeel
              extended by com.jgoodies.looks.plastic.PlasticLookAndFeel
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Plastic3DLookAndFeel

public class PlasticLookAndFeel
extends javax.swing.plaf.metal.MetalLookAndFeel

Initializes class and component defaults for the JGoodies Plastic look&feel.

Version:
$Revision: 1.8 $
Author:
Karsten Lentzsch
See Also:
Serialized Form

Field Summary
static java.lang.String BORDER_STYLE_KEY
          Client property key to set a border style - shadows the header style.
static java.lang.String DEFAULT_THEME_KEY
          A System property key to set the default theme.
static java.lang.String HIGH_CONTRAST_FOCUS_ENABLED_KEY
          A System property key that indicates that the high contrast focus colors shall be choosen - if applicable.
static java.lang.String IS_3D_KEY
          Client property key to disable the pseudo 3D effect.
static java.lang.String TAB_STYLE_DEFAULT_VALUE
          A System property value that indicates that Plastic shall render tabs in the Plastic 1.0 style.
protected static java.lang.String TAB_STYLE_KEY
          A System property key for the rendering style of the Plastic TabbedPane.
static java.lang.String TAB_STYLE_METAL_VALUE
          A System property value that indicates that Plastic shall render tabs in the Metal L&F style.
static boolean useHighContrastFocusColors
          Holds whether we are using the high contrast focus colors.
 
Constructor Summary
PlasticLookAndFeel()
          Constructs the PlasticLookAndFeel.
 
Method Summary
static PlasticTheme createMyDefaultTheme()
          Creates and returns the default color theme.
protected static PlasticTheme createTheme(java.lang.String themeName)
          Creates and returns a color theme from the specified theme name.
static javax.swing.plaf.ColorUIResource getControl()
           
static javax.swing.plaf.ColorUIResource getControlDarkShadow()
           
static javax.swing.plaf.ColorUIResource getControlHighlight()
           
 java.lang.String getDescription()
           
static javax.swing.plaf.ColorUIResource getFocusColor()
           
static FontSizeHints getFontSizeHints()
          Returns the current FontSizeHints, where look specific settings shadow the global users defaults as stored under key FontSizeHints.KEY.
static boolean getHighContrastFocusColorsEnabled()
           
 java.lang.String getID()
           
static java.util.List getInstalledThemes()
          Lazily initializes and returns the List of installed color themes.
static javax.swing.plaf.BorderUIResource getInternalFrameBorder()
           
static javax.swing.plaf.ColorUIResource getMenuItemBackground()
           
static javax.swing.plaf.ColorUIResource getMenuItemSelectedBackground()
           
static javax.swing.plaf.ColorUIResource getMenuItemSelectedForeground()
           
static PlasticTheme getMyCurrentTheme()
          Gets the current PlasticTheme.
 java.lang.String getName()
           
static javax.swing.plaf.BorderUIResource getPaletteBorder()
           
static javax.swing.plaf.ColorUIResource getPrimaryControl()
           
static javax.swing.plaf.ColorUIResource getPrimaryControlDarkShadow()
           
static javax.swing.plaf.ColorUIResource getPrimaryControlHighlight()
           
static javax.swing.plaf.ColorUIResource getPrimaryControlInfo()
           
static javax.swing.plaf.ColorUIResource getPrimaryControlShadow()
           
static javax.swing.plaf.ColorUIResource getSimpleInternalFrameBackground()
           
static javax.swing.plaf.ColorUIResource getSimpleInternalFrameForeground()
           
static java.lang.String getTabStyle()
           
static javax.swing.plaf.ColorUIResource getTitleTextColor()
           
static javax.swing.plaf.FontUIResource getTitleTextFont()
           
static javax.swing.plaf.ColorUIResource getWindowTitleBackground()
           
static javax.swing.plaf.ColorUIResource getWindowTitleForeground()
           
static javax.swing.plaf.ColorUIResource getWindowTitleInactiveBackground()
           
static javax.swing.plaf.ColorUIResource getWindowTitleInactiveForeground()
           
protected  void initClassDefaults(javax.swing.UIDefaults table)
          Initializes the class defaults, that is, overrides some UI delegates with JGoodies Plastic implementations.
protected  void initComponentDefaults(javax.swing.UIDefaults table)
           
 void initialize()
          Invoked during UIManager#setLookAndFeel.
protected  void initSystemColorDefaults(javax.swing.UIDefaults table)
          Unlike my superclass I register a unified shadow color.
protected static void installDefaultThemes()
          Install the default color themes.
static void installTheme(PlasticTheme theme)
          Installs a color theme.
protected  boolean is3DEnabled()
           
static void set3DEnabled(boolean b)
           
static void setFontSizeHints(FontSizeHints newHints)
          Sets FontSizeHints that shadow the global font size hints.
static void setHighContrastFocusColorsEnabled(boolean b)
           
static void setMyCurrentTheme(PlasticTheme theme)
          Sets a new PlasticTheme for colors and fonts.
static void setTabStyle(java.lang.String tabStyle)
           
 void uninitialize()
          Invoked during UIManager#setLookAndFeel.
 
Methods inherited from class javax.swing.plaf.metal.MetalLookAndFeel
createDefaultTheme, getAcceleratorForeground, getAcceleratorSelectedForeground, getBlack, getControlDisabled, getControlInfo, getControlShadow, getControlTextColor, getControlTextFont, getCurrentTheme, getDefaults, getDesktopColor, getDisabledIcon, getDisabledSelectedIcon, getHighlightedTextColor, getInactiveControlTextColor, getInactiveSystemTextColor, getLayoutStyle, getMenuBackground, getMenuDisabledForeground, getMenuForeground, getMenuSelectedBackground, getMenuSelectedForeground, getMenuTextFont, getSeparatorBackground, getSeparatorForeground, getSubTextFont, getSupportsWindowDecorations, getSystemTextColor, getSystemTextFont, getTextHighlightColor, getUserTextColor, getUserTextFont, getWhite, getWindowBackground, getWindowTitleFont, isNativeLookAndFeel, isSupportedLookAndFeel, provideErrorFeedback, setCurrentTheme
 
Methods inherited from class javax.swing.plaf.basic.BasicLookAndFeel
createAudioAction, getAudioActionMap, loadSystemColors, playSound
 
Methods inherited from class javax.swing.LookAndFeel
getDesktopPropertyValue, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, toString, uninstallBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BORDER_STYLE_KEY

public static final java.lang.String BORDER_STYLE_KEY
Client property key to set a border style - shadows the header style.

See Also:
Constant Field Values

IS_3D_KEY

public static final java.lang.String IS_3D_KEY
Client property key to disable the pseudo 3D effect.

See Also:
Constant Field Values

DEFAULT_THEME_KEY

public static final java.lang.String DEFAULT_THEME_KEY
A System property key to set the default theme.

See Also:
Constant Field Values

HIGH_CONTRAST_FOCUS_ENABLED_KEY

public static final java.lang.String HIGH_CONTRAST_FOCUS_ENABLED_KEY
A System property key that indicates that the high contrast focus colors shall be choosen - if applicable. If not set, some focus colors look good but have low contrast. Basically, the low contrast scheme uses the Plastic colors before 1.0.7, and the high contrast scheme is 1.0.7 - 1.0.9.

See Also:
Constant Field Values

TAB_STYLE_KEY

protected static final java.lang.String TAB_STYLE_KEY
A System property key for the rendering style of the Plastic TabbedPane. Valid values are: default for the Plastic 1.0 tabs, and metal for the Metal L&F tabs.

See Also:
Constant Field Values

TAB_STYLE_DEFAULT_VALUE

public static final java.lang.String TAB_STYLE_DEFAULT_VALUE
A System property value that indicates that Plastic shall render tabs in the Plastic 1.0 style. This is the default.

See Also:
Constant Field Values

TAB_STYLE_METAL_VALUE

public static final java.lang.String TAB_STYLE_METAL_VALUE
A System property value that indicates that Plastic shall render tabs in the Metal L&F style.

See Also:
Constant Field Values

useHighContrastFocusColors

public static boolean useHighContrastFocusColors
Holds whether we are using the high contrast focus colors.

Constructor Detail

PlasticLookAndFeel

public PlasticLookAndFeel()
Constructs the PlasticLookAndFeel.

Method Detail

getID

public java.lang.String getID()
Overrides:
getID in class javax.swing.plaf.metal.MetalLookAndFeel

getName

public java.lang.String getName()
Overrides:
getName in class javax.swing.plaf.metal.MetalLookAndFeel

getDescription

public java.lang.String getDescription()
Overrides:
getDescription in class javax.swing.plaf.metal.MetalLookAndFeel

getFontSizeHints

public static FontSizeHints getFontSizeHints()
Returns the current FontSizeHints, where look specific settings shadow the global users defaults as stored under key FontSizeHints.KEY.

Returns:
the current FontSizeHints
See Also:
Options.setGlobalFontSizeHints(FontSizeHints), FontSizeHints

setFontSizeHints

public static void setFontSizeHints(FontSizeHints newHints)
Sets FontSizeHints that shadow the global font size hints.

Parameters:
newHints - the font size hints to be set
See Also:
Options.setGlobalFontSizeHints(FontSizeHints), FontSizeHints

is3DEnabled

protected boolean is3DEnabled()

set3DEnabled

public static void set3DEnabled(boolean b)

getTabStyle

public static java.lang.String getTabStyle()

setTabStyle

public static void setTabStyle(java.lang.String tabStyle)

getHighContrastFocusColorsEnabled

public static boolean getHighContrastFocusColorsEnabled()

setHighContrastFocusColorsEnabled

public static void setHighContrastFocusColorsEnabled(boolean b)

initialize

public void initialize()
Invoked during UIManager#setLookAndFeel. In addition to the superclass behavior, we install the ShadowPopupFactory.

Overrides:
initialize in class javax.swing.plaf.basic.BasicLookAndFeel
See Also:
uninitialize()

uninitialize

public void uninitialize()
Invoked during UIManager#setLookAndFeel. In addition to the superclass behavior, we uninstall the ShadowPopupFactory.

Overrides:
uninitialize in class javax.swing.plaf.basic.BasicLookAndFeel
See Also:
initialize()

initClassDefaults

protected void initClassDefaults(javax.swing.UIDefaults table)
Initializes the class defaults, that is, overrides some UI delegates with JGoodies Plastic implementations.

Overrides:
initClassDefaults in class javax.swing.plaf.metal.MetalLookAndFeel
Parameters:
table - the UIDefaults table to work with
See Also:
BasicLookAndFeel.getDefaults()

initComponentDefaults

protected void initComponentDefaults(javax.swing.UIDefaults table)
Overrides:
initComponentDefaults in class javax.swing.plaf.metal.MetalLookAndFeel

initSystemColorDefaults

protected void initSystemColorDefaults(javax.swing.UIDefaults table)
Unlike my superclass I register a unified shadow color. This color is used by my ThinBevelBorder class.

Overrides:
initSystemColorDefaults in class javax.swing.plaf.metal.MetalLookAndFeel
Parameters:
table - the UIDefaults table to work with

createMyDefaultTheme

public static PlasticTheme createMyDefaultTheme()
Creates and returns the default color theme. Honors the current platform and platform flavor - if available.

Returns:
the default color theme for the current environemt

getInstalledThemes

public static java.util.List getInstalledThemes()
Lazily initializes and returns the List of installed color themes.

Returns:
a list of installed color/font themes

installDefaultThemes

protected static void installDefaultThemes()
Install the default color themes.


createTheme

protected static PlasticTheme createTheme(java.lang.String themeName)
Creates and returns a color theme from the specified theme name.

Parameters:
themeName - the unqualified name of the theme to create
Returns:
the associated color theme or null in case of a problem

installTheme

public static void installTheme(PlasticTheme theme)
Installs a color theme.

Parameters:
theme - the theme to install

getMyCurrentTheme

public static PlasticTheme getMyCurrentTheme()
Gets the current PlasticTheme.

Returns:
the current PlasticTheme

setMyCurrentTheme

public static void setMyCurrentTheme(PlasticTheme theme)
Sets a new PlasticTheme for colors and fonts.

Parameters:
theme - the PlasticTheme to be set

getInternalFrameBorder

public static javax.swing.plaf.BorderUIResource getInternalFrameBorder()

getPaletteBorder

public static javax.swing.plaf.BorderUIResource getPaletteBorder()

getPrimaryControlDarkShadow

public static javax.swing.plaf.ColorUIResource getPrimaryControlDarkShadow()

getPrimaryControlHighlight

public static javax.swing.plaf.ColorUIResource getPrimaryControlHighlight()

getPrimaryControlInfo

public static javax.swing.plaf.ColorUIResource getPrimaryControlInfo()

getPrimaryControlShadow

public static javax.swing.plaf.ColorUIResource getPrimaryControlShadow()

getPrimaryControl

public static javax.swing.plaf.ColorUIResource getPrimaryControl()

getControlHighlight

public static javax.swing.plaf.ColorUIResource getControlHighlight()

getControlDarkShadow

public static javax.swing.plaf.ColorUIResource getControlDarkShadow()

getControl

public static javax.swing.plaf.ColorUIResource getControl()

getFocusColor

public static javax.swing.plaf.ColorUIResource getFocusColor()

getMenuItemBackground

public static javax.swing.plaf.ColorUIResource getMenuItemBackground()

getMenuItemSelectedBackground

public static javax.swing.plaf.ColorUIResource getMenuItemSelectedBackground()

getMenuItemSelectedForeground

public static javax.swing.plaf.ColorUIResource getMenuItemSelectedForeground()

getWindowTitleBackground

public static javax.swing.plaf.ColorUIResource getWindowTitleBackground()

getWindowTitleForeground

public static javax.swing.plaf.ColorUIResource getWindowTitleForeground()

getWindowTitleInactiveBackground

public static javax.swing.plaf.ColorUIResource getWindowTitleInactiveBackground()

getWindowTitleInactiveForeground

public static javax.swing.plaf.ColorUIResource getWindowTitleInactiveForeground()

getSimpleInternalFrameForeground

public static javax.swing.plaf.ColorUIResource getSimpleInternalFrameForeground()

getSimpleInternalFrameBackground

public static javax.swing.plaf.ColorUIResource getSimpleInternalFrameBackground()

getTitleTextColor

public static javax.swing.plaf.ColorUIResource getTitleTextColor()

getTitleTextFont

public static javax.swing.plaf.FontUIResource getTitleTextFont()


Copyright © 2001-2005 JGoodies Karsten Lentzsch. All Rights Reserved.