From: gmungoc Date: Wed, 4 Mar 2015 13:37:13 +0000 (+0000) Subject: JAL-845 bug fixes correcting linked editing X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=349e8113d8686347b698a03ee5e40c9462be6eef;p=jalview.git JAL-845 bug fixes correcting linked editing --- diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 4558d8d..19819a6 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -376,14 +376,14 @@ public class Alignment implements AlignmentI for (int i = 0; i < gSize; i++) { SequenceGroup sg = groups.get(i); - if (sg == null || sg.getSequences(null) == null) + if (sg == null || sg.getSequences() == null) { this.deleteGroup(sg); gSize--; continue; } - if (sg.getSequences(null).contains(s)) + if (sg.getSequences().contains(s)) { temp.add(sg); } diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 9604458..e7a4735 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4904,10 +4904,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, "label.translation_of_params", new Object[] { this.getTitle() }); af.setTitle(newTitle); - final SequenceI[] seqs = viewport.getSelectionGroup() == null ? viewport - .getAlignment().getSequencesArray() : viewport - .getSelectionAsNewSequence(); - viewport.openSplitFrame(af, seqs, al.getCodonFrames()); + final SequenceI[] seqs = viewport.getSelectionAsNewSequence(); + viewport.openSplitFrame(af, new Alignment(seqs), al.getCodonFrames()); // Desktop.addInternalFrame(af, newTitle, DEFAULT_WIDTH, DEFAULT_HEIGHT); } } diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 93d8c19..430f373 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -1069,8 +1069,8 @@ public class AlignViewport extends AlignmentViewport implements if (openSplitPane) { - protein = openSplitFrame(newAlignFrame, - thisAlignment.getSequencesArray(), protein.getCodonFrames()); + protein = openSplitFrame(newAlignFrame, thisAlignment, + protein.getCodonFrames()); } /* @@ -1090,20 +1090,18 @@ public class AlignViewport extends AlignmentViewport implements * * @param newAlignFrame * containing a new alignment to be shown - * @param seqs - * 'complementary' sequences to show in the other split half + * @param complement + * cdna/protein complement alignment to show in the other split half * @param mappings * @return the protein alignment in the split frame */ protected AlignmentI openSplitFrame(AlignFrame newAlignFrame, - SequenceI[] seqs, Set mappings) + AlignmentI complement, Set mappings) { - AlignmentI complementAlignment = new Alignment(seqs); - // TODO: move this to a factory/controller method ? /* * Open in split pane. DNA sequence above, protein below. */ - AlignFrame copyMe = new AlignFrame(complementAlignment, + AlignFrame copyMe = new AlignFrame(complement, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); copyMe.setTitle(getAlignPanel().alignFrame.getTitle()); diff --git a/src/jalview/util/MappingUtils.java b/src/jalview/util/MappingUtils.java index 9880ae7..eebc539 100644 --- a/src/jalview/util/MappingUtils.java +++ b/src/jalview/util/MappingUtils.java @@ -92,8 +92,7 @@ public final class MappingUtils SequenceI ds = seq.getDatasetSequence(); if (ds != null) { - final SequenceI copy = new Sequence("", new String( - seq.getSequence())); + final SequenceI copy = new Sequence(seq); copy.setDatasetSequence(ds); targetCopies.put(ds, copy); }