1 | package com.jsql.view.swing.panel.consoles; | |
2 | ||
3 | import com.jsql.model.injection.strategy.blind.AbstractCallableBoolean; | |
4 | import com.jsql.view.swing.util.UiUtil; | |
5 | ||
6 | import javax.swing.*; | |
7 | import java.awt.*; | |
8 | import java.util.List; | |
9 | ||
10 | public class CenterRendererWithColor extends CenterRenderer { | |
11 | | |
12 | @Override | |
13 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { | |
14 | | |
15 | Object text = ((List<?>) value).get(0); | |
16 | Object objectCallableBoolean = ((List<?>) value).get(1); | |
17 | | |
18 |
1
1. getTableCellRendererComponent : negated conditional → NO_COVERAGE |
if (objectCallableBoolean != null) { |
19 | | |
20 | AbstractCallableBoolean<?> callableBoolean = (AbstractCallableBoolean<?>) objectCallableBoolean; | |
21 | String charText = callableBoolean.getCharText(); | |
22 | | |
23 |
3
1. getTableCellRendererComponent : negated conditional → NO_COVERAGE 2. getTableCellRendererComponent : changed conditional boundary → NO_COVERAGE 3. getTableCellRendererComponent : negated conditional → NO_COVERAGE |
if (charText != null && charText.charAt(0) >= 32) { |
24 | text += ":" + callableBoolean.getCharText(); | |
25 | } | |
26 | } | |
27 | | |
28 | Component component = super.getTableCellRendererComponent(table, text, isSelected, hasFocus, row, column); | |
29 |
2
1. getTableCellRendererComponent : removed call to java/awt/Component::setBackground → NO_COVERAGE 2. getTableCellRendererComponent : negated conditional → NO_COVERAGE |
component.setBackground(isSelected ? UiUtil.COLOR_FOCUS_GAINED : Color.WHITE); |
30 | ||
31 |
2
1. getTableCellRendererComponent : negated conditional → NO_COVERAGE 2. getTableCellRendererComponent : negated conditional → NO_COVERAGE |
if (column == 3 && objectCallableBoolean != null) { |
32 | | |
33 | AbstractCallableBoolean<?> callableBoolean = (AbstractCallableBoolean<?>) objectCallableBoolean; | |
34 | ||
35 |
1
1. getTableCellRendererComponent : negated conditional → NO_COVERAGE |
if (!callableBoolean.isMultibit()) { |
36 |
1
1. getTableCellRendererComponent : removed call to com/jsql/view/swing/panel/consoles/CenterRendererWithColor::setColor → NO_COVERAGE |
setColor(isSelected, callableBoolean, component); |
37 | } | |
38 | } | |
39 | | |
40 |
1
1. getTableCellRendererComponent : replaced return value with null for com/jsql/view/swing/panel/consoles/CenterRendererWithColor::getTableCellRendererComponent → NO_COVERAGE |
return component; |
41 | } | |
42 | ||
43 | private static void setColor(boolean isSelected, AbstractCallableBoolean<?> callableBoolean, Component component) { | |
44 |
1
1. setColor : negated conditional → NO_COVERAGE |
if (callableBoolean.isTrue()) { |
45 |
1
1. setColor : negated conditional → NO_COVERAGE |
if (isSelected) { |
46 |
1
1. setColor : removed call to java/awt/Component::setBackground → NO_COVERAGE |
component.setBackground(new Color(215, 255, 215)); |
47 | } else { | |
48 |
1
1. setColor : removed call to java/awt/Component::setBackground → NO_COVERAGE |
component.setBackground(new Color(235, 255, 235)); |
49 | } | |
50 | } else { | |
51 |
1
1. setColor : negated conditional → NO_COVERAGE |
if (isSelected) { |
52 |
1
1. setColor : removed call to java/awt/Component::setBackground → NO_COVERAGE |
component.setBackground(new Color(255, 215, 215)); |
53 | } else { | |
54 |
1
1. setColor : removed call to java/awt/Component::setBackground → NO_COVERAGE |
component.setBackground(new Color(255, 235, 235)); |
55 | } | |
56 | } | |
57 | } | |
58 | } | |
Mutations | ||
18 |
1.1 |
|
23 |
1.1 2.2 3.3 |
|
29 |
1.1 2.2 |
|
31 |
1.1 2.2 |
|
35 |
1.1 |
|
36 |
1.1 |
|
40 |
1.1 |
|
44 |
1.1 |
|
45 |
1.1 |
|
46 |
1.1 |
|
48 |
1.1 |
|
51 |
1.1 |
|
52 |
1.1 |
|
54 |
1.1 |