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
|
|
|
|
|
|
|
/**
|
2018-01-31 23:20:33 +01:00
|
|
|
* A parent window for server consoles.
|
|
|
|
* Should be toggled with the "View server consoles" button.
|
|
|
|
* Keeps track of all consoles.
|
2018-01-30 19:46:14 +01:00
|
|
|
*
|
|
|
|
* @author Kristian Knarvik <kristian.knarvik@knett.no>
|
2018-02-22 14:12:42 +01:00
|
|
|
* @version 1.0.0
|
|
|
|
* @since 1.0.0
|
2018-01-30 19:46:14 +01:00
|
|
|
*/
|
2018-01-30 19:35:42 +01:00
|
|
|
public class ServerConsoles {
|
2018-01-31 21:24:54 +01:00
|
|
|
private static JFrame frame;
|
|
|
|
private static 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);
|
|
|
|
}
|
|
|
|
|
2018-02-05 00:00:51 +01:00
|
|
|
public static Console addTab(String name) {
|
|
|
|
return new Console(consolesTab, name);
|
|
|
|
}
|
|
|
|
|
2018-01-31 21:24:54 +01:00
|
|
|
public static void show() {
|
2018-01-30 19:35:42 +01:00
|
|
|
frame.setVisible(true);
|
|
|
|
}
|
2018-02-13 12:21:39 +01:00
|
|
|
|
|
|
|
public static JTabbedPane getTab() {
|
|
|
|
return consolesTab;
|
2018-01-31 21:24:54 +01:00
|
|
|
}
|
2018-01-30 19:35:42 +01:00
|
|
|
}
|