ListUI baseListUI = list.getUI();
ComboBoxUI baseComboUI = combo.getUI();
if ((baseListUI instanceof SubstanceListUI)
&& (baseComboUI instanceof SubstanceComboBoxUI)) {
SubstanceListUI listUI = (SubstanceListUI) baseListUI;
SubstanceComboBoxUI comboUI = (SubstanceComboBoxUI) baseComboUI;
// special case for the combobox. The selected value is
// 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