本文整理汇总了Java中org.jdesktop.swingx.JXHeader.setDescriptionForeground方法的典型用法代码示例。如果您正苦于以下问题:Java JXHeader.setDescriptionForeground方法的具体用法?Java JXHeader.setDescriptionForeground怎么用?Java JXHeader.setDescriptionForeground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.swingx.JXHeader
的用法示例。
在下文中一共展示了JXHeader.setDescriptionForeground方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: installDefaults
import org.jdesktop.swingx.JXHeader; //导入方法依赖的package包/类
/**
* Installs default header properties.
* <p>
*
* NOTE: this method is called before the children are created, so must not
* try to access any of those!.
*
* @param header the header to install.
*/
protected void installDefaults(JXHeader header) {
gradientLightColor = UIManagerExt.getColor("JXHeader.startBackground");
if (gradientLightColor == null) {
// fallback to white
gradientLightColor = Color.WHITE;
}
gradientDarkColor = UIManagerExt.getColor("JXHeader.background");
// for backwards compatibility (mostly for substance and synthetica,
// I suspect) I'll fall back on the "control" color if
// JXHeader.background
// isn't specified.
if (gradientDarkColor == null) {
gradientDarkColor = UIManagerExt.getColor("control");
}
if (isUIInstallable(header.getBackgroundPainter())) {
header.setBackgroundPainter(createBackgroundPainter());
}
// title properties
if (isUIInstallable(header.getTitleFont())) {
Font titleFont = UIManager.getFont("JXHeader.titleFont");
// fallback to label font
header.setTitleFont(titleFont != null ? titleFont : UIManager
.getFont("Label.font"));
}
if (isUIInstallable(header.getTitleForeground())) {
Color titleForeground = UIManagerExt
.getColor("JXHeader.titleForeground");
// fallback to label foreground
header.setTitleForeground(titleForeground != null ? titleForeground
: UIManagerExt.getColor("Label.foreground"));
}
// description properties
if (isUIInstallable(header.getDescriptionFont())) {
Font descFont = UIManager.getFont("JXHeader.descriptionFont");
// fallback to label font
header.setDescriptionFont(descFont != null ? descFont : UIManager
.getFont("Label.font"));
}
if (isUIInstallable(header.getDescriptionForeground())) {
Color descForeground = UIManagerExt
.getColor("JXHeader.descriptionForeground");
// fallback to label foreground
header.setDescriptionForeground(descForeground != null ? descForeground
: UIManagerExt.getColor("Label.foreground"));
}
// icon label properties
if (isUIInstallable(header.getIcon())) {
header.setIcon(UIManager.getIcon("Header.defaultIcon"));
}
}