X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSplitFrame.java;h=cbad1483559545da60fb674319273431d1f58e2a;hb=13575806978812c994d97bffd95bbd26de61d4f3;hp=57a6732f9771032219a04c51bdaea717083bcbf5;hpb=0dcd05455053838514593a191514e8469341bf56;p=jalview.git diff --git a/src/jalview/appletgui/SplitFrame.java b/src/jalview/appletgui/SplitFrame.java index 57a6732..cbad148 100644 --- a/src/jalview/appletgui/SplitFrame.java +++ b/src/jalview/appletgui/SplitFrame.java @@ -20,7 +20,6 @@ */ package jalview.appletgui; -import jalview.analysis.AlignmentUtils; import jalview.api.AlignmentViewPanel; import jalview.api.ViewStyleI; import jalview.bin.JalviewLite; @@ -44,12 +43,14 @@ public class SplitFrame extends EmbmenuFrame 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(); } @@ -75,20 +76,15 @@ public class SplitFrame extends EmbmenuFrame 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