*/
public void updateLayout()
{
- fontChanged();
+ fontChanged(); // fires repaint
setAnnotationVisible(av.isShowAnnotation());
boolean wrap = av.getWrapAlignment();
ViewportRanges ranges = av.getRanges();
@Override
public void paintComponent(Graphics g)
{
+
invalidate(); // needed so that the id width adjuster works correctly
Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
overviewPanel.canvas.finalizeDraw(miniMe);
}
+
+ private boolean holdRepaint = false;
+
+ public boolean getHoldRepaint()
+ {
+ return holdRepaint;
+ }
+
+ public void setHoldRepaint(boolean b)
+ {
+ if (holdRepaint == b)
+ {
+ return;
+ }
+ holdRepaint = b;
+ if (!b)
+ {
+ repaint();
+ }
+ }
+
+ @Override
+ public void repaint()
+ {
+ if (holdRepaint)
+ {
+ // System.out.println("AP repaint holding");
+ // Platform.stackTrace();
+ return;
+ }
+ super.repaint();
+ }
+
}
IdentityHashMap<AlignmentI, AlignmentI> importedDatasets = new IdentityHashMap<>();
Map<String, AlignFrame> gatherToThisFrame = new HashMap<>();
final String file = jprovider.getFilename();
+
+ List<AlignFrame> 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);
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
_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)
{
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);
+ }
+
}
/*
// 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);
}
// 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)
}
}
}
+
}
+
+// Platform.timeCheck("features done", Platform.TIME_GET);
// Platform.timeCheck("Jalview2XML.loadFromObject-endmultiview",
// Platform.TIME_MARK);
} // end !multipleview
});
}
// and finally return.
+ // but do not set holdRepaint true just yet, because this could be the
+ // initial frame with just its dataset.
return af;
}
{
AlignFrame af = null;
af = new AlignFrame(al, safeInt(view.getWidth()),
- safeInt(view.getHeight()), uniqueSeqSetId, viewId)
+ safeInt(view.getHeight()), uniqueSeqSetId, viewId)
// {
//
// @Override
//
// }
;
-
+ af.alignPanel.setHoldRepaint(true);
af.setFileName(file, FileFormat.Jalview);
final AlignViewport viewport = af.getViewport();
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.