*/
package jalview.appletgui;
-import jalview.analysis.AlignmentUtils;
import jalview.api.AlignmentViewPanel;
import jalview.api.ViewStyleI;
import jalview.bin.JalviewLite;
private Panel outermost;
/**
- * Constructor
+ * Constructs the split frame placing cdna in the top half. No 'alignment' is
+ * performed here, this should be done by the calling client if wanted.
*/
public SplitFrame(AlignFrame af1, AlignFrame af2)
{
- topFrame = af1;
- bottomFrame = af2;
+ boolean af1IsNucleotide = af1.viewport.getAlignment().isNucleotide();
+ topFrame = af1IsNucleotide ? af1 : af2;
+ bottomFrame = topFrame == af1 ? af2 : af1;
init();
}
AlignmentViewport protein = !topAlignment.isNucleotide() ? topViewport
: (!bottomAlignment.isNucleotide() ? bottomViewport : null);
- boolean mapped = AlignmentUtils.mapProteinToCdna(
- protein.getAlignment(), cdna.getAlignment());
- if (mapped)
- {
- final StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(topViewport.applet);
- ssm.registerMappings(protein.getAlignment().getCodonFrames());
- topViewport.setCodingComplement(bottomViewport);
- ssm.addCommandListener(cdna);
- ssm.addCommandListener(protein);
- }
+ final StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(topViewport.applet);
+ ssm.registerMappings(protein.getAlignment().getCodonFrames());
+ topViewport.setCodingComplement(bottomViewport);
+ ssm.addCommandListener(cdna);
+ ssm.addCommandListener(protein);
/*
- * Now mappings exist, can compute cDNA consensus on protein alignment
+ * Compute cDNA consensus on protein alignment
*/
protein.initComplementConsensus();
AlignmentViewPanel ap = topAlignment.isNucleotide() ? bottomFrame.alignPanel