X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=c59d2014630bf36de168363024430bf127792a1a;hb=febd250089c9672b66d2c7a5ed0c06e0763c2233;hp=5e477c7f8cd29991a627c5fe73eae606f029b551;hpb=46b9e36a8cf9f3d25bc4a303d40d8d423ba15e81;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 5e477c7..c59d201 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -243,7 +243,7 @@ public class AlignViewport extends AlignmentViewport implements showAutocalculatedAbove = Cache.getDefault( Preferences.SHOW_AUTOCALC_ABOVE, false); viewStyle.setScaleProteinAsCdna(Cache.getDefault( - Preferences.SCALE_PROTEIN_TO_CDNA, false)); + Preferences.SCALE_PROTEIN_TO_CDNA, true)); } void init() @@ -798,16 +798,23 @@ public class AlignViewport extends AlignmentViewport implements // TODO: create undo object for this JAL-1101 /* - * If one alignment is protein and one nucleotide, with at least one - * sequence name in common, offer to open a linked alignment. + * If any cDNA/protein mappings can be made between the alignments, offer to + * open a linked alignment with split frame option. */ - if (AlignmentUtils.isMappable(al, getAlignment())) + if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, false)) { - if (openLinkedAlignment(al, title)) + if (AlignmentUtils.isMappable(al, getAlignment())) { - return; + if (openLinkedAlignment(al, title)) + { + return; + } } } + + /* + * No mappings, or offer declined - add sequences to this alignment + */ // TODO: JAL-407 regardless of above - identical sequences (based on ID and // provenance) should share the same dataset sequence @@ -815,19 +822,18 @@ public class AlignViewport extends AlignmentViewport implements { getAlignment().addSequence(al.getSequenceAt(i)); } - // TODO this call was done by SequenceFetcher but not FileLoader or - // CutAndPasteTransfer. Is it needed? - // JBPComment: this repositions the view to show the new sequences - // JBPComment: so it is needed for UX + setEndSeq(getAlignment().getHeight()); firePropertyChange("alignment", null, getAlignment().getSequences()); } /** * Show a dialog with the option to open and link (cDNA <-> protein) as a new - * alignment. Returns true if the new alignment was opened, false if not, - * because the user declined the offer. + * alignment, either as a standalone alignment or in a split frame. Returns + * true if the new alignment was opened, false if not, because the user + * declined the offer. * + * @param al * @param title */ protected boolean openLinkedAlignment(AlignmentI al, String title)