// 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)
continue;
SubstanceColorScheme scheme = getColorSchemeForState(
list, index, listUI, activeState);
// SubstanceColorScheme scheme = (activeState ==
// ComponentState.DEFAULT) ? listUI
// .getDefaultColorScheme()
// : listUI.getHighlightColorScheme(activeState);
// if (scheme == null) {
// scheme = (activeState == ComponentState.DEFAULT)
// ?
// SubstanceColorSchemeUtilities
// .getColorScheme(list, activeState)
// : SubstanceColorSchemeUtilities
// .getColorScheme(
// list,
// ColorSchemeAssociationKind.HIGHLIGHT,
// activeState);
// }
Color schemeFg = scheme.getForegroundColor();
aggrRed += schemeFg.getRed() * activeContribution;
aggrGreen += schemeFg.getGreen()
* activeContribution;
aggrBlue += schemeFg.getBlue() * activeContribution;
}