@Override protected TreeCellRenderer createDefaultCellRenderer() { return new SubstanceDefaultTreeCellRenderer(); }
/** * Returns a new instance of SubstanceDefaultTreeCellRenderer. Alignment is * set to left aligned. Icons and text color are determined from the * UIManager. */ public SubstanceDefaultTreeCellRenderer() { this.setHorizontalAlignment(SwingConstants.LEFT); this.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); }
this.setText(stringValue); Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); SubstanceColorScheme colorScheme = getColorSchemeForState(tree, ui, currState); if (currState.isDisabled() || (activeStates == null) .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState( tree, ui, activeState); Color schemeFg = scheme.getForegroundColor(); SubstanceColorScheme scheme = getColorSchemeForState(tree, ui, currState); if (isDropLocation) { this.setForeground(UIManager .getColor("Tree.selectionForeground")); else this.setForeground(UIManager.getColor("Tree.textForeground")); this.setEnabled(false); if (leaf) { this.setDisabledIcon(SubstanceImageCreator .toGreyscale(SubstanceImageCreator.makeTransparent( tree, this.getDefaultLeafIcon(), 0.5))); } else if (expanded) {
this.setText(stringValue); Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo .getStateContributionMap(); SubstanceColorScheme colorScheme = getColorSchemeForState(tree, ui, currState); if (currState.isDisabled() || (activeStates == null) .getStateContributionMap().entrySet()) { ComponentState activeState = activeEntry.getKey(); SubstanceColorScheme scheme = getColorSchemeForState( tree, ui, activeState); Color schemeFg = scheme.getForegroundColor(); SubstanceColorScheme scheme = getColorSchemeForState(tree, ui, currState); if (isDropLocation) { this.setForeground(UIManager .getColor("Tree.selectionForeground")); else this.setForeground(UIManager.getColor("Tree.textForeground")); this.setEnabled(false); if (leaf) { this.setDisabledIcon(SubstanceImageCreator .toGreyscale(SubstanceImageCreator.makeTransparent( tree, this.getDefaultLeafIcon(), 0.5))); } else if (expanded) {
/** * Returns a new instance of SubstanceDefaultTreeCellRenderer. Alignment is * set to left aligned. Icons and text color are determined from the * UIManager. */ public SubstanceDefaultTreeCellRenderer() { this.setHorizontalAlignment(SwingConstants.LEFT); this.putClientProperty(SubstanceLookAndFeel.COLORIZATION_FACTOR, 1.0); }
@Override protected TreeCellRenderer createDefaultCellRenderer() { return new SubstanceDefaultTreeCellRenderer(); }