@Override protected void installDefaults() { super.installDefaults(); if (SubstanceCoreUtilities.toDrawWatermark(this.tree)) this.tree.setOpaque(false); if (this.tree.getSelectionPaths() != null) { for (TreePath selectionPath : this.tree.getSelectionPaths()) { TreePathId pathId = new TreePathId(selectionPath); selectedPaths.put(pathId, selectionPath.getLastPathComponent()); } } setExpandedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon( this.tree, false))); setCollapsedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon( this.tree, true))); // instead of computing the cell renderer insets on // every cell rendering, compute it once and expose to the // SubstanceDefaultTreeCellRenderer this.cellRendererInsets = SubstanceSizeUtils .getTreeCellRendererInsets(SubstanceSizeUtils .getComponentFontSize(tree)); }
@Override protected void installDefaults() { super.installDefaults(); if (SubstanceCoreUtilities.toDrawWatermark(this.tree)) this.tree.setOpaque(false); if (this.tree.getSelectionPaths() != null) { for (TreePath selectionPath : this.tree.getSelectionPaths()) { TreePathId pathId = new TreePathId(selectionPath); selectedPaths.put(pathId, selectionPath.getLastPathComponent()); } } setExpandedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon( this.tree, false))); setCollapsedIcon(new IconUIResource(SubstanceIconFactory.getTreeIcon( this.tree, true))); // instead of computing the cell renderer insets on // every cell rendering, compute it once and expose to the // SubstanceDefaultTreeCellRenderer this.cellRendererInsets = SubstanceSizeUtils .getTreeCellRendererInsets(SubstanceSizeUtils .getComponentFontSize(tree)); }
protected void installDefaults() { super.installDefaults(); if(tree.getCellRenderer() instanceof DefaultTreeCellRenderer) { DefaultTreeCellRenderer r = (DefaultTreeCellRenderer)tree.getCellRenderer(); r.setBackgroundNonSelectionColor(Theme.treeTextBgColor.getColor()); r.setBackgroundSelectionColor(Theme.treeSelectedBgColor.getColor()); r.setTextNonSelectionColor(Theme.treeTextColor.getColor()); r.setTextSelectionColor(Theme.treeSelectedTextColor.getColor()); UIDefaults defaults = UIManager.getDefaults(); r.setClosedIcon(defaults.getIcon("Tree.closedIcon")); r.setOpenIcon(defaults.getIcon("Tree.openIcon")); r.setLeafIcon(defaults.getIcon("Tree.leafIcon")); } } }