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, this);
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(
list, ColorSchemeAssociationKind.HIGHLIGHT,
prevState);
}
}
Timeline runningTimeline = ui.getRunningTimeline(index);
Color color = SubstanceColorUtilities
.getInterpolatedForegroundColor(list, index, scheme, state,
prevScheme, prevState, runningTimeline);
// System.out.println("[row " + index + "] - " + prevState.name()