- java.lang.Object
-
- javax.swing.plaf.metal.MetalTheme
-
- javax.swing.plaf.metal.DefaultMetalTheme
-
- 已知直接子类:
-
OceanTheme
public class DefaultMetalTheme extends MetalTheme
具体实现了MetalTheme提供了Java Look and Feel的原创外观,代号为“Steel”。 有关更改默认主题的详细信息,请参阅MetalLookAndFeel.setCurrentTheme(javax.swing.plaf.metal.MetalTheme)。DefaultMetalTheme返回的所有颜色都是完全不透明的。字体风格
DefaultMetalTheme为许多控件使用粗体字体。 要使所有控件(内部框架标题栏和客户端装饰的框架标题栏除外)使用纯字体,您可以执行以下操作之一:- 将系统属性
swing.boldMetal设置为false。 例如,java -Dswing.boldMetal=false MyApp。 - 将默认属性
swing.boldMetal设置为Boolean.FALSE。 例如:UIManager.put("swing.boldMetal", Boolean.FALSE);
swing.boldMetal(如果设置)优先于相同名称的系统属性。 设置此defaults属性后,您需要重新安装MetalLookAndFeel,以及更新任何先前创建的小部件的UI。 否则结果是未定义的。 以下说明如何做到这一点:// 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);警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,支持所有JavaBeans的长期存储已被添加到
java.beans包中。 请参阅XMLEncoder。
-
-
构造方法摘要
构造方法 Constructor 描述 DefaultMetalTheme()创建并返回一个DefaultMetalTheme的实例。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 FontUIResourcegetControlTextFont()返回控件文本字体。FontUIResourcegetMenuTextFont()返回菜单文本字体。StringgetName()返回此主题的名称。protected ColorUIResourcegetPrimary1()返回主要1色。protected ColorUIResourcegetPrimary2()返回主2颜色。protected ColorUIResourcegetPrimary3()返回主3颜色。protected ColorUIResourcegetSecondary1()返回辅助1颜色。protected ColorUIResourcegetSecondary2()返回辅助2颜色。protected ColorUIResourcegetSecondary3()返回辅助3颜色。FontUIResourcegetSubTextFont()返回子文本字体。FontUIResourcegetSystemTextFont()返回系统文本字体。FontUIResourcegetUserTextFont()返回用户文本字体。FontUIResourcegetWindowTitleFont()返回窗口标题字体。-
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
-
-
-
-
方法详细信息
-
getName
public String getName()
返回此主题的名称。 这将返回"Steel"。- Specified by:
-
getName在MetalTheme - 结果
- 这个主题的名字。
-
getPrimary1
protected ColorUIResource getPrimary1()
返回主要1色。 这将分别返回rgb值为102,102和153的颜色。- Specified by:
-
getPrimary1在MetalTheme - 结果
- 主要1色
-
getPrimary2
protected ColorUIResource getPrimary2()
返回主2颜色。 这将分别返回rgb值为153,153,204的颜色。- Specified by:
-
getPrimary2在MetalTheme - 结果
- 主要2色
-
getPrimary3
protected ColorUIResource getPrimary3()
返回主3颜色。 这将分别返回一个rgb值为204,204,255的颜色。- Specified by:
-
getPrimary3在MetalTheme - 结果
- 主要3色
-
getSecondary1
protected ColorUIResource getSecondary1()
返回辅助1颜色。 这将返回分别具有rgb值102,102和102的颜色。- Specified by:
-
getSecondary1在MetalTheme - 结果
- 次要1色
-
getSecondary2
protected ColorUIResource getSecondary2()
返回辅助2颜色。 这将分别返回rgb值153,153和153的颜色。- Specified by:
-
getSecondary2在MetalTheme - 结果
- 次要2色
-
getSecondary3
protected ColorUIResource getSecondary3()
返回辅助3颜色。 这将返回分别具有rgb值204,204和204的颜色。- Specified by:
-
getSecondary3在MetalTheme - 结果
- 次要3色
-
getControlTextFont
public FontUIResource getControlTextFont()
- Specified by:
-
getControlTextFont在MetalTheme - 结果
- 控件文字字体
-
getSystemTextFont
public FontUIResource getSystemTextFont()
返回系统文本字体。 这返回Dialog,12pt,plain。- Specified by:
-
getSystemTextFont在MetalTheme - 结果
- 系统文字字体
-
getUserTextFont
public FontUIResource getUserTextFont()
返回用户文本字体。 这返回Dialog,12pt,plain。- Specified by:
-
getUserTextFont在MetalTheme - 结果
- 用户文字字体
-
getMenuTextFont
public FontUIResource getMenuTextFont()
- Specified by:
-
getMenuTextFont在MetalTheme - 结果
- 菜单文字字体
-
getWindowTitleFont
public FontUIResource getWindowTitleFont()
返回窗口标题字体。 这将返回Dialog,12pt,粗体。- Specified by:
-
getWindowTitleFont在MetalTheme - 结果
- 窗口标题字体
-
getSubTextFont
public FontUIResource getSubTextFont()
返回子文本字体。 这返回Dialog,10pt,plain。- Specified by:
-
getSubTextFont在类MetalTheme - 结果
- 子文字字体
-
-