Changes some variable names

This commit is contained in:
Kristian Knarvik 2021-10-01 01:09:34 +02:00
parent 9f092a73fe
commit 3467c900f0
2 changed files with 40 additions and 42 deletions

View File

@ -21,7 +21,7 @@ public class ControlPanelTab implements ActionListener {
private JComboBox<String> profiles; private JComboBox<String> profiles;
private final JPanel controlPanelPanel; private final JPanel controlPanelPanel;
private final ServerLauncherController controller; private final ServerLauncherController controller;
private final JLabel lblStatusLabel = new JLabel("Servers are stopped"); private final JLabel statusLabel = new JLabel("Servers are stopped");
public ControlPanelTab(JPanel controlPanelPanel) { public ControlPanelTab(JPanel controlPanelPanel) {
this.controlPanelPanel = controlPanelPanel; this.controlPanelPanel = controlPanelPanel;
@ -34,7 +34,7 @@ public class ControlPanelTab implements ActionListener {
* @param text <p>The new text of the status label</p> * @param text <p>The new text of the status label</p>
*/ */
public void setStatusText(String text) { public void setStatusText(String text) {
this.lblStatusLabel.setText(text); this.statusLabel.setText(text);
} }
/** /**
@ -126,59 +126,59 @@ public class ControlPanelTab implements ActionListener {
} }
private void initialize() { private void initialize() {
SpringLayout sl_panel = new SpringLayout(); SpringLayout springLayout = new SpringLayout();
controlPanelPanel.setLayout(sl_panel); controlPanelPanel.setLayout(springLayout);
JLabel lblBasicControls = new JLabel("Basic controls"); JLabel lblBasicControls = new JLabel("Basic controls");
sl_panel.putConstraint(SpringLayout.NORTH, lblBasicControls, 10, SpringLayout.NORTH, controlPanelPanel); springLayout.putConstraint(SpringLayout.NORTH, lblBasicControls, 10, SpringLayout.NORTH, controlPanelPanel);
controlPanelPanel.add(lblBasicControls); controlPanelPanel.add(lblBasicControls);
startServerButton = new JButton("Start servers"); startServerButton = new JButton("Start servers");
sl_panel.putConstraint(SpringLayout.WEST, lblBasicControls, 0, SpringLayout.WEST, startServerButton); springLayout.putConstraint(SpringLayout.WEST, lblBasicControls, 0, SpringLayout.WEST, startServerButton);
sl_panel.putConstraint(SpringLayout.NORTH, startServerButton, 6, SpringLayout.SOUTH, lblBasicControls); springLayout.putConstraint(SpringLayout.NORTH, startServerButton, 6, SpringLayout.SOUTH, lblBasicControls);
sl_panel.putConstraint(SpringLayout.WEST, startServerButton, 10, SpringLayout.WEST, controlPanelPanel); springLayout.putConstraint(SpringLayout.WEST, startServerButton, 10, SpringLayout.WEST, controlPanelPanel);
controlPanelPanel.add(startServerButton); controlPanelPanel.add(startServerButton);
startServerButton.addActionListener(this); startServerButton.addActionListener(this);
stopServerButton = new JButton("Stop servers"); stopServerButton = new JButton("Stop servers");
sl_panel.putConstraint(SpringLayout.NORTH, stopServerButton, 0, SpringLayout.NORTH, startServerButton); springLayout.putConstraint(SpringLayout.NORTH, stopServerButton, 0, SpringLayout.NORTH, startServerButton);
sl_panel.putConstraint(SpringLayout.WEST, stopServerButton, 6, SpringLayout.EAST, startServerButton); springLayout.putConstraint(SpringLayout.WEST, stopServerButton, 6, SpringLayout.EAST, startServerButton);
controlPanelPanel.add(stopServerButton); controlPanelPanel.add(stopServerButton);
stopServerButton.addActionListener(this); stopServerButton.addActionListener(this);
JLabel lblProfile = new JLabel("Profile"); JLabel lblProfile = new JLabel("Profile");
sl_panel.putConstraint(SpringLayout.NORTH, lblProfile, 6, SpringLayout.SOUTH, startServerButton); springLayout.putConstraint(SpringLayout.NORTH, lblProfile, 6, SpringLayout.SOUTH, startServerButton);
sl_panel.putConstraint(SpringLayout.WEST, lblProfile, 10, SpringLayout.WEST, controlPanelPanel); springLayout.putConstraint(SpringLayout.WEST, lblProfile, 10, SpringLayout.WEST, controlPanelPanel);
controlPanelPanel.add(lblProfile); controlPanelPanel.add(lblProfile);
addProfileButton = new JButton("+"); addProfileButton = new JButton("+");
sl_panel.putConstraint(SpringLayout.NORTH, addProfileButton, 6, SpringLayout.SOUTH, lblProfile); springLayout.putConstraint(SpringLayout.NORTH, addProfileButton, 6, SpringLayout.SOUTH, lblProfile);
sl_panel.putConstraint(SpringLayout.WEST, addProfileButton, 10, SpringLayout.WEST, controlPanelPanel); springLayout.putConstraint(SpringLayout.WEST, addProfileButton, 10, SpringLayout.WEST, controlPanelPanel);
controlPanelPanel.add(addProfileButton); controlPanelPanel.add(addProfileButton);
addProfileButton.addActionListener(this); addProfileButton.addActionListener(this);
deleteProfileButton = new JButton("-"); deleteProfileButton = new JButton("-");
sl_panel.putConstraint(SpringLayout.NORTH, deleteProfileButton, 0, SpringLayout.NORTH, addProfileButton); springLayout.putConstraint(SpringLayout.NORTH, deleteProfileButton, 0, SpringLayout.NORTH, addProfileButton);
sl_panel.putConstraint(SpringLayout.WEST, deleteProfileButton, 6, SpringLayout.EAST, addProfileButton); springLayout.putConstraint(SpringLayout.WEST, deleteProfileButton, 6, SpringLayout.EAST, addProfileButton);
controlPanelPanel.add(deleteProfileButton); controlPanelPanel.add(deleteProfileButton);
deleteProfileButton.addActionListener(this); deleteProfileButton.addActionListener(this);
profiles = new JComboBox<>(); profiles = new JComboBox<>();
sl_panel.putConstraint(SpringLayout.NORTH, profiles, 0, SpringLayout.NORTH, addProfileButton); springLayout.putConstraint(SpringLayout.NORTH, profiles, 0, SpringLayout.NORTH, addProfileButton);
sl_panel.putConstraint(SpringLayout.WEST, profiles, 6, SpringLayout.EAST, deleteProfileButton); springLayout.putConstraint(SpringLayout.WEST, profiles, 6, SpringLayout.EAST, deleteProfileButton);
sl_panel.putConstraint(SpringLayout.EAST, profiles, 124, SpringLayout.EAST, deleteProfileButton); springLayout.putConstraint(SpringLayout.EAST, profiles, 124, SpringLayout.EAST, deleteProfileButton);
controlPanelPanel.add(profiles); controlPanelPanel.add(profiles);
profiles.addActionListener(this); profiles.addActionListener(this);
sl_panel.putConstraint(SpringLayout.NORTH, lblStatusLabel, 6, SpringLayout.SOUTH, addProfileButton); springLayout.putConstraint(SpringLayout.NORTH, statusLabel, 6, SpringLayout.SOUTH, addProfileButton);
sl_panel.putConstraint(SpringLayout.SOUTH, lblStatusLabel, -10, SpringLayout.SOUTH, controlPanelPanel); springLayout.putConstraint(SpringLayout.SOUTH, statusLabel, -10, SpringLayout.SOUTH, controlPanelPanel);
sl_panel.putConstraint(SpringLayout.WEST, lblStatusLabel, 10, SpringLayout.WEST, controlPanelPanel); springLayout.putConstraint(SpringLayout.WEST, statusLabel, 10, SpringLayout.WEST, controlPanelPanel);
sl_panel.putConstraint(SpringLayout.EAST, lblStatusLabel, -10, SpringLayout.EAST, controlPanelPanel); springLayout.putConstraint(SpringLayout.EAST, statusLabel, -10, SpringLayout.EAST, controlPanelPanel);
controlPanelPanel.add(lblStatusLabel); controlPanelPanel.add(statusLabel);
backupButton = new JButton("Backup"); backupButton = new JButton("Backup");
sl_panel.putConstraint(SpringLayout.NORTH, backupButton, 0, SpringLayout.NORTH, startServerButton); springLayout.putConstraint(SpringLayout.NORTH, backupButton, 0, SpringLayout.NORTH, startServerButton);
sl_panel.putConstraint(SpringLayout.WEST, backupButton, 6, SpringLayout.EAST, stopServerButton); springLayout.putConstraint(SpringLayout.WEST, backupButton, 6, SpringLayout.EAST, stopServerButton);
controlPanelPanel.add(backupButton); controlPanelPanel.add(backupButton);
backupButton.addActionListener(this); backupButton.addActionListener(this);
} }

View File

@ -264,25 +264,23 @@ public class ServerLauncherGUI extends MessageHandler implements ActionListener,
mainTabbedPane.addTab("Control panel", null, controlPanelPanel, null); mainTabbedPane.addTab("Control panel", null, controlPanelPanel, null);
controlPanelTab = new ControlPanelTab(controlPanelPanel); controlPanelTab = new ControlPanelTab(controlPanelPanel);
JPanel controlServers = new JPanel(); JPanel controlServersPanel = new JPanel();
mainTabbedPane.addTab("Control servers", null, controlServers, null); mainTabbedPane.addTab("Control servers", null, controlServersPanel, null);
serverControlTab = new ServerControlTab(frame, controlServersPanel);
serverControlTab = new ServerControlTab(frame, controlServers); JPanel serversPanel = new JPanel();
mainTabbedPane.addTab("Servers", null, serversPanel, null);
SpringLayout serversPanelSpringLayout = new SpringLayout();
serversPanel.setLayout(serversPanelSpringLayout);
JPanel panel_2 = new JPanel(); serversPane = new JTabbedPane(JTabbedPane.TOP);
mainTabbedPane.addTab("Servers", null, panel_2, null); serversPanelSpringLayout.putConstraint(SpringLayout.NORTH, serversPane, 0, SpringLayout.NORTH, serversPanel);
SpringLayout sl_panel_2 = new SpringLayout(); serversPanelSpringLayout.putConstraint(SpringLayout.WEST, serversPane, 0, SpringLayout.WEST, serversPanel);
panel_2.setLayout(sl_panel_2); serversPanelSpringLayout.putConstraint(SpringLayout.SOUTH, serversPane, 0, SpringLayout.SOUTH, serversPanel);
serversPanelSpringLayout.putConstraint(SpringLayout.EAST, serversPane, 0, SpringLayout.EAST, serversPanel);
serversPanel.add(serversPane);
JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP); serversPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
sl_panel_2.putConstraint(SpringLayout.NORTH, tabbedPane_1, 0, SpringLayout.NORTH, panel_2);
sl_panel_2.putConstraint(SpringLayout.WEST, tabbedPane_1, 0, SpringLayout.WEST, panel_2);
sl_panel_2.putConstraint(SpringLayout.SOUTH, tabbedPane_1, 0, SpringLayout.SOUTH, panel_2);
sl_panel_2.putConstraint(SpringLayout.EAST, tabbedPane_1, 0, SpringLayout.EAST, panel_2);
panel_2.add(tabbedPane_1);
this.serversPane = tabbedPane_1;
tabbedPane_1.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
frame.validate(); frame.validate();
frame.pack(); frame.pack();