JAL-1114 - refactor methods handling Vectors and Hashtables to Lists and Maps, and...
[jalview.git] / src / jalview / appletgui / AnnotationColourChooser.java
index a3f9fa6..1a661be 100755 (executable)
@@ -58,11 +58,8 @@ public class AnnotationColourChooser extends Panel implements
     if (av.getAlignment().getGroups() != null)
     {
       oldgroupColours = new Hashtable();
-      Vector allGroups = ap.av.getAlignment().getGroups();
-      SequenceGroup sg;
-      for (int g = 0; g < allGroups.size(); g++)
+      for (SequenceGroup sg: ap.av.getAlignment().getGroups())
       {
-        sg = (SequenceGroup) allGroups.elementAt(g);
         if (sg.cs != null)
         {
           oldgroupColours.put(sg, sg.cs);
@@ -466,12 +463,9 @@ public class AnnotationColourChooser extends Panel implements
 
     if (av.getAlignment().getGroups() != null)
     {
-      Vector allGroups = ap.av.getAlignment().getGroups();
-      SequenceGroup sg;
-      for (int g = 0; g < allGroups.size(); g++)
+      for (SequenceGroup sg:ap.av.getAlignment().getGroups())
       {
-        sg = (SequenceGroup) allGroups.elementAt(g);
-
+     
         if (sg.cs == null)
         {
           continue;
@@ -501,11 +495,8 @@ public class AnnotationColourChooser extends Panel implements
     av.setGlobalColourScheme(oldcs);
     if (av.getAlignment().getGroups() != null)
     {
-      Vector allGroups = ap.av.getAlignment().getGroups();
-      SequenceGroup sg;
-      for (int g = 0; g < allGroups.size(); g++)
+      for (SequenceGroup sg:ap.av.getAlignment().getGroups())
       {
-        sg = (SequenceGroup) allGroups.elementAt(g);
         Object cs = oldgroupColours.get(sg);
         if (cs instanceof ColourSchemeI)
         {