JAL-1588 check Chimera session file still exists
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 9 Jan 2015 08:31:08 +0000 (08:31 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 9 Jan 2015 08:31:08 +0000 (08:31 +0000)
src/jalview/gui/Jalview2XML.java

index 9ba8fb7..563429f 100644 (file)
@@ -3231,8 +3231,18 @@ public class Jalview2XML
   protected void createChimeraViewer(Entry<String, ViewerData> viewerData,
           AlignFrame af)
   {
-    final ViewerData svattrib = viewerData.getValue();
-    ChimeraViewFrame cvf = new ChimeraViewFrame(svattrib, af);
+    final ViewerData data = viewerData.getValue();
+    String chimeraSession = data.stateData;
+    if (new File(chimeraSession).exists())
+    {
+      // TODO can/should this be done via StructureViewer (like Jmol)?
+      ChimeraViewFrame cvf = new ChimeraViewFrame(data, af);
+    }
+    else
+    {
+      Cache.log.error("Chimera session file " + chimeraSession
+              + " not found");
+    }
   }
 
   /**