TabConsoles.java

1
/*******************************************************************************
2
 * Copyhacked (H) 2012-2020.
3
 * This program and the accompanying materials
4
 * are made available under no term at all, use it like
5
 * you want, but share and discuss about it
6
 * every time possible with every body.
7
 *
8
 * Contributors:
9
 *      ron190 at ymail dot com - initial implementation
10
 *******************************************************************************/
11
package com.jsql.view.swing.tab;
12
13
import com.jsql.util.LogLevelUtil;
14
import org.apache.logging.log4j.LogManager;
15
import org.apache.logging.log4j.Logger;
16
17
import java.awt.*;
18
19
/**
20
 * Adapt MouseTabbedPane to another class in order to ease Mediator registering.
21
 */
22
public class TabConsoles extends TabbedPaneWheeled {
23
    
24
    /**
25
     * Log4j logger sent to view.
26
     */
27
    private static final Logger LOGGER = LogManager.getRootLogger();
28
    
29
    public TabConsoles() {
30 1 1. <init> : removed call to com/jsql/view/swing/tab/TabConsoles::setName → NO_COVERAGE
        this.setName("tabConsoles");
31
    }
32
33
    public void highlightTab(String label) {
34
        
35
        int tabIndex = this.indexOfTab(label);
36
        
37
        // Highlight only if tab not selected and tab exists
38
        if (
39 3 1. highlightTab : negated conditional → NO_COVERAGE
2. highlightTab : negated conditional → NO_COVERAGE
3. highlightTab : changed conditional boundary → NO_COVERAGE
            this.getSelectedIndex() != tabIndex
40
            && 0 <= tabIndex
41 2 1. highlightTab : negated conditional → NO_COVERAGE
2. highlightTab : changed conditional boundary → NO_COVERAGE
            && tabIndex < this.getTabCount()
42
        ) {
43
            
44
            var tabHeader = this.getTabComponentAt(tabIndex);
45
            
46
            // Unhandled ClassCastException #91158 on setFont()
47
            try {
48 1 1. highlightTab : removed call to java/awt/Component::setFont → NO_COVERAGE
                tabHeader.setFont(tabHeader.getFont().deriveFont(Font.BOLD));
49
            } catch (ClassCastException e) {
50
                LOGGER.log(LogLevelUtil.CONSOLE_JAVA, e, e);
51
            }
52
        }
53
    }
54
}

Mutations

30

1.1
Location : <init>
Killed by : none
removed call to com/jsql/view/swing/tab/TabConsoles::setName → NO_COVERAGE

39

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

2.2
Location : highlightTab
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : highlightTab
Killed by : none
changed conditional boundary → NO_COVERAGE

41

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

2.2
Location : highlightTab
Killed by : none
changed conditional boundary → NO_COVERAGE

48

1.1
Location : highlightTab
Killed by : none
removed call to java/awt/Component::setFont → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.16.1