public abstract class MetalTheme extends Object
MetalTheme
提供的java使用调色板的颜色和字体的外观和感觉。
MetalTheme
是抽象的,看到的具体实现DefaultMetalTheme
和OceanTheme
。
MetalLookAndFeel
主张的ComponentUI
实现金属使用当前主题。参考MetalLookAndFeel.setCurrentTheme(MetalTheme)
对改变当前主题的细节。
MetalTheme
提供了大量的公共方法得到的颜色。这些方法是实施在少数保护的抽象方法。子类只需要重写抽象方法(getPrimary1
,getPrimary2
,getPrimary3
,getSecondary1
,getSecondary2
,和getSecondary3
);虽然子类可以重写了颜色的设置,使用更多的控制其他的公共方法。
对MetalTheme
具体实现必须non-null
从方法返回值。虽然没有指定返回null
行为,还null
将导致不正确的行为。
它强烈建议子类返回完全不透明的颜色。否则可能会导致渲染问题,如视觉垃圾。
Constructor and Description |
---|
MetalTheme() |
public abstract String getName()
protected abstract ColorUIResource getPrimary1()
protected abstract ColorUIResource getPrimary2()
protected abstract ColorUIResource getPrimary3()
protected abstract ColorUIResource getSecondary1()
protected abstract ColorUIResource getSecondary2()
protected abstract ColorUIResource getSecondary3()
public abstract FontUIResource getControlTextFont()
public abstract FontUIResource getSystemTextFont()
public abstract FontUIResource getUserTextFont()
public abstract FontUIResource getMenuTextFont()
public abstract FontUIResource getWindowTitleFont()
public abstract FontUIResource getSubTextFont()
protected ColorUIResource getWhite()
0xFFFFFFFF
)。
protected ColorUIResource getBlack()
0xFF000000
)。
public ColorUIResource getFocusColor()
getPrimary2()
。
public ColorUIResource getDesktopColor()
getPrimary2()
。
public ColorUIResource getControl()
getSecondary3()
。
public ColorUIResource getControlShadow()
getSecondary2()
。
public ColorUIResource getControlDarkShadow()
getSecondary1()
。
public ColorUIResource getControlInfo()
getBlack()
。
public ColorUIResource getControlHighlight()
getWhite()
。
public ColorUIResource getControlDisabled()
getSecondary2()
。
public ColorUIResource getPrimaryControl()
getPrimary3()
。
public ColorUIResource getPrimaryControlShadow()
getPrimary2()
。
public ColorUIResource getPrimaryControlDarkShadow()
getPrimary1()
。
public ColorUIResource getPrimaryControlInfo()
getBlack()
。
public ColorUIResource getPrimaryControlHighlight()
getWhite()
。
public ColorUIResource getSystemTextColor()
getBlack()
。
public ColorUIResource getControlTextColor()
getControlInfo()
。
public ColorUIResource getInactiveControlTextColor()
getControlDisabled()
。
public ColorUIResource getInactiveSystemTextColor()
getSecondary2()
。
public ColorUIResource getUserTextColor()
getBlack()
。
public ColorUIResource getTextHighlightColor()
getPrimary3()
。
public ColorUIResource getHighlightedTextColor()
getControlTextColor()
。
public ColorUIResource getWindowBackground()
getWhite()
。
public ColorUIResource getWindowTitleBackground()
getPrimary3()
。
public ColorUIResource getWindowTitleForeground()
getBlack()
。
public ColorUIResource getWindowTitleInactiveBackground()
getSecondary3()
。
public ColorUIResource getWindowTitleInactiveForeground()
getBlack()
。
public ColorUIResource getMenuBackground()
getSecondary3()
。
public ColorUIResource getMenuForeground()
getBlack()
。
public ColorUIResource getMenuSelectedBackground()
getPrimary2()
。
public ColorUIResource getMenuSelectedForeground()
getBlack()
。
public ColorUIResource getMenuDisabledForeground()
getSecondary2()
。
public ColorUIResource getSeparatorBackground()
getWhite()
。
public ColorUIResource getSeparatorForeground()
getPrimary1()
。
public ColorUIResource getAcceleratorForeground()
getPrimary1()
。
public ColorUIResource getAcceleratorSelectedForeground()
getBlack()
。
public void addCustomEntriesToTable(UIDefaults table)
MetalLookAndFeel
。
此实现不做任何事;它提供给希望自定义默认表的子类。
table
-
UIDefaults
加值
MetalLookAndFeel.getDefaults()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.