}
}
- saveRnaViewers(jout, jseq, jds, viewIds, storeDS);
+ saveRnaViewers(jout, jseq, jds, viewIds, ap, storeDS);
jms.addJSeq(jseq);
}
* @param jseq
* @param jds
* @param viewIds
+ * @param ap
* @param storeDataset
*/
protected void saveRnaViewers(JarOutputStream jout, JSeq jseq,
- final SequenceI jds, List<String> viewIds, boolean storeDataset)
+ final SequenceI jds, List<String> viewIds, AlignmentPanel ap,
+ boolean storeDataset)
{
JInternalFrame[] frames = Desktop.desktop.getAllFrames();
for (int f = frames.length - 1; f > -1; f--)
if (frames[f] instanceof AppVarna)
{
AppVarna varna = (AppVarna) frames[f];
- if (varna.isListeningFor(jds))
+ /*
+ * link the sequence to every viewer that is showing it and is linked to
+ * its alignment panel
+ */
+ if (varna.isListeningFor(jds) && ap == varna.getAlignmentPanel())
{
- /*
- * link the sequence to every viewer that is showing it
- */
String viewId = varna.getViewId();
RnaViewer rna = new RnaViewer();
rna.setViewId(viewId);