- java.lang.Object
-
- javax.swing.plaf.metal.MetalTheme
-
- javax.swing.plaf.metal.DefaultMetalTheme
-
- 已知直接子类:
-
OceanTheme
public class DefaultMetalTheme extends MetalTheme
MetalTheme的具体实现,提供Java外观的原始外观,代号为“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(如果已设置)优先于同名的系统属性。 设置此默认属性后,您需要重新安装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开始,
java.beans软件包中添加了对所有JavaBeansjava.beans长期存储的支持。 请参阅XMLEncoder。
-
-
构造方法摘要
构造方法 构造器 描述 DefaultMetalTheme()创建并返回DefaultMetalTheme的实例。
-
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 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()返回窗口标题字体。-
声明方法的类 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 - 结果
- 第二种颜色
-
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 - 结果
- 子文本字体
-
-