Merge remote-tracking branch 'origin/master'

This commit is contained in:
Kristian Knarvik 2018-01-30 23:39:28 +01:00
commit 6a668a2e17
3 changed files with 34 additions and 33 deletions

View File

@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Main

View File

@ -119,14 +119,14 @@ public class GUI implements ActionListener {
* Initialize the contents of the frame. * Initialize the contents of the frame.
*/ */
private void initialize() { private void initialize() {
try { /*try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) { } catch (ClassNotFoundException | UnsupportedLookAndFeelException | InstantiationException | IllegalAccessException e) {
e.printStackTrace(); e.printStackTrace();
} }*/
frame = new JFrame("Minecraft server launcher"); frame = new JFrame("Minecraft server launcher");
frame.setBounds(100, 100, 398, 219); frame.setBounds(100, 100, 490, 219);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setResizable(false); frame.setResizable(false);
ImageIcon img; ImageIcon img;
@ -294,29 +294,29 @@ public class GUI implements ActionListener {
sl_panel_1.putConstraint(SpringLayout.NORTH, btnKick, 9, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.NORTH, btnKick, 9, SpringLayout.NORTH, controlServers);
sl_panel_1.putConstraint(SpringLayout.WEST, btnKick, 6, SpringLayout.EAST, targetServer); sl_panel_1.putConstraint(SpringLayout.WEST, btnKick, 6, SpringLayout.EAST, targetServer);
sl_panel_1.putConstraint(SpringLayout.SOUTH, btnKick, 32, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.SOUTH, btnKick, 32, SpringLayout.NORTH, controlServers);
sl_panel_1.putConstraint(SpringLayout.EAST, btnKick, 84, SpringLayout.EAST, targetServer); sl_panel_1.putConstraint(SpringLayout.EAST, btnKick, 124, SpringLayout.EAST, targetServer);
controlServers.add(btnKick); controlServers.add(btnKick);
btnKick.addActionListener(this); btnKick.addActionListener(this);
btnBan = new JButton("Ban"); btnBan = new JButton("Ban");
sl_panel_1.putConstraint(SpringLayout.NORTH, btnBan, 35, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.NORTH, btnBan, 35, SpringLayout.NORTH, controlServers);
sl_panel_1.putConstraint(SpringLayout.WEST, btnBan, 6, SpringLayout.EAST, targetPlayer); sl_panel_1.putConstraint(SpringLayout.WEST, btnBan, 6, SpringLayout.EAST, targetPlayer);
sl_panel_1.putConstraint(SpringLayout.EAST, btnBan, 84, SpringLayout.EAST, targetPlayer); sl_panel_1.putConstraint(SpringLayout.EAST, btnBan, 124, SpringLayout.EAST, targetPlayer);
controlServers.add(btnBan); controlServers.add(btnBan);
btnBan.addActionListener(this); btnBan.addActionListener(this);
btnOp = new JButton("OP"); btnOp = new JButton("OP");
sl_panel_1.putConstraint(SpringLayout.NORTH, btnOp, 9, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.NORTH, btnOp, 9, SpringLayout.NORTH, controlServers);
sl_panel_1.putConstraint(SpringLayout.WEST, btnOp, 287, SpringLayout.WEST, controlServers); sl_panel_1.putConstraint(SpringLayout.WEST, btnOp, 6, SpringLayout.EAST, btnKick);
sl_panel_1.putConstraint(SpringLayout.SOUTH, btnOp, 32, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.SOUTH, btnOp, 32, SpringLayout.NORTH, controlServers);
sl_panel_1.putConstraint(SpringLayout.EAST, btnOp, 370, SpringLayout.WEST, controlServers); sl_panel_1.putConstraint(SpringLayout.EAST, btnOp, 124, SpringLayout.EAST, btnKick);
controlServers.add(btnOp); controlServers.add(btnOp);
btnOp.addActionListener(this); btnOp.addActionListener(this);
btnDeop = new JButton("DEOP"); btnDeop = new JButton("DEOP");
sl_panel_1.putConstraint(SpringLayout.WEST, btnDeop, 287, SpringLayout.WEST, controlServers); sl_panel_1.putConstraint(SpringLayout.WEST, btnDeop, 6, SpringLayout.EAST, btnBan);
sl_panel_1.putConstraint(SpringLayout.NORTH, btnDeop, 35, SpringLayout.NORTH, controlServers); sl_panel_1.putConstraint(SpringLayout.NORTH, btnDeop, 35, SpringLayout.NORTH, controlServers);
sl_panel_1.putConstraint(SpringLayout.EAST, btnDeop, 370, SpringLayout.WEST, controlServers); sl_panel_1.putConstraint(SpringLayout.EAST, btnDeop, 124, SpringLayout.EAST, btnBan);
controlServers.add(btnDeop); controlServers.add(btnDeop);
btnDeop.addActionListener(this); btnDeop.addActionListener(this);
@ -351,13 +351,13 @@ public class GUI implements ActionListener {
sl_panel_1.putConstraint(SpringLayout.NORTH, customCommand, 6, SpringLayout.SOUTH, btnSaveserver); sl_panel_1.putConstraint(SpringLayout.NORTH, customCommand, 6, SpringLayout.SOUTH, btnSaveserver);
sl_panel_1.putConstraint(SpringLayout.NORTH, btnSaveserver, 6, SpringLayout.SOUTH, btnBan); sl_panel_1.putConstraint(SpringLayout.NORTH, btnSaveserver, 6, SpringLayout.SOUTH, btnBan);
sl_panel_1.putConstraint(SpringLayout.WEST, btnSaveserver, 0, SpringLayout.WEST, btnKick); sl_panel_1.putConstraint(SpringLayout.WEST, btnSaveserver, 0, SpringLayout.WEST, btnKick);
sl_panel_1.putConstraint(SpringLayout.EAST, btnSaveserver, 91, SpringLayout.WEST, btnKick); sl_panel_1.putConstraint(SpringLayout.EAST, btnSaveserver, 120, SpringLayout.WEST, btnKick);
controlServers.add(btnSaveserver); controlServers.add(btnSaveserver);
btnSaveserver.addActionListener(this); btnSaveserver.addActionListener(this);
btnReload = new JButton("Reload"); btnReload = new JButton("Reload");
sl_panel_1.putConstraint(SpringLayout.NORTH, btnReload, 6, SpringLayout.SOUTH, btnDeop); sl_panel_1.putConstraint(SpringLayout.NORTH, btnReload, 6, SpringLayout.SOUTH, btnDeop);
sl_panel_1.putConstraint(SpringLayout.WEST, btnReload, 10, SpringLayout.WEST, btnDeop); sl_panel_1.putConstraint(SpringLayout.WEST, btnReload, 0, SpringLayout.WEST, btnDeop);
sl_panel_1.putConstraint(SpringLayout.EAST, btnReload, 0, SpringLayout.EAST, btnOp); sl_panel_1.putConstraint(SpringLayout.EAST, btnReload, 0, SpringLayout.EAST, btnOp);
controlServers.add(btnReload); controlServers.add(btnReload);
btnReload.addActionListener(this); btnReload.addActionListener(this);
@ -377,8 +377,8 @@ public class GUI implements ActionListener {
JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP); JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP);
sl_panel_2.putConstraint(SpringLayout.NORTH, tabbedPane_1, 0, SpringLayout.NORTH, panel_2); 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.WEST, tabbedPane_1, 0, SpringLayout.WEST, panel_2);
sl_panel_2.putConstraint(SpringLayout.SOUTH, tabbedPane_1, 150, SpringLayout.NORTH, panel_2); sl_panel_2.putConstraint(SpringLayout.SOUTH, tabbedPane_1, 0, SpringLayout.SOUTH, panel_2);
sl_panel_2.putConstraint(SpringLayout.EAST, tabbedPane_1, 396, SpringLayout.WEST, panel_2); sl_panel_2.putConstraint(SpringLayout.EAST, tabbedPane_1, 0, SpringLayout.EAST, panel_2);
panel_2.add(tabbedPane_1); panel_2.add(tabbedPane_1);
this.serversPane = tabbedPane_1; this.serversPane = tabbedPane_1;

View File

@ -33,21 +33,22 @@ public class ServerTab implements ActionListener {
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerType, 30, SpringLayout.NORTH, panel); sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerType, 30, SpringLayout.NORTH, panel);
panel.add(lblServerType); panel.add(lblServerType);
serverTypes = new JComboBox<>(ServerType.getTypeNames());
sl_panel_3.putConstraint(SpringLayout.NORTH, serverTypes, 10, SpringLayout.NORTH, panel);
sl_panel_3.putConstraint(SpringLayout.WEST, serverTypes, 16, SpringLayout.EAST, lblServerType);
panel.add(serverTypes);
serverTypes.addActionListener(this);
JLabel lblServerVersion = new JLabel("Server version"); JLabel lblServerVersion = new JLabel("Server version");
sl_panel_3.putConstraint(SpringLayout.NORTH, lblServerVersion, 6, SpringLayout.SOUTH, lblServerType); sl_panel_3.putConstraint(SpringLayout.NORTH, lblServerVersion, 6, SpringLayout.SOUTH, lblServerType);
sl_panel_3.putConstraint(SpringLayout.WEST, lblServerVersion, 10, SpringLayout.WEST, panel); sl_panel_3.putConstraint(SpringLayout.WEST, lblServerVersion, 10, SpringLayout.WEST, panel);
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerVersion, 26, SpringLayout.SOUTH, lblServerType); sl_panel_3.putConstraint(SpringLayout.SOUTH, lblServerVersion, 26, SpringLayout.SOUTH, lblServerType);
panel.add(lblServerVersion); panel.add(lblServerVersion);
serverTypes = new JComboBox<>(ServerType.getTypeNames());
sl_panel_3.putConstraint(SpringLayout.NORTH, serverTypes, 10, SpringLayout.NORTH, panel);
sl_panel_3.putConstraint(SpringLayout.WEST, serverTypes, 5, SpringLayout.EAST, lblServerVersion);
panel.add(serverTypes);
serverTypes.addActionListener(this);
serverVersions = new JComboBox<>(ServerType.getServerTypes().get(0).getVersions()); serverVersions = new JComboBox<>(ServerType.getServerTypes().get(0).getVersions());
sl_panel_3.putConstraint(SpringLayout.NORTH, serverVersions, 6, SpringLayout.SOUTH, serverTypes); sl_panel_3.putConstraint(SpringLayout.NORTH, serverVersions, 6, SpringLayout.SOUTH, serverTypes);
sl_panel_3.putConstraint(SpringLayout.WEST, serverVersions, 0, SpringLayout.WEST, serverTypes); sl_panel_3.putConstraint(SpringLayout.EAST, serverVersions, 0, SpringLayout.EAST, serverTypes);
sl_panel_3.putConstraint(SpringLayout.WEST, serverVersions, 6, SpringLayout.EAST, lblServerVersion);
panel.add(serverVersions); panel.add(serverVersions);
serverVersions.addActionListener(this); serverVersions.addActionListener(this);
@ -61,7 +62,7 @@ public class ServerTab implements ActionListener {
maxRam = new JComboBox<>(Server.getRamList()); maxRam = new JComboBox<>(Server.getRamList());
sl_panel_3.putConstraint(SpringLayout.NORTH, maxRam, 10, SpringLayout.NORTH, panel); sl_panel_3.putConstraint(SpringLayout.NORTH, maxRam, 10, SpringLayout.NORTH, panel);
sl_panel_3.putConstraint(SpringLayout.WEST, maxRam, 6, SpringLayout.EAST, lblMaxRam); sl_panel_3.putConstraint(SpringLayout.WEST, maxRam, 6, SpringLayout.EAST, lblMaxRam);
sl_panel_3.putConstraint(SpringLayout.EAST, maxRam, 86, SpringLayout.EAST, lblMaxRam); sl_panel_3.putConstraint(SpringLayout.EAST, maxRam, -10, SpringLayout.EAST, panel);
panel.add(maxRam); panel.add(maxRam);
maxRam.addActionListener(this); maxRam.addActionListener(this);
@ -72,25 +73,21 @@ public class ServerTab implements ActionListener {
chckbxEnabled.addActionListener(this); chckbxEnabled.addActionListener(this);
btnRemoveServer = new JButton("Remove server"); btnRemoveServer = new JButton("Remove server");
sl_panel_3.putConstraint(SpringLayout.NORTH, btnRemoveServer, 5, SpringLayout.SOUTH, lblMaxRam); sl_panel_3.putConstraint(SpringLayout.NORTH, btnRemoveServer, 0, SpringLayout.NORTH, serverVersions);
sl_panel_3.putConstraint(SpringLayout.SOUTH, btnRemoveServer, -64, SpringLayout.SOUTH, panel); sl_panel_3.putConstraint(SpringLayout.SOUTH, btnRemoveServer, 0, SpringLayout.SOUTH, serverVersions);
sl_panel_3.putConstraint(SpringLayout.SOUTH, maxRam, -5, SpringLayout.NORTH, btnRemoveServer); sl_panel_3.putConstraint(SpringLayout.WEST, btnRemoveServer, 6, SpringLayout.EAST, serverVersions);
sl_panel_3.putConstraint(SpringLayout.EAST, serverVersions, -13, SpringLayout.WEST, btnRemoveServer); sl_panel_3.putConstraint(SpringLayout.EAST, btnRemoveServer, -10, SpringLayout.EAST, panel);
sl_panel_3.putConstraint(SpringLayout.WEST, btnRemoveServer, 239, SpringLayout.WEST, panel);
sl_panel_3.putConstraint(SpringLayout.EAST, btnRemoveServer, 0, SpringLayout.EAST, maxRam);
panel.add(btnRemoveServer); panel.add(btnRemoveServer);
btnRemoveServer.addActionListener(this); btnRemoveServer.addActionListener(this);
JLabel lblDirectory = new JLabel("Directory"); JLabel lblDirectory = new JLabel("Directory");
sl_panel_3.putConstraint(SpringLayout.NORTH, lblDirectory, 1, SpringLayout.NORTH, chckbxEnabled); sl_panel_3.putConstraint(SpringLayout.NORTH, lblDirectory, 1, SpringLayout.NORTH, chckbxEnabled);
sl_panel_3.putConstraint(SpringLayout.SOUTH, lblDirectory, 0, SpringLayout.SOUTH, chckbxEnabled); sl_panel_3.putConstraint(SpringLayout.SOUTH, lblDirectory, 0, SpringLayout.SOUTH, chckbxEnabled);
sl_panel_3.putConstraint(SpringLayout.WEST, lblDirectory, 6, SpringLayout.EAST, chckbxEnabled);
panel.add(lblDirectory); panel.add(lblDirectory);
directory = new JTextField(); directory = new JTextField();
sl_panel_3.putConstraint(SpringLayout.NORTH, directory, 4, SpringLayout.SOUTH, btnRemoveServer); sl_panel_3.putConstraint(SpringLayout.WEST, directory, 6, SpringLayout.EAST, lblDirectory);
sl_panel_3.putConstraint(SpringLayout.SOUTH, directory, -37, SpringLayout.SOUTH, panel);
sl_panel_3.putConstraint(SpringLayout.EAST, lblDirectory, -6, SpringLayout.WEST, directory);
sl_panel_3.putConstraint(SpringLayout.WEST, directory, 130, SpringLayout.WEST, panel);
panel.add(directory); panel.add(directory);
directory.setColumns(10); directory.setColumns(10);
directory.addActionListener(this); directory.addActionListener(this);
@ -98,8 +95,9 @@ public class ServerTab implements ActionListener {
btnBrowse = new JButton("Browse"); btnBrowse = new JButton("Browse");
sl_panel_3.putConstraint(SpringLayout.EAST, directory, -6, SpringLayout.WEST, btnBrowse); sl_panel_3.putConstraint(SpringLayout.EAST, directory, -6, SpringLayout.WEST, btnBrowse);
sl_panel_3.putConstraint(SpringLayout.NORTH, btnBrowse, 3, SpringLayout.SOUTH, btnRemoveServer); sl_panel_3.putConstraint(SpringLayout.NORTH, btnBrowse, 3, SpringLayout.SOUTH, btnRemoveServer);
sl_panel_3.putConstraint(SpringLayout.WEST, btnBrowse, 293, SpringLayout.WEST, panel); sl_panel_3.putConstraint(SpringLayout.EAST, btnBrowse, -10, SpringLayout.EAST, panel);
sl_panel_3.putConstraint(SpringLayout.EAST, btnBrowse, 0, SpringLayout.EAST, maxRam); sl_panel_3.putConstraint(SpringLayout.SOUTH, directory, 0, SpringLayout.SOUTH, btnBrowse);
sl_panel_3.putConstraint(SpringLayout.NORTH, directory, 0, SpringLayout.NORTH, btnBrowse);
panel.add(btnBrowse); panel.add(btnBrowse);
btnBrowse.addActionListener(this); btnBrowse.addActionListener(this);
} }