if (menuItem.getParent() instanceof JPopupMenu) {
if (menuItem.getComponentOrientation().isLeftToRight()) {
MenuGutterFillKind fillKind = SubstanceCoreUtilities
.getMenuGutterFillKind();
if (fillKind != MenuGutterFillKind.NONE) {
SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
.getColorScheme(menuItem, ComponentState.DEFAULT);
Color leftColor = ((fillKind == MenuGutterFillKind.SOFT_FILL) || (fillKind == MenuGutterFillKind.HARD)) ? scheme
.getUltraLightColor()
: scheme.getLightColor();
Color rightColor = ((fillKind == MenuGutterFillKind.SOFT_FILL) || (fillKind == MenuGutterFillKind.SOFT)) ? scheme
.getUltraLightColor()
: scheme.getLightColor();
LinearGradientPaint gp = new LinearGradientPaint(0, 0,
textOffset, 0, new float[] { 0.0f, 1.0f },
new Color[] { leftColor, rightColor },
CycleMethod.REPEAT);
graphics.setComposite(TransitionLayout.getAlphaComposite(
menuItem, 0.7f, g));
// System.out.println(menuItem.getText()
// + "["
// + menuItem.isEnabled()
// + "] : "
// + ((AlphaComposite) graphics.getComposite())
// .getAlpha() + ", " + leftColor + "->"
// + rightColor);
//
graphics.setPaint(gp);
graphics.fillRect(0, 0, textOffset - 2, menuHeight);
}
} else {
// fix for defect 125 - support of RTL menus
MenuGutterFillKind fillKind = SubstanceCoreUtilities
.getMenuGutterFillKind();
if (fillKind != MenuGutterFillKind.NONE) {
SubstanceColorScheme scheme = SubstanceColorSchemeUtilities
.getColorScheme(menuItem, ComponentState.DEFAULT);
Color leftColor = ((fillKind == MenuGutterFillKind.HARD_FILL) || (fillKind == MenuGutterFillKind.HARD)) ? scheme
.getLightColor()
: scheme.getUltraLightColor();
Color rightColor = ((fillKind == MenuGutterFillKind.HARD_FILL) || (fillKind == MenuGutterFillKind.SOFT)) ? scheme
.getLightColor()
: scheme.getUltraLightColor();
LinearGradientPaint gp = new LinearGradientPaint(
textOffset, 0, menuWidth, 0, new float[] { 0.0f,
1.0f },
new Color[] { leftColor, rightColor },