RowHeaderRenderer.java

1
package com.jsql.view.swing.table;
2
3
import javax.swing.*;
4
import javax.swing.table.DefaultTableCellRenderer;
5
import java.awt.*;
6
7
public class RowHeaderRenderer extends DefaultTableCellRenderer {
8
    
9
    public RowHeaderRenderer() {
10
        
11 1 1. <init> : removed call to com/jsql/view/swing/table/RowHeaderRenderer::setHorizontalAlignment → NO_COVERAGE
        this.setHorizontalAlignment(SwingConstants.CENTER);
12 1 1. <init> : removed call to com/jsql/view/swing/table/RowHeaderRenderer::setBackground → NO_COVERAGE
        this.setBackground(new Color(230, 230, 230));
13
    }
14
15
    @Override
16
    public Component getTableCellRendererComponent(
17
        JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column
18
    ) {
19
        
20
        // Report #218: ignore if value is null
21 1 1. getTableCellRendererComponent : negated conditional → NO_COVERAGE
        if (value != null) {
22 1 1. getTableCellRendererComponent : removed call to com/jsql/view/swing/table/RowHeaderRenderer::setText → NO_COVERAGE
            this.setText(value.toString());
23
        }
24
        
25 1 1. getTableCellRendererComponent : replaced return value with null for com/jsql/view/swing/table/RowHeaderRenderer::getTableCellRendererComponent → NO_COVERAGE
        return this;
26
    }
27
}

Mutations

11

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/RowHeaderRenderer::setHorizontalAlignment → NO_COVERAGE

12

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/table/RowHeaderRenderer::setBackground → NO_COVERAGE

21

1.1
Location : getTableCellRendererComponent
Killed by : none
negated conditional → NO_COVERAGE

22

1.1
Location : getTableCellRendererComponent
Killed by : none
removed call to com/jsql/view/swing/table/RowHeaderRenderer::setText → NO_COVERAGE

25

1.1
Location : getTableCellRendererComponent
Killed by : none
replaced return value with null for com/jsql/view/swing/table/RowHeaderRenderer::getTableCellRendererComponent → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1