Search in sources :

Example 1 with UIManager

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");
}
Also used : Insets(java.awt.Insets) UIManager(javax.swing.UIManager) EmptyBorder(javax.swing.border.EmptyBorder) FontUIResource(javax.swing.plaf.FontUIResource) ColorUIResource(javax.swing.plaf.ColorUIResource) UIResource(javax.swing.plaf.UIResource)

Aggregations

Insets (java.awt.Insets)1 UIManager (javax.swing.UIManager)1 EmptyBorder (javax.swing.border.EmptyBorder)1 ColorUIResource (javax.swing.plaf.ColorUIResource)1 FontUIResource (javax.swing.plaf.FontUIResource)1 UIResource (javax.swing.plaf.UIResource)1