1 | package com.jsql.view.swing.manager.util; | |
2 | ||
3 | import com.jsql.view.swing.combomenu.ArrowIcon; | |
4 | import com.jsql.view.swing.combomenu.BlankIcon; | |
5 | ||
6 | import javax.swing.*; | |
7 | import java.awt.*; | |
8 | ||
9 | public class ComboMenu extends JMenu { | |
10 | | |
11 | private final transient ArrowIcon iconRenderer; | |
12 | ||
13 | public ComboMenu(String label) { | |
14 | | |
15 | super(label); | |
16 | | |
17 | this.iconRenderer = new ArrowIcon(SwingConstants.SOUTH, true); | |
18 |
1
1. <init> : removed call to com/jsql/view/swing/manager/util/ComboMenu::setBorderPainted → NO_COVERAGE |
this.setBorderPainted(false); |
19 |
1
1. <init> : removed call to com/jsql/view/swing/manager/util/ComboMenu::setIcon → NO_COVERAGE |
this.setIcon(new BlankIcon()); |
20 |
1
1. <init> : removed call to com/jsql/view/swing/manager/util/ComboMenu::setHorizontalTextPosition → NO_COVERAGE |
this.setHorizontalTextPosition(SwingConstants.RIGHT); |
21 | } | |
22 | ||
23 | @Override | |
24 | public void paintComponent(Graphics g) { | |
25 | | |
26 |
1
1. paintComponent : removed call to javax/swing/JMenu::paintComponent → NO_COVERAGE |
super.paintComponent(g); |
27 | | |
28 | Dimension d = this.getPreferredSize(); | |
29 | int x = Math.max(0, 10); | |
30 |
3
1. paintComponent : Replaced integer subtraction with addition → NO_COVERAGE 2. paintComponent : Replaced integer subtraction with addition → NO_COVERAGE 3. paintComponent : Replaced integer division with multiplication → NO_COVERAGE |
int y = Math.max(0, (d.height - this.iconRenderer.getIconHeight()) / 2 - 1); |
31 |
1
1. paintComponent : removed call to com/jsql/view/swing/combomenu/ArrowIcon::paintIcon → NO_COVERAGE |
this.iconRenderer.paintIcon(this, g, x, y); |
32 | } | |
33 | } | |
Mutations | ||
18 |
1.1 |
|
19 |
1.1 |
|
20 |
1.1 |
|
26 |
1.1 |
|
30 |
1.1 2.2 3.3 |
|
31 |
1.1 |