Added build time to version info, cleanup manifest files;

This commit is contained in:
Oleg Agafonov 2018-12-15 18:29:10 +04:00
parent 498edb4138
commit 0a2f312da7
19 changed files with 243 additions and 205 deletions

View file

@ -1,11 +1,3 @@
/*
* ConsoleFrame.java
*
* Created on May 13, 2011, 2:39:10 PM
*/
package mage.server.console;
import mage.interfaces.MageClient;
@ -25,7 +17,6 @@ import java.util.concurrent.TimeUnit;
import java.util.prefs.Preferences;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
@ -35,9 +26,10 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
private static Session session;
private ConnectDialog connectDialog;
private static final Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class);
private static final MageVersion version = new MageVersion(MageVersion.MAGE_VERSION_MAJOR, MageVersion.MAGE_VERSION_MINOR, MageVersion.MAGE_VERSION_PATCH, MageVersion.MAGE_VERSION_MINOR_PATCH, MageVersion.MAGE_VERSION_INFO);
private static final MageVersion version = new MageVersion(ConsoleFrame.class);
private static final ScheduledExecutorService pingTaskExecutor = Executors.newSingleThreadScheduledExecutor();
/**
* @return the session
*/
@ -54,7 +46,9 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
return version;
}
/** Creates new form ConsoleFrame */
/**
* Creates new form ConsoleFrame
*/
public ConsoleFrame() {
addWindowListener(new WindowAdapter() {
@ -72,11 +66,11 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
} catch (Exception ex) {
logger.fatal("", ex);
}
pingTaskExecutor.scheduleAtFixedRate(() -> session.ping(), 60, 60, TimeUnit.SECONDS);
}
public boolean connect(Connection connection) {
public boolean connect(Connection connection) {
if (session.connect(connection)) {
this.consolePanel1.start();
return true;
@ -100,7 +94,8 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
btnSendMessage.setEnabled(false);
}
/** This method is called from within the constructor to
/**
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
@ -143,16 +138,16 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
.addComponent(consolePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jToolBar1, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
.addComponent(consolePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 933, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(consolePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE))
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, 0)
.addComponent(consolePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 432, Short.MAX_VALUE))
);
pack();
@ -177,8 +172,8 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
}//GEN-LAST:event_btnSendMessageActionPerformed
/**
* @param args the command line arguments
*/
* @param args the command line arguments
*/
public static void main(String args[]) {
logger.info("Starting MAGE server console version " + version);
logger.info("Logging level: " + logger.getEffectiveLevel());
@ -205,9 +200,8 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
public void connected(final String message) {
if (SwingUtilities.isEventDispatchThread()) {
setStatusText(message);
enableButtons();
}
else {
enableButtons();
} else {
SwingUtilities.invokeLater(() -> {
setStatusText(message);
enableButtons();
@ -221,8 +215,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
consolePanel1.stop();
setStatusText("Not connected");
disableButtons();
}
else {
} else {
SwingUtilities.invokeLater(() -> {
consolePanel1.stop();
setStatusText("Not connected");
@ -235,8 +228,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
public void showMessage(final String message) {
if (SwingUtilities.isEventDispatchThread()) {
JOptionPane.showMessageDialog(this, message);
}
else {
} else {
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message));
}
}
@ -245,8 +237,7 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
public void showError(final String message) {
if (SwingUtilities.isEventDispatchThread()) {
JOptionPane.showMessageDialog(this, message, "Error", JOptionPane.ERROR_MESSAGE);
}
else {
} else {
SwingUtilities.invokeLater(() -> JOptionPane.showMessageDialog(getFrame(), message, "Error", JOptionPane.ERROR_MESSAGE));
}
}