Get sequence in routine
authoramwaterhouse <Andrew Waterhouse>
Wed, 25 Oct 2006 14:46:20 +0000 (14:46 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 25 Oct 2006 14:46:20 +0000 (14:46 +0000)
src/jalview/gui/IdCanvas.java

index d3b56be..24bf616 100755 (executable)
@@ -280,9 +280,12 @@ public class IdCanvas extends JPanel
         {\r
           //Now draw the id strings\r
 \r
+            SequenceI sequence;\r
             //Now draw the id strings\r
             for (int i = starty; i < endy; i++)\r
             {\r
+              sequence = av.alignment.getSequenceAt(i);\r
+\r
               if (av.hasHiddenRows)\r
               {\r
                 setHiddenFont(i);\r
@@ -290,21 +293,21 @@ public class IdCanvas extends JPanel
 \r
                 // Selected sequence colours\r
                 if ( (searchResults != null) &&\r
-                    searchResults.contains(av.alignment.getSequenceAt(i)))\r
+                    searchResults.contains(sequence))\r
                 {\r
                   currentColor = Color.black;\r
                   currentTextColor = Color.white;\r
                 }\r
                 else if ( (av.getSelectionGroup() != null) &&\r
                          av.getSelectionGroup().getSequences(false).contains(\r
-                             av.alignment.getSequenceAt(i)))\r
+                             sequence))\r
                 {\r
                   currentColor = Color.lightGray;\r
                   currentTextColor = Color.black;\r
                 }\r
                 else\r
                 {\r
-                  currentColor = av.alignment.getSequenceAt(i).getColor();\r
+                  currentColor = sequence.getColor();\r
                   currentTextColor = Color.black;\r
                 }\r
 \r
@@ -315,7 +318,7 @@ public class IdCanvas extends JPanel
 \r
                 gg.setColor(currentTextColor);\r
 \r
-                String string = av.alignment.getSequenceAt(i).getDisplayId( av.getShowJVSuffix());\r
+                String string = sequence.getDisplayId( av.getShowJVSuffix());\r
 \r
                 gg.drawString(string, 0,\r
                     (((i - starty) * av.charHeight) + av.charHeight) -\r