use of sun.swing.plaf.synth.SynthIcon in project jdk8u_jdk by JetBrains.
the class NimbusLookAndFeel method getDisabledIcon.
@Override
public Icon getDisabledIcon(JComponent component, Icon icon) {
if (icon instanceof SynthIcon) {
SynthIcon si = (SynthIcon) icon;
BufferedImage img = EffectUtils.createCompatibleTranslucentImage(si.getIconWidth(), si.getIconHeight());
Graphics2D gfx = img.createGraphics();
si.paintIcon(component, gfx, 0, 0);
gfx.dispose();
return new ImageIconUIResource(GrayFilter.createDisabledImage(img));
} else {
return super.getDisabledIcon(component, icon);
}
}
use of sun.swing.plaf.synth.SynthIcon in project intellij-community by JetBrains.
the class IconWrapper method paintIcon.
@Override
public void paintIcon(final Component c, final Graphics g, final int x, final int y) {
SynthContext context = myOriginalUI.getContext((JComponent) c);
((SynthIcon) myIcon).paintIcon(context, g, x, y, getIconWidth(), getIconHeight());
}
Aggregations