dont add sequence twice to new group
authoramwaterhouse <Andrew Waterhouse>
Thu, 16 Jun 2005 13:32:02 +0000 (13:32 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 16 Jun 2005 13:32:02 +0000 (13:32 +0000)
src/jalview/appletgui/TreeCanvas.java
src/jalview/gui/TreeCanvas.java

index 136be52..15c4bfa 100755 (executable)
@@ -476,7 +476,9 @@ System.out.println("called here");
           Vector sequences = new Vector();\r
           for (int j = 0; j < l.size(); j++)\r
           {\r
-            sequences.addElement( (Sequence) ( (SequenceNode) l.elementAt(j)).element());\r
+            SequenceI s1 = (SequenceI) ( (SequenceNode) l.elementAt(j)).element();\r
+            if(!sequences.contains(s1))\r
+              sequences.addElement(s1);\r
           }\r
 \r
           ColourSchemeI cs = ColourSchemeProperty.getColour(sequences, av.alignment.getWidth(),\r
index a293e28..1fddc5b 100755 (executable)
@@ -564,9 +564,12 @@ public class TreeCanvas
                                      new Vector());\r
 \r
          Vector sequences = new Vector();\r
-          for (int j = 0; j < l.size(); j++)\r
-          {\r
-            sequences.add( (Sequence)((SequenceNode) l.elementAt(j)).element());\r
+         for (int j = 0; j < l.size(); j++)\r
+         {\r
+           SequenceI s1 = (SequenceI) ( (SequenceNode) l.elementAt(j)).element();\r
+           if (!sequences.contains(s1))\r
+             sequences.addElement(s1);\r
+\r
           }\r
 \r
           ColourSchemeI cs = ColourSchemeProperty.getColour(sequences, av.alignment.getWidth(),\r