int index, boolean isSelected, boolean cellHasFocus) {
this.setComponentOrientation(list.getComponentOrientation());
ListUI listUI = list.getUI();
if (listUI instanceof SubstanceListUI) {
SubstanceListUI ui = (SubstanceListUI) listUI;
ComponentState state = ui.getCellState(index, this);
ComponentState prevState = ui.getPrevCellState(index);
SubstanceColorScheme scheme = (state == ComponentState.DEFAULT) ? ui
.getDefaultColorScheme()
: ui.getHighlightColorScheme(state);
if (scheme == null) {
scheme = (state == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
.getColorScheme(list, state)
: SubstanceColorSchemeUtilities.getColorScheme(list,
ColorSchemeAssociationKind.HIGHLIGHT, state);
}
SubstanceColorScheme prevScheme = scheme;
if (prevState != state) {
prevScheme = (prevState == ComponentState.DEFAULT) ? ui
.getDefaultColorScheme() : ui
.getHighlightColorScheme(prevState);
if (prevScheme == null) {
prevScheme = (prevState == ComponentState.DEFAULT) ? SubstanceColorSchemeUtilities
.getColorScheme(list, prevState)
: SubstanceColorSchemeUtilities.getColorScheme(