patch for regression introduced JAL-1397
authorJim Procter <jprocter@dundee.ac.uk>
Mon, 12 May 2014 14:04:54 +0000 (15:04 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 12 May 2014 14:04:54 +0000 (15:04 +0100)
src/jalview/gui/Jalview2XML.java
test/jalview/io/Jalview2xmlTests.java

index a1a009d..90fef07 100644 (file)
@@ -1924,8 +1924,7 @@ public class Jalview2XML
             if (object.getJalviewModelSequence().getViewportCount() > 0)
             {
               af = _af;
-              if (object.getJalviewModelSequence().getViewportCount() > 1
-                      && af.viewport.gatherViewsHere)
+              if (af.viewport.gatherViewsHere)
               {
                 gatherToThisFrame.put(af.viewport.getSequenceSetId(), af);
               }
index e294616..fbfff74 100644 (file)
@@ -5,6 +5,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
 import jalview.schemes.AnnotationColourGradient;
 import jalview.schemes.ColourSchemeI;
 
@@ -166,4 +167,13 @@ public class Jalview2xmlTests
     assertTrue("Got Different group sequence colours", diffgseqcols);
     System.out.println("Per sequence (Group) colourscheme successfully applied and recovered.");
   }
+  @Test
+  public void gatherViewsHere() throws Exception
+  {
+    int origCount = Desktop.getAlignframes().length;
+    AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded("examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+    assertTrue("Didn't read in the example file correctly.",af!=null);
+    assertTrue("Didn't gather the views in the example file.", Desktop.getAlignframes().length==1+origCount);
+    
+  }
 }