use of javax.swing.UIManager in project jdk8u_jdk by JetBrains.
the class DefaultTreeCellRenderer method updateUI.
/**
* {@inheritDoc}
*
* @since 1.7
*/
public void updateUI() {
super.updateUI();
// value.
if (!inited || (getLeafIcon() instanceof UIResource)) {
setLeafIcon(DefaultLookup.getIcon(this, ui, "Tree.leafIcon"));
}
if (!inited || (getClosedIcon() instanceof UIResource)) {
setClosedIcon(DefaultLookup.getIcon(this, ui, "Tree.closedIcon"));
}
if (!inited || (getOpenIcon() instanceof UIManager)) {
setOpenIcon(DefaultLookup.getIcon(this, ui, "Tree.openIcon"));
}
if (!inited || (getTextSelectionColor() instanceof UIResource)) {
setTextSelectionColor(DefaultLookup.getColor(this, ui, "Tree.selectionForeground"));
}
if (!inited || (getTextNonSelectionColor() instanceof UIResource)) {
setTextNonSelectionColor(DefaultLookup.getColor(this, ui, "Tree.textForeground"));
}
if (!inited || (getBackgroundSelectionColor() instanceof UIResource)) {
setBackgroundSelectionColor(DefaultLookup.getColor(this, ui, "Tree.selectionBackground"));
}
if (!inited || (getBackgroundNonSelectionColor() instanceof UIResource)) {
setBackgroundNonSelectionColor(DefaultLookup.getColor(this, ui, "Tree.textBackground"));
}
if (!inited || (getBorderSelectionColor() instanceof UIResource)) {
setBorderSelectionColor(DefaultLookup.getColor(this, ui, "Tree.selectionBorderColor"));
}
drawsFocusBorderAroundIcon = DefaultLookup.getBoolean(this, ui, "Tree.drawsFocusBorderAroundIcon", false);
drawDashedFocusIndicator = DefaultLookup.getBoolean(this, ui, "Tree.drawDashedFocusIndicator", false);
fillBackground = DefaultLookup.getBoolean(this, ui, "Tree.rendererFillBackground", true);
Insets margins = DefaultLookup.getInsets(this, ui, "Tree.rendererMargins");
if (margins != null) {
setBorder(new EmptyBorder(margins.top, margins.left, margins.bottom, margins.right));
}
setName("Tree.cellRenderer");
}
Aggregations