public class PlasticLookAndFeel
extends javax.swing.plaf.metal.MetalLookAndFeel
Modifier and Type | Field and Description |
---|---|
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.
|
Constructor and Description |
---|
PlasticLookAndFeel()
Constructs the PlasticLookAndFeel, creates the default theme
and sets it as current Plastic theme.
|
Modifier and Type | Method and Description |
---|---|
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() |
javax.swing.Icon |
getDisabledIcon(javax.swing.JComponent component,
javax.swing.Icon icon)
Returns an icon with a disabled appearance.
|
static javax.swing.plaf.ColorUIResource |
getFocusColor() |
static FontPolicy |
getFontPolicy()
Looks up and retrieves the FontPolicy used
by the JGoodies Plastic Look&Feel family.
|
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 MicroLayoutPolicy |
getMicroLayoutPolicy()
Looks up and retrieves the MicroLayoutPolicy used by
the JGoodies Plastic Look&Fs.
|
java.lang.String |
getName() |
static javax.swing.plaf.BorderUIResource |
getPaletteBorder() |
static PlasticTheme |
getPlasticTheme()
Lazily initializes and returns the PlasticTheme.
|
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 boolean |
isSelectTextOnKeyboardFocusGained() |
static void |
set3DEnabled(boolean b) |
static void |
setFontPolicy(FontPolicy fontPolicy)
Sets the FontPolicy to be used with the JGoodies Plastic L&F
family.
|
static void |
setHighContrastFocusColorsEnabled(boolean b) |
static void |
setMicroLayoutPolicy(MicroLayout microLayoutPolicy)
Sets the MicroLayoutPolicy to be used with the JGoodies Plastic L&Fs.
|
static void |
setPlasticTheme(PlasticTheme theme)
Sets the theme for colors and fonts used by the Plastic L&F.
|
static void |
setSelectTextOnKeyboardFocusGained(boolean b)
Sets whether text field text shall be selected when it gains focus
via the keyboard.
|
static void |
setTabStyle(java.lang.String tabStyle) |
void |
uninitialize()
Invoked during
UIManager#setLookAndFeel . |
createDefaultTheme, getAcceleratorForeground, getAcceleratorSelectedForeground, getBlack, getControlDisabled, getControlInfo, getControlShadow, getControlTextColor, getControlTextFont, getCurrentTheme, getDefaults, getDesktopColor, 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
createAudioAction, getAudioActionMap, loadSystemColors, playSound
public static final java.lang.String BORDER_STYLE_KEY
public static final java.lang.String IS_3D_KEY
public static final java.lang.String DEFAULT_THEME_KEY
public static final java.lang.String HIGH_CONTRAST_FOCUS_ENABLED_KEY
protected static final java.lang.String TAB_STYLE_KEY
public static final java.lang.String TAB_STYLE_DEFAULT_VALUE
public static final java.lang.String TAB_STYLE_METAL_VALUE
public PlasticLookAndFeel()
public java.lang.String getID()
getID
in class javax.swing.plaf.metal.MetalLookAndFeel
public java.lang.String getName()
getName
in class javax.swing.plaf.metal.MetalLookAndFeel
public java.lang.String getDescription()
getDescription
in class javax.swing.plaf.metal.MetalLookAndFeel
public static FontPolicy getFontPolicy()
setFontPolicy(com.jgoodies.looks.FontPolicy)
,
Options.PLASTIC_FONT_POLICY_KEY
,
FontPolicies
,
FontPolicies.customSettingsPolicy(FontPolicy)
,
FontPolicies.getDefaultPlasticPolicy()
public static void setFontPolicy(FontPolicy fontPolicy)
null
, the default will
be reset.fontPolicy
- the FontPolicy to be used with
the JGoodies Plastic L&F family, or null
to reset
to the defaultgetFontPolicy()
,
Options.PLASTIC_FONT_POLICY_KEY
public static MicroLayoutPolicy getMicroLayoutPolicy()
setMicroLayoutPolicy(com.jgoodies.looks.MicroLayout)
,
Options.PLASTIC_MICRO_LAYOUT_POLICY_KEY
,
MicroLayoutPolicies
public static void setMicroLayoutPolicy(MicroLayout microLayoutPolicy)
null
, the default will be reset.microLayoutPolicy
- the MicroLayoutPolicy to be used with
the JGoodies Plastic L&Fs, or null
to reset
to the defaultgetMicroLayoutPolicy()
,
Options.PLASTIC_MICRO_LAYOUT_POLICY_KEY
protected boolean is3DEnabled()
public static void set3DEnabled(boolean b)
public static java.lang.String getTabStyle()
public static void setTabStyle(java.lang.String tabStyle)
public static boolean getHighContrastFocusColorsEnabled()
public static void setHighContrastFocusColorsEnabled(boolean b)
public static boolean isSelectTextOnKeyboardFocusGained()
public static void setSelectTextOnKeyboardFocusGained(boolean b)
b
- public void initialize()
UIManager#setLookAndFeel
. In addition
to the superclass behavior, we install the ShadowPopupFactory.initialize
in class javax.swing.plaf.basic.BasicLookAndFeel
uninitialize()
public void uninitialize()
UIManager#setLookAndFeel
. In addition
to the superclass behavior, we uninstall the ShadowPopupFactory.uninitialize
in class javax.swing.plaf.basic.BasicLookAndFeel
initialize()
public javax.swing.Icon getDisabledIcon(javax.swing.JComponent component, javax.swing.Icon icon)
This method will be used only on JDK 5.0 and later.
getDisabledIcon
in class javax.swing.plaf.metal.MetalLookAndFeel
component
- the component that will display the icon, may be null.icon
- the icon to generate disabled icon from.protected void initClassDefaults(javax.swing.UIDefaults table)
initClassDefaults
in class javax.swing.plaf.metal.MetalLookAndFeel
table
- the UIDefaults table to work withBasicLookAndFeel.getDefaults()
protected void initComponentDefaults(javax.swing.UIDefaults table)
initComponentDefaults
in class javax.swing.plaf.metal.MetalLookAndFeel
protected void initSystemColorDefaults(javax.swing.UIDefaults table)
initSystemColorDefaults
in class javax.swing.plaf.metal.MetalLookAndFeel
table
- the UIDefaults table to work withpublic static PlasticTheme createMyDefaultTheme()
public static java.util.List getInstalledThemes()
List
of installed
color themes.protected static void installDefaultThemes()
protected static PlasticTheme createTheme(java.lang.String themeName)
themeName
- the unqualified name of the theme to createnull
in case of
a problempublic static void installTheme(PlasticTheme theme)
theme
- the theme to installpublic static PlasticTheme getPlasticTheme()
MetalLookAndFeel#getCurrentTheme
.
In Java 1.4 it is requested from the UIManager.
Both access methods use an AppContext to store the theme,
so that applets in different contexts don't share the theme.public static void setPlasticTheme(PlasticTheme theme)
After setting the theme, you need to re-install the Look&Feel, as well as update the UI's of any previously created components - just as if you'd change the Look&Feel.
theme
- the PlasticTheme to be setjava.lang.NullPointerException
- if the theme is null.getPlasticTheme()
public static javax.swing.plaf.BorderUIResource getInternalFrameBorder()
public static javax.swing.plaf.BorderUIResource getPaletteBorder()
public static javax.swing.plaf.ColorUIResource getPrimaryControlDarkShadow()
public static javax.swing.plaf.ColorUIResource getPrimaryControlHighlight()
public static javax.swing.plaf.ColorUIResource getPrimaryControlInfo()
public static javax.swing.plaf.ColorUIResource getPrimaryControlShadow()
public static javax.swing.plaf.ColorUIResource getPrimaryControl()
public static javax.swing.plaf.ColorUIResource getControlHighlight()
public static javax.swing.plaf.ColorUIResource getControlDarkShadow()
public static javax.swing.plaf.ColorUIResource getControl()
public static javax.swing.plaf.ColorUIResource getFocusColor()
public static javax.swing.plaf.ColorUIResource getMenuItemBackground()
public static javax.swing.plaf.ColorUIResource getMenuItemSelectedBackground()
public static javax.swing.plaf.ColorUIResource getMenuItemSelectedForeground()
public static javax.swing.plaf.ColorUIResource getWindowTitleBackground()
public static javax.swing.plaf.ColorUIResource getWindowTitleForeground()
public static javax.swing.plaf.ColorUIResource getWindowTitleInactiveBackground()
public static javax.swing.plaf.ColorUIResource getWindowTitleInactiveForeground()
public static javax.swing.plaf.ColorUIResource getSimpleInternalFrameForeground()
public static javax.swing.plaf.ColorUIResource getSimpleInternalFrameBackground()
public static javax.swing.plaf.ColorUIResource getTitleTextColor()
public static javax.swing.plaf.FontUIResource getTitleTextFont()
Copyright © 2001-2009 JGoodies Karsten Lentzsch. All Rights Reserved.