Dont load trees if copying Viewport
authoramwaterhouse <Andrew Waterhouse>
Tue, 7 Nov 2006 16:13:42 +0000 (16:13 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 7 Nov 2006 16:13:42 +0000 (16:13 +0000)
src/jalview/gui/Jalview2XML.java

index 1e449cc..df551b7 100755 (executable)
@@ -901,7 +901,7 @@ public class Jalview2XML
                     unmar.setValidation(false);
                     object = (JalviewModel) unmar.unmarshal( in );
 
-                    af = LoadFromObject(object, file);
+                    af = LoadFromObject(object, file, true);
                     if(af.viewport.gatherViewsHere)
                     {
                       gatherToThisFrame.add(af);
@@ -1015,7 +1015,9 @@ public class Jalview2XML
     }
 
 
-    AlignFrame LoadFromObject(JalviewModel object, String file)
+    AlignFrame LoadFromObject(JalviewModel object,
+                              String file,
+                              boolean loadTrees )
     {
         SequenceSet vamsasSet = object.getVamsasModel().getSequenceSet(0);
         Sequence[] vamsasSeq = vamsasSet.getSequence();
@@ -1575,7 +1577,7 @@ public class Jalview2XML
 
         //LOAD TREES
         ///////////////////////////////////////
-        if (jms.getTreeCount() > 0)
+        if (loadTrees && jms.getTreeCount() > 0)
         {
             try
             {
@@ -1637,7 +1639,7 @@ public class Jalview2XML
 
       viewportsAdded = new Hashtable();
 
-      AlignFrame af = LoadFromObject(jm, null);
+      AlignFrame af = LoadFromObject(jm, null, false);
       af.alignPanels.clear();
       af.closeMenuItem_actionPerformed(null);