From: Jim Procter Date: Thu, 15 Oct 2015 12:59:22 +0000 (+0100) Subject: JAL-1923 add groups to codon-complement and notify annotation update for all linked... X-Git-Tag: Release_2_9_0b2~4^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1e20361125b8e54782bbd1b2f044753cad1a4b04;p=jalview.git JAL-1923 add groups to codon-complement and notify annotation update for all linked views --- diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index 68573ef..aa79451 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -891,12 +891,13 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, aps[a].av.setSelectionGroup(null); aps[a].av.getAlignment().deleteAllGroups(); aps[a].av.clearSequenceColours(); - } - if (av.getCodingComplement() != null) - { - av.getCodingComplement().setSelectionGroup(null); - av.getCodingComplement().getAlignment().deleteAllGroups(); - av.getCodingComplement().clearSequenceColours(); + if (aps[a].av.getCodingComplement() != null) + { + aps[a].av.getCodingComplement().setSelectionGroup(null); + aps[a].av.getCodingComplement().getAlignment() + .deleteAllGroups(); + aps[a].av.getCodingComplement().clearSequenceColours(); + } } colourGroups(); } @@ -977,41 +978,45 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, } aps[a].av.getAlignment().addGroup(new SequenceGroup(sg)); - } - - // TODO can we push all of the below into AlignViewportI? - final AlignViewportI codingComplement = av.getCodingComplement(); - if (codingComplement != null) - { - SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg, av, - codingComplement); - if (mappedGroup.getSequences().size() > 0) + // TODO can we push all of the below into AlignViewportI? + final AlignViewportI codingComplement = aps[a].av + .getCodingComplement(); + if (codingComplement != null) { - codingComplement.getAlignment().addGroup(mappedGroup); - for (SequenceI seq : mappedGroup.getSequences()) + if (codingComplement != null) { - codingComplement.setSequenceColour(seq, col.brighter()); + SequenceGroup mappedGroup = MappingUtils.mapSequenceGroup(sg, + av, codingComplement); + if (mappedGroup.getSequences().size() > 0) + { + codingComplement.getAlignment().addGroup(mappedGroup); + for (SequenceI seq : mappedGroup.getSequences()) + { + codingComplement.setSequenceColour(seq, col.brighter()); + } + } } } } } - // notify the panel to redo any group specific stuff. + // notify the panel(s) to redo any group specific stuff. for (int a = 0; a < aps.length; a++) { aps[a].updateAnnotation(); // TODO: JAL-868 - need to ensure view colour change message is broadcast // to any Jmols listening in - } + final AlignViewportI codingComplement = aps[a].av + .getCodingComplement(); + if (codingComplement != null) + { + ((AlignViewport) codingComplement).getAlignPanel() + .updateAnnotation(); + + } - if (av.getCodingComplement() != null) - { - ((AlignViewport) av.getCodingComplement()).getAlignPanel() - .updateAnnotation(); - /* - * idPanel. repaint () - */ } + } /**