ActionHideShowConsole.java

1
package com.jsql.view.swing.panel.split;
2
3
import com.jsql.view.swing.util.MediatorHelper;
4
5
import javax.swing.*;
6
import java.awt.event.ActionEvent;
7
import java.awt.event.ActionListener;
8
9
/**
10
 * MouseAdapter to show/hide bottom panel.
11
 */
12
public class ActionHideShowConsole implements ActionListener {
13
    
14
    /**
15
     * Ersatz panel to display in place of tabbedpane.
16
     */
17
    private final JPanel panel;
18
    
19
    /**
20
     * Create the hide/show bottom panel action.
21
     */
22
    public ActionHideShowConsole(JPanel panel) {
23
        this.panel = panel;
24
    }
25
26
    /**
27
     * Hide bottom panel if both main and bottom are visible, also
28
     * displays an ersatz bar replacing tabbedpane.
29
     * Or else if only main panel is visible then displays bottom panel
30
     * and hide ersatz panel.
31
     */
32
    @Override
33
    public void actionPerformed(ActionEvent e) {
34
        var split = MediatorHelper.frame().getSplitNS();
35 2 1. actionPerformed : negated conditional → NO_COVERAGE
2. actionPerformed : negated conditional → NO_COVERAGE
        if (split.getTopComponent().isVisible() && split.getBottomComponent().isVisible()) {
36 1 1. actionPerformed : removed call to com/jsql/view/swing/panel/PanelConsoles::setDividerLocation → NO_COVERAGE
            MediatorHelper.panelConsoles().setDividerLocation(split.getDividerLocation());
37 1 1. actionPerformed : removed call to java/awt/Component::setVisible → NO_COVERAGE
            split.getBottomComponent().setVisible(false);
38 1 1. actionPerformed : removed call to javax/swing/JPanel::setVisible → NO_COVERAGE
            this.panel.setVisible(true);
39 1 1. actionPerformed : removed call to com/jsql/view/swing/panel/split/SplitNS::setDividerSize → NO_COVERAGE
            split.setDividerSize(0);  // required to hide bar
40
        } else if (
41 1 1. actionPerformed : negated conditional → NO_COVERAGE
            this.panel.isVisible()
42 1 1. actionPerformed : negated conditional → NO_COVERAGE
            || !split.getTopComponent().isVisible()
43 1 1. actionPerformed : negated conditional → NO_COVERAGE
            && split.getBottomComponent().isVisible()
44
        ) {
45 1 1. actionPerformed : removed call to java/awt/Component::setVisible → NO_COVERAGE
            split.getBottomComponent().setVisible(true);
46 1 1. actionPerformed : removed call to java/awt/Component::setVisible → NO_COVERAGE
            split.getTopComponent().setVisible(true);
47 1 1. actionPerformed : removed call to javax/swing/JPanel::setVisible → NO_COVERAGE
            this.panel.setVisible(false);
48 1 1. actionPerformed : removed call to com/jsql/view/swing/panel/split/SplitNS::setDividerLocation → NO_COVERAGE
            split.setDividerLocation(MediatorHelper.panelConsoles().getDividerLocation());
49 1 1. actionPerformed : removed call to com/jsql/view/swing/panel/split/SplitNS::setDividerSize → NO_COVERAGE
            split.setDividerSize(UIManager.getInt("SplitPane.dividerSize"));
50 1 1. actionPerformed : removed call to javax/swing/JLabel::setVisible → NO_COVERAGE
            MediatorHelper.panelConsoles().getLabelShowNorth().setVisible(true);
51
        }
52
    }
53
}

Mutations

35

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

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

36

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/panel/PanelConsoles::setDividerLocation → NO_COVERAGE

37

1.1
Location : actionPerformed
Killed by : none
removed call to java/awt/Component::setVisible → NO_COVERAGE

38

1.1
Location : actionPerformed
Killed by : none
removed call to javax/swing/JPanel::setVisible → NO_COVERAGE

39

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/panel/split/SplitNS::setDividerSize → NO_COVERAGE

41

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

42

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

43

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

45

1.1
Location : actionPerformed
Killed by : none
removed call to java/awt/Component::setVisible → NO_COVERAGE

46

1.1
Location : actionPerformed
Killed by : none
removed call to java/awt/Component::setVisible → NO_COVERAGE

47

1.1
Location : actionPerformed
Killed by : none
removed call to javax/swing/JPanel::setVisible → NO_COVERAGE

48

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/panel/split/SplitNS::setDividerLocation → NO_COVERAGE

49

1.1
Location : actionPerformed
Killed by : none
removed call to com/jsql/view/swing/panel/split/SplitNS::setDividerSize → NO_COVERAGE

50

1.1
Location : actionPerformed
Killed by : none
removed call to javax/swing/JLabel::setVisible → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.19.1