From 085727a32930d9a05becd66686ed001f50331bc6 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 16 Jun 2005 13:32:02 +0000 Subject: [PATCH] dont add sequence twice to new group --- src/jalview/appletgui/TreeCanvas.java | 4 +++- src/jalview/gui/TreeCanvas.java | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index 136be52..15c4bfa 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -476,7 +476,9 @@ System.out.println("called here"); Vector sequences = new Vector(); for (int j = 0; j < l.size(); j++) { - sequences.addElement( (Sequence) ( (SequenceNode) l.elementAt(j)).element()); + SequenceI s1 = (SequenceI) ( (SequenceNode) l.elementAt(j)).element(); + if(!sequences.contains(s1)) + sequences.addElement(s1); } ColourSchemeI cs = ColourSchemeProperty.getColour(sequences, av.alignment.getWidth(), diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index a293e28..1fddc5b 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -564,9 +564,12 @@ public class TreeCanvas new Vector()); Vector sequences = new Vector(); - for (int j = 0; j < l.size(); j++) - { - sequences.add( (Sequence)((SequenceNode) l.elementAt(j)).element()); + for (int j = 0; j < l.size(); j++) + { + SequenceI s1 = (SequenceI) ( (SequenceNode) l.elementAt(j)).element(); + if (!sequences.contains(s1)) + sequences.addElement(s1); + } ColourSchemeI cs = ColourSchemeProperty.getColour(sequences, av.alignment.getWidth(), -- 1.7.10.2