javax.swing.plaf.metal
public class MetalLookAndFeel extends BasicLookAndFeel
try { UIManager.setLookAndFeel(new MetalLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); }
Constructor Summary | |
---|---|
MetalLookAndFeel()
Creates a new instance of the Metal look and feel. |
Method Summary | |
---|---|
protected void | createDefaultTheme()
Sets the current theme to a new instance of DefaultMetalTheme. |
static ColorUIResource | getAcceleratorForeground()
Returns the accelerator foreground color from the installed theme.
|
static ColorUIResource | getAcceleratorSelectedForeground()
Returns the accelerator selected foreground color from the installed
theme.
|
static ColorUIResource | getBlack()
Returns the color black from the installed theme.
|
static ColorUIResource | getControl()
Returns the control color from the installed theme.
|
static ColorUIResource | getControlDarkShadow()
Returns the color used for dark shadows on controls, from the installed
theme.
|
static ColorUIResource | getControlDisabled()
Returns the color used for disabled controls, from the installed theme.
|
static ColorUIResource | getControlHighlight()
Returns the color used to draw highlights for controls, from the installed
theme.
|
static ColorUIResource | getControlInfo()
Returns the color used to display control info, from the installed
theme.
|
static ColorUIResource | getControlShadow()
Returns the color used to draw shadows for controls, from the installed
theme.
|
static ColorUIResource | getControlTextColor()
Returns the color used for text on controls, from the installed theme.
|
static FontUIResource | getControlTextFont()
Returns the font used for text on controls, from the installed theme.
|
static MetalTheme | getCurrentTheme()
Returns the current theme for the Metal look and feel. |
UIDefaults | getDefaults() |
String | getDescription()
Returns a string describing the look and feel. |
static ColorUIResource | getDesktopColor()
Returns the color used for the desktop background, from the installed
theme.
|
static ColorUIResource | getFocusColor()
Returns the color used to draw focus highlights, from the installed
theme.
|
static ColorUIResource | getHighlightedTextColor()
Returns the color used to draw highlighted text, from the installed
theme.
|
String | getID()
Returns the look and feel identifier.
|
static ColorUIResource | getInactiveControlTextColor()
Returns the color used to draw text on inactive controls, from the
installed theme.
|
static ColorUIResource | getInactiveSystemTextColor()
Returns the color used to draw inactive system text, from the installed
theme.
|
static ColorUIResource | getMenuBackground()
Returns the background color for menu items, from the installed theme.
|
static ColorUIResource | getMenuDisabledForeground()
Returns the foreground color for disabled menu items, from the installed
theme.
|
static ColorUIResource | getMenuForeground()
Returns the foreground color for menu items, from the installed theme.
|
static ColorUIResource | getMenuSelectedBackground()
Returns the background color for selected menu items, from the installed
theme.
|
static ColorUIResource | getMenuSelectedForeground()
Returns the foreground color for selected menu items, from the installed
theme.
|
static FontUIResource | getMenuTextFont()
Returns the font used for text in menus, from the installed theme.
|
String | getName()
Returns the look and feel name.
|
static ColorUIResource | getPrimaryControl()
Returns the primary color for controls, from the installed theme.
|
static ColorUIResource | getPrimaryControlDarkShadow()
Returns the primary color for the dark shadow on controls, from the
installed theme.
|
static ColorUIResource | getPrimaryControlHighlight()
Returns the primary color for the highlight on controls, from the
installed theme.
|
static ColorUIResource | getPrimaryControlInfo()
Returns the primary color for the information on controls, from the
installed theme.
|
static ColorUIResource | getPrimaryControlShadow()
Returns the primary color for the shadow on controls, from the installed
theme.
|
static ColorUIResource | getSeparatorBackground()
Returns the background color for separators, from the installed theme.
|
static ColorUIResource | getSeparatorForeground()
Returns the foreground color for separators, from the installed theme.
|
static FontUIResource | getSubTextFont()
Returns the font used for sub text, from the installed theme.
|
boolean | getSupportsWindowDecorations()
Returns true because the Metal look
and feel supports window decorations for toplevel
containers.
|
static ColorUIResource | getSystemTextColor()
Returns the color used for system text, from the installed theme.
|
static FontUIResource | getSystemTextFont()
Returns the font used for system text, from the installed theme.
|
static ColorUIResource | getTextHighlightColor()
Returns the color used to highlight text, from the installed theme.
|
static ColorUIResource | getUserTextColor()
Returns the color used to display user text, from the installed theme.
|
static FontUIResource | getUserTextFont()
Returns the font used for user text, obtained from the current theme.
|
static ColorUIResource | getWhite()
Returns the color used for white, from the installed theme.
|
static ColorUIResource | getWindowBackground()
Returns the window background color, from the installed theme.
|
static ColorUIResource | getWindowTitleBackground()
Returns the window title background color, from the installed theme.
|
static FontUIResource | getWindowTitleFont()
Returns the window title font from the current theme.
|
static ColorUIResource | getWindowTitleForeground()
Returns the window title foreground color, from the installed theme.
|
static ColorUIResource | getWindowTitleInactiveBackground()
Returns the background color for an inactive window title, from the
installed theme.
|
static ColorUIResource | getWindowTitleInactiveForeground()
Returns the foreground color for an inactive window title, from the
installed theme.
|
protected void | initClassDefaults(UIDefaults defaults)
Sets the ComponentUI classes for all Swing components to the Metal
implementations.
|
protected void | initComponentDefaults(UIDefaults defaults)
Initializes the component defaults for the Metal Look & Feel.
|
protected void | initSystemColorDefaults(UIDefaults defaults)
Initializes the system color defaults.
|
boolean | isNativeLookAndFeel()
Returns false to indicate that this look and feel does not
attempt to emulate the look and feel of native applications on the host
platform.
|
boolean | isSupportedLookAndFeel()
Returns true to indicate that this look and feel is supported
on all platforms.
|
static void | setCurrentTheme(MetalTheme theme)
Sets the current theme for the look and feel. |
Returns: The accelerator foreground color.
Returns: The accelerator selected foreground color.
Returns: The color black.
Returns: The control color.
Returns: The color used for dark shadows on controls.
Returns: The color used for disabled controls.
Returns: The color used to draw highlights for controls.
Returns: The color used to display control info.
Returns: The color used to draw shadows for controls.
Returns: The color used for text on controls.
Returns: The font used for text on controls.
Returns: The current theme (never null
).
See Also: setCurrentTheme
Returns: A string describing the look and feel.
Returns: The color used for the desktop background.
Returns: The color used to draw focus highlights.
Returns: The color used to draw highlighted text.
Returns: "MetalLookAndFeel".
Returns: The color used to draw text on inactive controls.
Returns: The color used to draw inactive system text.
Returns: The background color for menu items.
See Also: getMenuSelectedBackground
Returns: The foreground color for disabled menu items.
See Also: getMenuForeground
Returns: The foreground color for menu items.
See Also: getMenuDisabledForeground getMenuSelectedForeground
Returns: The background color for selected menu items.
See Also: getMenuBackground
Returns: The foreground color for selected menu items.
See Also: getMenuForeground
Returns: The font used for text in menus.
Returns: "MetalLookAndFeel".
Returns: The primary color for controls.
Returns: The primary color for the dark shadow on controls.
Returns: The primary color for the highlight on controls.
Returns: The primary color for the information on controls.
Returns: The primary color for the shadow on controls.
Returns: The background color for separators.
Returns: The foreground color for separators.
Returns: The font used for sub text.
true
because the Metal look
and feel supports window decorations for toplevel
containers.
Returns: true
Returns: The color used for system text.
Returns: The font used for system text.
Returns: The color used to highlight text.
Returns: The color used to display user text.
Returns: The font used for user text.
Returns: The color used for white.
Returns: The window background color.
Returns: The window title background color.
Returns: The window title font.
See Also: MetalTheme
Returns: The window title foreground color.
Returns: The background color for an inactive window title.
Returns: The foreground color for an inactive window title.
Key | Value |
---|---|
ButtonUI | MetalButtonUI |
CheckBoxUI | MetalCheckBoxUI |
ComboBoxUI | MetalComboBoxUI |
DesktopIconUI | MetalDesktopIconUI |
InternalFrameUI | MetalInternalFrameUI |
LabelUI | MetalLabelUI |
PopupMenuSeparatorUI | MetalPopupMenuSeparatorUI |
ProgressBarUI | MetalProgressBarUI |
RadioButtonUI | MetalRadioButtonUI |
RootPaneUI | MetalRootPaneUI |
ScrollBarUI | MetalScrollBarUI |
ScrollPaneUI | MetalScrollPaneUI |
SeparatorUI | MetalSeparatorUI |
SliderUI | MetalSliderUI |
SplitPaneUI | MetalSplitPaneUI |
TabbedPaneUI | MetalTabbedPaneUI |
TextFieldUI | MetalTextFieldUI |
ToggleButtonUI | MetalToggleButtonUI |
ToolBarUI | MetalToolBarUI |
ToolTipUI | MetalToolTipUI |
TreeUI | MetalTreeUI |
Parameters: defaults the UIDefaults where the class defaults are added
Key | Value |
---|---|
Button.background | 0xcccccc |
Button.border | getButtonBorder |
Button.font | MetalLookAndFeel |
Button.margin | new java.awt.Insets(2, 14, 2, 14)
|
CheckBox.background | 0xcccccc |
CheckBoxMenuItem.background | 0xcccccc |
ToolBar.background | 0xcccccc |
Panel.background | 0xcccccc |
Slider.background | 0xcccccc |
OptionPane.background | 0xcccccc |
ProgressBar.background | 0xcccccc |
TabbedPane.background | 0xcccccc |
Label.background | 0xcccccc |
Label.font | MetalLookAndFeel |
Menu.background | 0xcccccc |
MenuBar.background | 0xcccccc |
MenuItem.background | 0xcccccc |
ScrollBar.background | 0xcccccc |
PopupMenu.border | new javax.swing.plaf.metal.MetalBorders.PopupMenuBorder() |
Parameters: defaults the UIDefaults instance to which the values are added
Key | Value | Description |
---|---|---|
control | 0xcccccc | The default color for components |
false
to indicate that this look and feel does not
attempt to emulate the look and feel of native applications on the host
platform.
Returns: false
.
true
to indicate that this look and feel is supported
on all platforms.
Returns: true
.
Parameters: theme the theme (null
not permitted).
Throws: NullPointerException if theme
is null
.
See Also: getCurrentTheme