1 | package com.jsql.view.swing.combomenu; | |
2 | ||
3 | import javax.swing.*; | |
4 | import java.awt.*; | |
5 | ||
6 | public class BlankIcon implements Icon { | |
7 | | |
8 | private final Color fillColor; | |
9 | | |
10 | private final int size; | |
11 | ||
12 | public BlankIcon() { | |
13 | | |
14 | this(null, 11); | |
15 | } | |
16 | ||
17 | public BlankIcon(Color color, int size) { | |
18 | ||
19 | this.fillColor = color; | |
20 | this.size = size; | |
21 | } | |
22 | ||
23 | @Override | |
24 | public void paintIcon(Component c, Graphics g, int x, int y) { | |
25 |
1
1. paintIcon : negated conditional → NO_COVERAGE |
if (this.fillColor != null) { |
26 | | |
27 |
1
1. paintIcon : removed call to java/awt/Graphics::setColor → NO_COVERAGE |
g.setColor(this.fillColor); |
28 |
3
1. paintIcon : Replaced integer subtraction with addition → NO_COVERAGE 2. paintIcon : Replaced integer subtraction with addition → NO_COVERAGE 3. paintIcon : removed call to java/awt/Graphics::drawRect → NO_COVERAGE |
g.drawRect(x, y, this.size-1, this.size-1); |
29 | } | |
30 | } | |
31 | ||
32 | @Override | |
33 | public int getIconWidth() { | |
34 |
1
1. getIconWidth : replaced int return with 0 for com/jsql/view/swing/combomenu/BlankIcon::getIconWidth → NO_COVERAGE |
return this.size; |
35 | } | |
36 | ||
37 | @Override | |
38 | public int getIconHeight() { | |
39 |
1
1. getIconHeight : replaced int return with 0 for com/jsql/view/swing/combomenu/BlankIcon::getIconHeight → NO_COVERAGE |
return this.size; |
40 | } | |
41 | } | |
Mutations | ||
25 |
1.1 |
|
27 |
1.1 |
|
28 |
1.1 2.2 3.3 |
|
34 |
1.1 |
|
39 |
1.1 |