X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FIdCanvas.java;h=a1bc8732a64dad55ee57f70331d5d6e1a9dbfb25;hb=b61f2d9b571c4e4ab3285257c6ddbd39da61fa05;hp=dd057a347e4a3839445d9742282026c87d63874e;hpb=da144cfa9b7997a6e8dd04ef10d55bcea3b02c71;p=jalview.git diff --git a/src/jalview/appletgui/IdCanvas.java b/src/jalview/appletgui/IdCanvas.java index dd057a3..a1bc873 100755 --- a/src/jalview/appletgui/IdCanvas.java +++ b/src/jalview/appletgui/IdCanvas.java @@ -43,7 +43,7 @@ public class IdCanvas { setLayout(null); this.av = av; - PaintRefresher.Register(this, av.alignment); + PaintRefresher.Register(this, av.getSequenceSetId()); } public void drawIdString(Graphics gg, SequenceI s, int i, int starty, @@ -59,7 +59,7 @@ public class IdCanvas gg.setColor(Color.white); } else if (av.getSelectionGroup() != null && - av.getSelectionGroup().getSequences(false).contains(s)) + av.getSelectionGroup().getSequences(null).contains(s)) { gg.setColor(Color.lightGray); gg.fillRect(0, ((i - starty) * charHeight) + ypos, @@ -68,7 +68,7 @@ public class IdCanvas } else { - gg.setColor(s.getColor()); + gg.setColor(av.getSequenceColour(s)); gg.fillRect(0, ((i - starty) * charHeight) + ypos, getSize().width, charHeight); gg.setColor(Color.black); @@ -240,6 +240,7 @@ public class IdCanvas //Now draw the id strings //Now draw the id strings + SequenceI seq; for (int i = starty; i < endy; i++) { if (av.hasHiddenRows) @@ -247,23 +248,26 @@ public class IdCanvas setHiddenFont(i); } + seq = av.alignment.getSequenceAt(i); + if(seq==null) + continue; + // Selected sequence colours if ( (searchResults != null) && - searchResults.contains(av.alignment.getSequenceAt(i))) + searchResults.contains(seq)) { currentColor = Color.black; currentTextColor = Color.white; } else if ( (av.getSelectionGroup() != null) && - av.getSelectionGroup().getSequences(false).contains( - av.alignment.getSequenceAt(i))) + av.getSelectionGroup().getSequences(null).contains(seq)) { currentColor = Color.lightGray; currentTextColor = Color.black; } else { - currentColor = av.alignment.getSequenceAt(i).getColor(); + currentColor = av.getSequenceColour(seq); currentTextColor = Color.black; } @@ -274,10 +278,9 @@ public class IdCanvas gg.setColor(currentTextColor); - String string = av.alignment.getSequenceAt(i).getDisplayId(av. - getShowJVSuffix()); - gg.drawString(string, 0, + gg.drawString(seq.getDisplayId(av.getShowJVSuffix()), + 0, ( ( (i - starty) * av.charHeight) + av.charHeight) - (av.charHeight / 5));