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 | | |
35 | var splitHorizontalTopBottom = MediatorHelper.frame().getSplitHorizontalTopBottom(); | |
36 | | |
37 | if ( | |
38 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
splitHorizontalTopBottom.getTopComponent().isVisible() |
39 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
&& splitHorizontalTopBottom.getBottomComponent().isVisible() |
40 | ) { | |
41 | | |
42 |
1
1. actionPerformed : removed call to com/jsql/view/swing/panel/PanelConsoles::setDividerLocation → NO_COVERAGE |
MediatorHelper.panelConsoles().setDividerLocation(splitHorizontalTopBottom.getDividerLocation()); |
43 |
1
1. actionPerformed : removed call to java/awt/Component::setVisible → NO_COVERAGE |
splitHorizontalTopBottom.getBottomComponent().setVisible(false); |
44 |
1
1. actionPerformed : removed call to javax/swing/JPanel::setVisible → NO_COVERAGE |
this.panel.setVisible(true); |
45 |
1
1. actionPerformed : removed call to com/jsql/view/swing/panel/split/SplitHorizontalTopBottom::disableDragSize → NO_COVERAGE |
splitHorizontalTopBottom.disableDragSize(); |
46 | | |
47 | } else if ( | |
48 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
this.panel.isVisible() |
49 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
|| !splitHorizontalTopBottom.getTopComponent().isVisible() |
50 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
&& splitHorizontalTopBottom.getBottomComponent().isVisible() |
51 | ) { | |
52 | | |
53 |
1
1. actionPerformed : removed call to java/awt/Component::setVisible → NO_COVERAGE |
splitHorizontalTopBottom.getBottomComponent().setVisible(true); |
54 |
1
1. actionPerformed : removed call to java/awt/Component::setVisible → NO_COVERAGE |
splitHorizontalTopBottom.getTopComponent().setVisible(true); |
55 |
1
1. actionPerformed : removed call to javax/swing/JPanel::setVisible → NO_COVERAGE |
this.panel.setVisible(false); |
56 |
1
1. actionPerformed : removed call to com/jsql/view/swing/panel/split/SplitHorizontalTopBottom::setDividerLocation → NO_COVERAGE |
splitHorizontalTopBottom.setDividerLocation(MediatorHelper.panelConsoles().getDividerLocation()); |
57 |
1
1. actionPerformed : removed call to com/jsql/view/swing/panel/split/SplitHorizontalTopBottom::enableDragSize → NO_COVERAGE |
splitHorizontalTopBottom.enableDragSize(); |
58 |
1
1. actionPerformed : removed call to javax/swing/plaf/basic/BasicArrowButton::setVisible → NO_COVERAGE |
MediatorHelper.panelConsoles().getButtonShowNorth().setVisible(true); |
59 | } | |
60 | } | |
61 | } | |
Mutations | ||
38 |
1.1 |
|
39 |
1.1 |
|
42 |
1.1 |
|
43 |
1.1 |
|
44 |
1.1 |
|
45 |
1.1 |
|
48 |
1.1 |
|
49 |
1.1 |
|
50 |
1.1 |
|
53 |
1.1 |
|
54 |
1.1 |
|
55 |
1.1 |
|
56 |
1.1 |
|
57 |
1.1 |
|
58 |
1.1 |