Search in sources :

Example 1 with ColoredIcon

use of com.intellij.codeHighlighting.HighlightDisplayLevel.ColoredIcon in project intellij-community by JetBrains.

the class MultiScopeSeverityIcon method paintIcon.

@Override
public void paintIcon(final Component c, final Graphics g, final int i, final int j) {
    final int partWidth = getIconWidth() / myScopeToAverageSeverityMap.size();
    final Collection<HighlightDisplayLevel> values = myScopeToAverageSeverityMap.values();
    int idx = 0;
    for (final HighlightDisplayLevel level : values) {
        final Icon icon = level.getIcon();
        g.setColor(icon instanceof ColoredIcon ? ((ColoredIcon) icon).getColor() : getMixedSeverityColor());
        final int x = i + partWidth * idx;
        g.fillRect(x, j, partWidth, getIconHeight());
        idx++;
    }
}
Also used : HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) ColoredIcon(com.intellij.codeHighlighting.HighlightDisplayLevel.ColoredIcon) ColoredIcon(com.intellij.codeHighlighting.HighlightDisplayLevel.ColoredIcon)

Aggregations

HighlightDisplayLevel (com.intellij.codeHighlighting.HighlightDisplayLevel)1 ColoredIcon (com.intellij.codeHighlighting.HighlightDisplayLevel.ColoredIcon)1