From 1498662aa27c17a6db8e79edcfa4e9891e4437d2 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 16 Sep 2020 17:45:12 +0100 Subject: [PATCH] =?utf8?q?JAL-3748=20recover=20complement=20alignment=20from?= =?utf8?q?=20complement=20alignmentView=20rather=20than=20let=20=E2=80=98ali?= =?utf8?q?gnAs=E2=80=99=20to=20do=20the=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/ws/jws2/MsaWSThread.java | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index db6e03f..89cf024 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -974,13 +974,24 @@ class MsaWSThread extends AWS2Thread implements WSClientI { al.setDataset(dataset); } - propagateDatasetMappings(al); + Alignment complement=null; + if (input.hasComplementView()) + { + Object[] newcompl = input + .getComplementView() + .getAlignmentAndHiddenColumns(getRequestingAlignFrame() + .getViewport().getCodingComplement().getGapCharacter()); + complement = new Alignment((SequenceI[])newcompl[0]); + complement.setHiddenColumns((HiddenColumns) newcompl[1]); + complement.setDataset(dataset); + complement.alignAs(al); + } // JBNote- TODO: warn user if a block is input rather than aligned data ? if (newFrame) { - displayInNewFrame(al, alorders, hidden); + displayInNewFrame(al, alorders, hidden, complement); } else @@ -998,10 +1009,11 @@ class MsaWSThread extends AWS2Thread implements WSClientI * * @param al * @param alorders + * @param complement2 * @param columnselection */ protected void displayInNewFrame(AlignmentI al, - List alorders, HiddenColumns hidden) + List alorders, HiddenColumns hidden, AlignmentI complement) { AlignFrame af = new AlignFrame(al, hidden, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); @@ -1021,26 +1033,18 @@ class MsaWSThread extends AWS2Thread implements WSClientI * SplitFrame with the other pane similarly aligned. */ AlignFrame requestedBy = getRequestingAlignFrame(); - if (requestedBy != null && requestedBy.getSplitViewContainer() != null + if (complement!=null && requestedBy != null && requestedBy.getSplitViewContainer() != null && requestedBy.getSplitViewContainer() .getComplement(requestedBy) != null) { - AlignmentI complement = requestedBy.getSplitViewContainer() - .getComplement(requestedBy); String complementTitle = requestedBy.getSplitViewContainer() .getComplementTitle(requestedBy); // becomes null if the alignment window was closed before the alignment // job finished. - AlignmentI copyComplement = new Alignment(complement); - // todo should this be done by copy constructor? - copyComplement.setGapCharacter(complement.getGapCharacter()); - // share the same dataset (and the mappings it holds) - copyComplement.setDataset(complement.getDataset()); - copyComplement.alignAs(al); - if (copyComplement.getHeight() > 0) + if (complement.getHeight() > 0) { af.setTitle(alTitle); - AlignFrame af2 = new AlignFrame(copyComplement, + AlignFrame af2 = new AlignFrame(complement, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); af2.setTitle(complementTitle); String linkedTitle = MessageManager -- 1.7.10.2