Extracts a ServerHandler from the Server class to reduce complexity
This commit is contained in:
@ -3,7 +3,7 @@ package net.knarcraft.minecraftserverlauncher.userinterface;
|
||||
import net.knarcraft.minecraftserverlauncher.Main;
|
||||
import net.knarcraft.minecraftserverlauncher.profile.Collection;
|
||||
import net.knarcraft.minecraftserverlauncher.profile.ServerLauncherController;
|
||||
import net.knarcraft.minecraftserverlauncher.server.Server;
|
||||
import net.knarcraft.minecraftserverlauncher.server.ServerHandler;
|
||||
import net.knarcraft.minecraftserverlauncher.utility.CommonFunctions;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@ -327,7 +327,7 @@ public class ServerLauncherGUI extends MessageHandler implements ActionListener,
|
||||
private void handleMainTabButtons(Object actionSource) {
|
||||
if (actionSource == startServerButton) {
|
||||
controller.saveState();
|
||||
Executors.newSingleThreadExecutor().execute(Server::startServers);
|
||||
Executors.newSingleThreadExecutor().execute(ServerHandler::startServers);
|
||||
} else if (actionSource == stopServerButton) {
|
||||
stopServers();
|
||||
} else if (actionSource == addServerButton) {
|
||||
@ -404,7 +404,7 @@ public class ServerLauncherGUI extends MessageHandler implements ActionListener,
|
||||
public void stopServers() {
|
||||
try {
|
||||
setStatus("Servers are stopping...");
|
||||
Server.stop();
|
||||
ServerHandler.stop();
|
||||
} catch (IOException e1) {
|
||||
showError("Could not stop server.");
|
||||
e1.printStackTrace();
|
||||
|
@ -1,7 +1,7 @@
|
||||
package net.knarcraft.minecraftserverlauncher.userinterface;
|
||||
|
||||
import net.knarcraft.minecraftserverlauncher.Main;
|
||||
import net.knarcraft.minecraftserverlauncher.server.Server;
|
||||
import net.knarcraft.minecraftserverlauncher.server.ServerHandler;
|
||||
import net.knarcraft.minecraftserverlauncher.server.ServerTypeHandler;
|
||||
import net.knarcraft.minecraftserverlauncher.server.servertypes.ServerType;
|
||||
|
||||
@ -76,7 +76,7 @@ public class ServerTab implements ActionListener {
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, lblMaxRam, 6, SpringLayout.EAST, serverTypes);
|
||||
panel.add(lblMaxRam);
|
||||
|
||||
maxRam = new JComboBox<>(Server.getRamList());
|
||||
maxRam = new JComboBox<>(ServerHandler.getRamList());
|
||||
sl_panel_3.putConstraint(SpringLayout.NORTH, maxRam, 0, SpringLayout.NORTH, serverTypes);
|
||||
sl_panel_3.putConstraint(SpringLayout.WEST, maxRam, 6, SpringLayout.EAST, lblMaxRam);
|
||||
sl_panel_3.putConstraint(SpringLayout.EAST, maxRam, -10, SpringLayout.EAST, panel);
|
||||
|
Reference in New Issue
Block a user