From: amwaterhouse Date: Thu, 16 Jun 2005 13:32:02 +0000 (+0000) Subject: dont add sequence twice to new group X-Git-Tag: Release_2_0~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=085727a32930d9a05becd66686ed001f50331bc6;p=jalview.git dont add sequence twice to new group --- 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(),