*/
package jalview.bin;
+import jalview.analysis.AlignmentUtils;
import jalview.api.StructureSelectionManagerProvider;
import jalview.appletgui.AlignFrame;
import jalview.appletgui.AlignViewport;
*/
public void addToDisplay(AlignFrame af, AlignFrame af2)
{
- if (af2 == null)
+ if (af2 != null)
{
- af.addToDisplay(embedded);
- }
- else
- {
- SplitFrame sf = new SplitFrame(af, af2);
- sf.addToDisplay(embedded, JalviewLite.this);
+ AlignmentI al1 = af.viewport.getAlignment();
+ AlignmentI al2 = af2.viewport.getAlignment();
+ if (AlignmentUtils.isMappable(al1, al2))
+ {
+ SplitFrame sf = new SplitFrame(af, af2);
+ sf.addToDisplay(embedded, JalviewLite.this);
+ return;
+ }
+ else
+ {
+ String msg = "Could not map any sequence in " + af2.getTitle()
+ + " as "
+ + (al1.isNucleotide() ? "protein product" : "cDNA")
+ + " for " + af.getTitle();
+ System.err.println(msg);
+ }
}
+
+ af.addToDisplay(embedded);
}
/**