build date output in the About box, and build details output on startup when debug...
[jalview.git] / src / jalview / appletgui / AlignFrame.java
index 1bfc475..1518bb0 100755 (executable)
@@ -26,6 +26,7 @@ import java.awt.*;
 import java.awt.event.*;
 
 import jalview.analysis.*;
+import jalview.bin.JalviewLite;
 import jalview.commands.*;
 import jalview.datamodel.*;
 import jalview.io.*;
@@ -2360,10 +2361,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     class AboutPanel extends Canvas
     {
       String version;
-
-      public AboutPanel(String version)
+      String builddate;
+      public AboutPanel(String version, String builddate)
       {
         this.version = version;
+        this.builddate = builddate;
       }
 
       public void paint(Graphics g)
@@ -2379,6 +2381,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         // lite and application
         g.setFont(new Font("Helvetica", Font.BOLD, 14));
         g.drawString("JalviewLite - Release " + version, x, y += fh);
+        g.setFont(new Font("Helvetica", Font.BOLD, 12));
+        g.drawString("Build date: "+builddate, x, y += fh);
         g.setFont(new Font("Helvetica", Font.PLAIN, 12));
         g
                 .drawString(
@@ -2401,30 +2405,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
       }
     }
 
-    String version = "test";
-    java.net.URL url = getClass().getResource("/.build_properties");
-    if (url != null)
-    {
-      try
-      {
-        BufferedReader reader = new BufferedReader(new InputStreamReader(
-                url.openStream()));
-        String line;
-        while ((line = reader.readLine()) != null)
-        {
-          if (line.indexOf("VERSION") > -1)
-          {
-            version = line.substring(line.indexOf("=") + 1);
-          }
-        }
-      } catch (Exception ex)
-      {
-        ex.printStackTrace();
-      }
-    }
-
     Frame frame = new Frame();
-    frame.add(new AboutPanel(version));
+    frame.add(new AboutPanel(JalviewLite.getVersion(), JalviewLite.getBuildDate()));
     jalview.bin.JalviewLite.addFrame(frame, "Jalview", 580, 220);
 
   }