Resizable GUI and fonts.
Contributed by Sahar.
This commit is contained in:
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -57,7 +59,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -83,41 +84,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -286,8 +264,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -307,27 +304,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -57,7 +59,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -83,41 +84,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -286,8 +264,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -307,27 +304,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -57,7 +59,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -83,41 +84,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -286,8 +264,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -307,27 +304,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -57,7 +59,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -83,41 +84,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -286,8 +264,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -307,27 +304,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -56,7 +58,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -82,41 +83,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -254,8 +232,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -275,27 +272,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -52,7 +55,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -72,41 +74,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -200,8 +179,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -221,19 +219,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -57,7 +59,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -83,41 +84,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -286,8 +264,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -307,27 +304,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -56,7 +58,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -82,41 +83,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -274,8 +252,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -295,27 +292,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -17,8 +17,11 @@
|
|||||||
package com.l2jmobius.gameserver.ui;
|
package com.l2jmobius.gameserver.ui;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -38,7 +41,6 @@ import javax.swing.JPanel;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
@@ -56,7 +58,6 @@ import com.l2jmobius.gameserver.util.Util;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmGameServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
final static String[] shutdownOptions =
|
final static String[] shutdownOptions =
|
||||||
@@ -82,41 +83,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmGameServer = new JFrame();
|
// Initialize console.
|
||||||
frmGameServer.setVisible(false);
|
|
||||||
frmGameServer.setTitle("Mobius - GameServer");
|
|
||||||
frmGameServer.setResizable(false);
|
|
||||||
frmGameServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmGameServer.getContentPane().setLayout(null);
|
|
||||||
frmGameServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmGameServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
Shutdown.getInstance().startShutdown(null, 1, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmGameServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmGameServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -274,8 +252,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnAnnounce.add(mntmCritical);
|
mnAnnounce.add(mntmCritical);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -295,27 +292,49 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmGameServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// System Panel.
|
// Set Panels.
|
||||||
JPanel systemPanel = new SystemPanel();
|
JPanel systemPanel = new SystemPanel();
|
||||||
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
JLayeredPane layeredPanel = new JLayeredPane();
|
JLayeredPane layeredPanel = new JLayeredPane();
|
||||||
frmGameServer.getContentPane().add(layeredPanel, BorderLayout.CENTER);
|
|
||||||
layeredPanel.setBounds(0, 0, 819, 566);
|
|
||||||
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
layeredPanel.add(scrollPanel, new Integer(0), 0);
|
||||||
layeredPanel.add(systemPanel, new Integer(1), 0);
|
layeredPanel.add(systemPanel, new Integer(1), 0);
|
||||||
|
|
||||||
// Center frame to screen.
|
// Set frame.
|
||||||
frmGameServer.setLocationRelativeTo(null);
|
JFrame frame = new JFrame("Mobius - GameServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
// Limit console lines to 500.
|
{
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
Shutdown.getInstance().startShutdown(null, 1, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
systemPanel.setLocation(frame.getContentPane().getWidth() - systemPanel.getWidth() - 34, systemPanel.getY());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(layeredPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmGameServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.ui;
|
package com.l2jmobius.loginserver.ui;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
|
import java.awt.event.ComponentAdapter;
|
||||||
|
import java.awt.event.ComponentEvent;
|
||||||
import java.awt.event.WindowAdapter;
|
import java.awt.event.WindowAdapter;
|
||||||
import java.awt.event.WindowEvent;
|
import java.awt.event.WindowEvent;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@@ -36,7 +40,6 @@ import javax.swing.JOptionPane;
|
|||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.JTextArea;
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.WindowConstants;
|
|
||||||
|
|
||||||
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
import com.l2jmobius.commons.util.LimitLinesDocumentListener;
|
||||||
import com.l2jmobius.commons.util.SplashScreen;
|
import com.l2jmobius.commons.util.SplashScreen;
|
||||||
@@ -51,7 +54,6 @@ import com.l2jmobius.loginserver.network.gameserverpackets.ServerStatus;
|
|||||||
*/
|
*/
|
||||||
public class Gui
|
public class Gui
|
||||||
{
|
{
|
||||||
JFrame frmLoginServer;
|
|
||||||
JTextArea txtrConsole;
|
JTextArea txtrConsole;
|
||||||
|
|
||||||
JCheckBoxMenuItem chckbxmntmEnabled;
|
JCheckBoxMenuItem chckbxmntmEnabled;
|
||||||
@@ -71,41 +73,18 @@ public class Gui
|
|||||||
|
|
||||||
public Gui()
|
public Gui()
|
||||||
{
|
{
|
||||||
frmLoginServer = new JFrame();
|
// Initialize console.
|
||||||
frmLoginServer.setVisible(false);
|
|
||||||
frmLoginServer.setTitle("Mobius - LoginServer");
|
|
||||||
frmLoginServer.setResizable(false);
|
|
||||||
frmLoginServer.setBounds(100, 100, 825, 618);
|
|
||||||
frmLoginServer.getContentPane().setLayout(null);
|
|
||||||
frmLoginServer.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
|
||||||
frmLoginServer.addWindowListener(new WindowAdapter()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void windowClosing(WindowEvent ev)
|
|
||||||
{
|
|
||||||
if (JOptionPane.showOptionDialog(null, "Shutdown LoginServer?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
|
||||||
{
|
|
||||||
LoginServer.getInstance().shutdown(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
JScrollPane scrollPanel = new JScrollPane();
|
|
||||||
scrollPanel.setBounds(10, 11, 799, 544);
|
|
||||||
frmLoginServer.getContentPane().add(scrollPanel);
|
|
||||||
|
|
||||||
txtrConsole = new JTextArea();
|
txtrConsole = new JTextArea();
|
||||||
txtrConsole.setWrapStyleWord(true);
|
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setEditable(false);
|
||||||
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
|
||||||
scrollPanel.setViewportView(txtrConsole);
|
|
||||||
txtrConsole.setDropMode(DropMode.INSERT);
|
|
||||||
txtrConsole.setLineWrap(true);
|
txtrConsole.setLineWrap(true);
|
||||||
txtrConsole.setEditable(false);
|
txtrConsole.setWrapStyleWord(true);
|
||||||
|
txtrConsole.setDropMode(DropMode.INSERT);
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, 16));
|
||||||
|
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
||||||
|
|
||||||
|
// Initialize menu items.
|
||||||
JMenuBar menuBar = new JMenuBar();
|
JMenuBar menuBar = new JMenuBar();
|
||||||
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
menuBar.setFont(new Font("Segoe UI", Font.PLAIN, 14));
|
||||||
frmLoginServer.setJMenuBar(menuBar);
|
|
||||||
|
|
||||||
JMenu mnActions = new JMenu("Actions");
|
JMenu mnActions = new JMenu("Actions");
|
||||||
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnActions.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -199,8 +178,27 @@ public class Gui
|
|||||||
});
|
});
|
||||||
mnStatus.add(chckbxmntmGmOnly);
|
mnStatus.add(chckbxmntmGmOnly);
|
||||||
|
|
||||||
// Align menu items bar to right after this.
|
JMenu mnFont = new JMenu("Font");
|
||||||
// menuBar.add(Box.createHorizontalGlue());
|
mnFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
menuBar.add(mnFont);
|
||||||
|
|
||||||
|
String[] fonts =
|
||||||
|
{
|
||||||
|
"16",
|
||||||
|
"21",
|
||||||
|
"27",
|
||||||
|
"33"
|
||||||
|
};
|
||||||
|
for (String font : fonts)
|
||||||
|
{
|
||||||
|
JMenuItem mntmFont = new JMenuItem(font);
|
||||||
|
mntmFont.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
|
mntmFont.addActionListener(arg0 ->
|
||||||
|
{
|
||||||
|
txtrConsole.setFont(new Font("Monospaced", Font.PLAIN, Integer.parseInt(font)));
|
||||||
|
});
|
||||||
|
mnFont.add(mntmFont);
|
||||||
|
}
|
||||||
|
|
||||||
JMenu mnHelp = new JMenu("Help");
|
JMenu mnHelp = new JMenu("Help");
|
||||||
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
mnHelp.setFont(new Font("Segoe UI", Font.PLAIN, 13));
|
||||||
@@ -220,19 +218,43 @@ public class Gui
|
|||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_32x32.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_64x64.png").getImage());
|
||||||
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
icons.add(new ImageIcon("..\\images\\l2jmobius_128x128.png").getImage());
|
||||||
frmLoginServer.setIconImages(icons);
|
|
||||||
|
|
||||||
// Center frame to screen.
|
JScrollPane scrollPanel = new JScrollPane(txtrConsole);
|
||||||
frmLoginServer.setLocationRelativeTo(null);
|
scrollPanel.setBounds(0, 0, 800, 550);
|
||||||
|
|
||||||
// Limit console lines to 500.
|
// Set frame.
|
||||||
txtrConsole.getDocument().addDocumentListener(new LimitLinesDocumentListener(500));
|
JFrame frame = new JFrame("Mobius - LoginServer");
|
||||||
|
frame.addWindowListener(new WindowAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent ev)
|
||||||
|
{
|
||||||
|
if (JOptionPane.showOptionDialog(null, "Shutdown server immediately?", "Select an option", JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, shutdownOptions, shutdownOptions[1]) == 0)
|
||||||
|
{
|
||||||
|
LoginServer.getInstance().shutdown(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.addComponentListener(new ComponentAdapter()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void componentResized(ComponentEvent ev)
|
||||||
|
{
|
||||||
|
scrollPanel.setSize(frame.getContentPane().getSize());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
frame.setJMenuBar(menuBar);
|
||||||
|
frame.setIconImages(icons);
|
||||||
|
frame.add(scrollPanel, BorderLayout.CENTER);
|
||||||
|
frame.getContentPane().setPreferredSize(new Dimension(800, 550));
|
||||||
|
frame.pack();
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
|
||||||
// Redirect output to text area.
|
// Redirect output to text area.
|
||||||
redirectSystemStreams();
|
redirectSystemStreams();
|
||||||
|
|
||||||
// Show SplashScreen.
|
// Show SplashScreen.
|
||||||
new SplashScreen("..\\images\\splash.png", 5000, frmLoginServer);
|
new SplashScreen("..\\images\\splash.png", 5000, frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set where the text is redirected. In this case, txtrConsole.
|
// Set where the text is redirected. In this case, txtrConsole.
|
||||||
|
Reference in New Issue
Block a user