mirror of
https://github.com/correl/mage.git
synced 2024-12-24 03:00:14 +00:00
* Simplified version info handling.
This commit is contained in:
parent
c397a8eac2
commit
d4592b2ee2
6 changed files with 21 additions and 16 deletions
|
@ -151,7 +151,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
private static final Preferences prefs = Preferences.userNodeForPackage(MageFrame.class);
|
||||
private JLabel title;
|
||||
private Rectangle titleRectangle;
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, "");
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, MageVersion.MAGE_VERSION_INFO);
|
||||
private UUID clientId;
|
||||
private static MagePane activeFrame;
|
||||
private static boolean liteMode = false;
|
||||
|
|
|
@ -30,17 +30,17 @@ public class MultiConnectTest {
|
|||
|
||||
private static final CountDownLatch latch = new CountDownLatch(USER_CONNECT_COUNT);
|
||||
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, "");
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, MageVersion.MAGE_VERSION_INFO);
|
||||
|
||||
private static volatile int connected;
|
||||
|
||||
private Object sync = new Object();
|
||||
private final Object sync = new Object();
|
||||
private MageUI ui;
|
||||
|
||||
private class ClientMock implements MageClient {
|
||||
|
||||
private Session session;
|
||||
private String username;
|
||||
private final String username;
|
||||
|
||||
public ClientMock(String username) {
|
||||
this.username = username;
|
||||
|
|
|
@ -36,9 +36,11 @@ import java.io.Serializable;
|
|||
*/
|
||||
public class MageVersion implements Serializable, Comparable<MageVersion> {
|
||||
|
||||
private int major;
|
||||
private int minor;
|
||||
private int patch;
|
||||
public final static String MAGE_VERSION_INFO = "";
|
||||
|
||||
private final int major;
|
||||
private final int minor;
|
||||
private final int patch;
|
||||
|
||||
private String info = "";
|
||||
|
||||
|
@ -68,12 +70,15 @@ public class MageVersion implements Serializable, Comparable<MageVersion> {
|
|||
|
||||
@Override
|
||||
public int compareTo(MageVersion o) {
|
||||
if (major != o.major)
|
||||
if (major != o.major) {
|
||||
return major - o.major;
|
||||
if (minor != o.minor)
|
||||
}
|
||||
if (minor != o.minor) {
|
||||
return minor - o.minor;
|
||||
if (patch != o.patch)
|
||||
}
|
||||
if (patch != o.patch) {
|
||||
return patch - o.patch;
|
||||
}
|
||||
return info.compareTo(o.info);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,8 +58,8 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
private static Session session;
|
||||
private ConnectDialog connectDialog;
|
||||
private static Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class);
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, "");
|
||||
private static final Preferences prefs = Preferences.userNodeForPackage(ConsoleFrame.class);
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, MageVersion.MAGE_VERSION_INFO);
|
||||
|
||||
/**
|
||||
* @return the session
|
||||
|
|
|
@ -78,7 +78,7 @@ import org.w3c.dom.Element;
|
|||
public class Main {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Main.class);
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, "");
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, MageVersion.MAGE_VERSION_INFO);
|
||||
|
||||
private static final String testModeArg = "-testMode=";
|
||||
private static final String adminPasswordArg = "-adminPassword=";
|
||||
|
|
|
@ -15,12 +15,12 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class SimpleMageClient implements MageClient {
|
||||
|
||||
private UUID clientId;
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, "");
|
||||
private final UUID clientId;
|
||||
private static final MageVersion version = new MageVersion(1, 3, 0, MageVersion.MAGE_VERSION_INFO);
|
||||
|
||||
private static final transient Logger log = Logger.getLogger(SimpleMageClient.class);
|
||||
|
||||
private CallbackClient callbackClient;
|
||||
private final CallbackClient callbackClient;
|
||||
|
||||
public SimpleMageClient() {
|
||||
clientId = UUID.randomUUID();
|
||||
|
|
Loading…
Reference in a new issue