JAL-2490 lookup sequence features for "labelClass"
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 18 May 2017 14:56:25 +0000 (15:56 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 18 May 2017 14:56:25 +0000 (15:56 +0100)
src/jalview/gui/TreePanel.java

index 35998eb..32c5702 100755 (executable)
@@ -789,19 +789,17 @@ public class TreePanel extends GTreePanel
             }
             if (newname == null)
             {
-              SequenceFeature sf[] = sq.getSequenceFeatures();
-              for (int i = 0; sf != null && i < sf.length; i++)
+              List<SequenceFeature> features = sq.getFeatures()
+                      .getPositionalFeatures(labelClass);
+              for (SequenceFeature feature : features)
               {
-                if (sf[i].getType().equals(labelClass))
+                if (newname == null)
+                {
+                  newname = feature.getDescription();
+                }
+                else
                 {
-                  if (newname == null)
-                  {
-                    newname = new String(sf[i].getDescription());
-                  }
-                  else
-                  {
-                    newname = newname + "; " + sf[i].getDescription();
-                  }
+                  newname = newname + "; " + feature.getDescription();
                 }
               }
             }