1 package com.jsql.view.swing.panel.split;
2
3 import com.jsql.view.swing.util.MediatorHelper;
4
5 import java.awt.event.ActionEvent;
6 import java.awt.event.ActionListener;
7
8
9
10
11 public class ActionHideShowResult implements ActionListener {
12
13
14
15
16
17
18
19 @Override
20 public void actionPerformed(ActionEvent e) {
21
22 var splitHorizontalTopBottom = MediatorHelper.frame().getSplitHorizontalTopBottom();
23
24 if (
25 splitHorizontalTopBottom.getTopComponent().isVisible()
26 && splitHorizontalTopBottom.getBottomComponent().isVisible()
27 ) {
28
29 MediatorHelper.panelConsoles().setDividerLocation(splitHorizontalTopBottom.getDividerLocation());
30 splitHorizontalTopBottom.getTopComponent().setVisible(false);
31 splitHorizontalTopBottom.disableDragSize();
32 MediatorHelper.panelConsoles().getButtonShowNorth().setVisible(false);
33
34 } else if (
35 splitHorizontalTopBottom.getTopComponent().isVisible()
36 && !splitHorizontalTopBottom.getBottomComponent().isVisible()
37 ) {
38
39 splitHorizontalTopBottom.setDividerLocation(MediatorHelper.panelConsoles().getDividerLocation());
40 splitHorizontalTopBottom.getBottomComponent().setVisible(true);
41 splitHorizontalTopBottom.getTopComponent().setVisible(true);
42 splitHorizontalTopBottom.enableDragSize();
43 }
44 }
45 }