X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fproject%2FJalview2XML.java;h=cadc25316bf76411604cf6976b3a4f7d474bd0ea;hb=595a9e25db7f4f24c17de84656d7d5391a3d104d;hp=0291a0a31d0389533454420eff8bdb2b8f977b32;hpb=0031ee4b6a42ad328e417cb65c7a840183e62e87;p=jalview.git diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index 0291a0a..cadc253 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -2862,12 +2862,16 @@ public class Jalview2XML IdentityHashMap importedDatasets = new IdentityHashMap<>(); Map gatherToThisFrame = new HashMap<>(); final String file = jprovider.getFilename(); + + List alignFrames = new ArrayList<>(); + try { JarInputStream jin = null; JarEntry jarentry = null; int entryCount = 1; + // Look for all the entry names ending with ".xml" // This includes all panels and at least one frame. // Platform.timeCheck(null, Platform.TIME_MARK); @@ -2879,9 +2883,14 @@ public class Jalview2XML jarentry = jin.getNextJarEntry(); } String name = (jarentry == null ? null : jarentry.getName()); + +// System.out.println("Jalview2XML opening " + name); if (name != null && name.endsWith(".xml")) { + // DataSet for.... is read last. + + // The question here is what to do with the two // .xml files in the jvp file. // Some number of them, "...Dataset for...", will be the @@ -2911,8 +2920,14 @@ public class Jalview2XML _af = loadFromObject(model, file, true, jprovider); // Platform.timeCheck("Jalview2XML.loadFromObject", // Platform.TIME_MARK); + + if (_af != null) + { + alignFrames.add(_af); + } if (_af != null && model.getViewport().size() > 0) { + // That is, this is one of the AlignmentPanel models if (af == null) { @@ -2979,6 +2994,13 @@ public class Jalview2XML errorMessage = "Out of memory loading jalview XML file"; System.err.println("Out of memory whilst loading jalview XML file"); e.printStackTrace(); + } finally + { + for (AlignFrame alf : alignFrames) + { + alf.alignPanel.setHoldRepaint(false); + } + } /* @@ -2998,7 +3020,7 @@ public class Jalview2XML { if (ds.getCodonFrames() != null) { - Desktop.getInstance().getStructureSelectionManager() + Desktop.getStructureSelectionManager() .registerMappings(ds.getCodonFrames()); } } @@ -3519,7 +3541,7 @@ public class Jalview2XML // now, for 2.10 projects, this is also done if the xml doc includes // dataset sequences not actually present in any particular view. // - Platform.timeCheck("J2XML features0", Platform.TIME_MARK); +// Platform.timeCheck("J2XML features0", Platform.TIME_RESET); for (int i = 0; i < vamsasSeqs.size(); i++) { JSeq jseq = jseqs.get(i); @@ -3574,11 +3596,11 @@ public class Jalview2XML } // adds feature to datasequence's feature set (since Jalview 2.10) +// Platform.timeCheck(null, Platform.TIME_SET); al.getSequenceAt(i).addSequenceFeature(sf); +// Platform.timeCheck(null, Platform.TIME_MARK); } } - Platform.timeCheck("J2XML features done", Platform.TIME_MARK); - if (vamsasSeqs.get(i).getDBRef().size() > 0) { // adds dbrefs to datasequence's set (since Jalview 2.10) @@ -3636,7 +3658,7 @@ public class Jalview2XML { entry.setProperty(prop.getName(), prop.getValue()); } - Desktop.getInstance().getStructureSelectionManager() + Desktop.getStructureSelectionManager() .registerPDBEntry(entry); // adds PDBEntry to datasequence's set (since Jalview 2.10) if (al.getSequenceAt(i).getDatasetSequence() != null) @@ -3649,7 +3671,10 @@ public class Jalview2XML } } } + } + +// Platform.timeCheck("features done", Platform.TIME_GET); // Platform.timeCheck("Jalview2XML.loadFromObject-endmultiview", // Platform.TIME_MARK); } // end !multipleview @@ -4180,6 +4205,8 @@ public class Jalview2XML }); } // and finally return. + // but do not set holdRepaint true just yet, because this could be the + // initial frame with just its dataset. return af; } @@ -4976,7 +5003,7 @@ public class Jalview2XML { AlignFrame af = null; af = new AlignFrame(al, safeInt(view.getWidth()), - safeInt(view.getHeight()), uniqueSeqSetId, viewId) + safeInt(view.getHeight()), uniqueSeqSetId, viewId) // { // // @Override @@ -4988,7 +5015,7 @@ public class Jalview2XML // // } ; - + af.alignPanel.setHoldRepaint(true); af.setFileName(file, FileFormat.Jalview); final AlignViewport viewport = af.getViewport(); @@ -5676,8 +5703,8 @@ public class Jalview2XML SequenceI[] dsseqs = new SequenceI[dseqs.size()]; dseqs.copyInto(dsseqs); ds = new jalview.datamodel.Alignment(dsseqs); - debug("Created new dataset " + vamsasSet.getDatasetId() - + " for alignment " + System.identityHashCode(al)); +// debug("Jalview2XML Created new dataset " + vamsasSet.getDatasetId() +// + " for alignment " + System.identityHashCode(al)); addDatasetRef(vamsasSet.getDatasetId(), ds); } // set the dataset for the newly imported alignment. @@ -6091,14 +6118,7 @@ public class Jalview2XML AlignFrame af = loadFromObject(jm, null, false, null); af.getAlignPanels().clear(); af.closeMenuItem_actionPerformed(true); - - /* - * if(ap.av.getAlignment().getAlignmentAnnotation()!=null) { for(int i=0; - * i