2018-01-30 19:35:42 +01:00
|
|
|
package net.knarcraft.serverlauncher.userinterface;
|
|
|
|
|
|
|
|
import javax.swing.JFrame;
|
|
|
|
import javax.swing.JTabbedPane;
|
|
|
|
import java.awt.BorderLayout;
|
2018-01-30 19:46:14 +01:00
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A parent window for server consoles
|
|
|
|
* Should be toggled with the "View server consoles" button
|
|
|
|
* Keeps track of all consoles
|
|
|
|
*
|
|
|
|
* @author Kristian Knarvik <kristian.knarvik@knett.no>
|
|
|
|
* @version 0.0.0.1
|
|
|
|
* @since 0.0.0.1
|
|
|
|
*/
|
2018-01-30 19:35:42 +01:00
|
|
|
public class ServerConsoles {
|
|
|
|
private static ServerConsoles serverConsoles;
|
2018-01-30 23:38:22 +01:00
|
|
|
private final JFrame frame;
|
|
|
|
private final JTabbedPane consolesTab;
|
2018-01-30 19:35:42 +01:00
|
|
|
|
|
|
|
public ServerConsoles() {
|
|
|
|
frame = new JFrame();
|
|
|
|
frame.setBounds(100, 100, 450, 300);
|
|
|
|
frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
|
|
|
|
|
|
|
|
consolesTab = new JTabbedPane(JTabbedPane.TOP);
|
|
|
|
frame.getContentPane().add(consolesTab, BorderLayout.CENTER);
|
|
|
|
serverConsoles = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static ServerConsoles getGUI() {
|
|
|
|
return serverConsoles;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void show() {
|
|
|
|
frame.setVisible(true);
|
|
|
|
}
|
|
|
|
|
2018-01-31 17:40:28 +01:00
|
|
|
public Console addTab(String name) {
|
|
|
|
return new Console(consolesTab, name);
|
2018-01-30 19:35:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|