From 003f3b92bdb5672e3ce961fcad6e69bc45f916b9 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 12 May 2014 15:04:54 +0100 Subject: [PATCH] patch for regression introduced JAL-1397 --- src/jalview/gui/Jalview2XML.java | 3 +-- test/jalview/io/Jalview2xmlTests.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index a1a009d..90fef07 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -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); } diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index e294616..fbfff74 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -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); + + } } -- 1.7.10.2