JAL-1526 simple function to write a snapshot of the desktop.
[jalview.git] / src / jalview / gui / Desktop.java
index c3c23b0..b7057d1 100644 (file)
@@ -26,6 +26,7 @@ import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
+import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
 import jalview.ws.params.ParamManager;
 
@@ -1113,7 +1114,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     {
       message.append("<h1><strong>Version: "
               + jalview.bin.Cache.getProperty("VERSION")
-              + "</strong></h1><br>");
+              + "</strong></h1>");
       message.append("<strong>Last Updated: <em>"
               + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown")
               + "</em></strong>");
@@ -1160,11 +1161,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     message.append("<br>Authors:  "
             + jalview.bin.Cache
                     .getDefault(
-                            "AUTHORNAMES",
-                            "Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton")
-            + "<br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
-            + "<br>For help, see the FAQ at <a href=\"http://www.jalview.org\">www.jalview.org</a> and/or join the jalview-discuss@jalview.org mailing list"
-            + "<br>If  you use Jalview, please cite:"
+                            "AUTHORFNAMES",
+                            "The Jalview Authors (See AUTHORS file for current list)")
+            + "<br><br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
+            + "<br><br>For help, see the FAQ at <a href=\"http://www.jalview.org/faq\">www.jalview.org/faq</a> and/or join the jalview-discuss@jalview.org mailing list"
+            + "<br><br>If  you use Jalview, please cite:"
             + "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
             + "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
             + "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033"
@@ -2771,4 +2772,20 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     dialogPause = false;
     block.release();
   }
+  @Override
+  protected void snapShotWindow_actionPerformed(ActionEvent e)
+  {
+    invalidate();
+    File of;
+    ImageMaker im = new jalview.util.ImageMaker(this, ImageMaker.EPS, "View of Desktop", getWidth(), getHeight(), of=new File("Jalview_snapshot"+System.currentTimeMillis()+".eps"), "View of desktop");
+    try {
+      paintAll(im.getGraphics());
+      im.writeImage();
+    } catch (Exception q)
+    {
+      Cache.log.error("Couldn't write snapshot to "+of.getAbsolutePath(),q);
+      return;
+    }
+    Cache.log.info("Successfully written snapshot to file "+of.getAbsolutePath());
+  }
 }