// painted using the renderer of the list, and the index
// is -1.
if (index == -1) {
StateTransitionTracker stateTransitionTracker = comboUI
.getTransitionTracker();
ModelStateInfo modelStateInfo = stateTransitionTracker
.getModelStateInfo();
ComponentState currState = modelStateInfo.getCurrModelState();
float comboAlpha = SubstanceColorSchemeUtilities.getAlpha(
combo, currState);
Color fg = SubstanceTextUtilities
.getForegroundColor(combo, ((JLabel) result).getText(),
modelStateInfo, comboAlpha);
result.setForeground(fg);
} else {
// use highlight color scheme for selected and rollover
// elements in the drop down list
StateTransitionTracker.ModelStateInfo modelStateInfo = listUI
.getModelStateInfo(index, result);
ComponentState currState = listUI.getCellState(index, result);
if (modelStateInfo == null) {
SubstanceColorScheme scheme = getColorSchemeForState(list,
index, listUI, currState);
// SubstanceColorScheme scheme =
// SubstanceColorSchemeUtilities
// .getColorScheme(list, kindForCurr, currState);
result.setForeground(new ColorUIResource(scheme
.getForegroundColor()));
} else {
Map<ComponentState, StateContributionInfo> activeStates = modelStateInfo
.getStateContributionMap();
SubstanceColorScheme colorScheme = getColorSchemeForState(
list, index, listUI, currState);
if (currState.isDisabled() || (activeStates == null)
|| (activeStates.size() == 1)) {
super.setForeground(new ColorUIResource(colorScheme
.getForegroundColor()));
} else {
float aggrRed = 0.0f;
float aggrGreen = 0.0f;
float aggrBlue = 0.0f;
for (Map.Entry<ComponentState, StateTransitionTracker.StateContributionInfo> activeEntry : modelStateInfo
.getStateContributionMap().entrySet()) {
ComponentState activeState = activeEntry.getKey();
float activeContribution = activeEntry.getValue()
.getContribution();
if (activeContribution == 0.0f)