X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSequenceRenderer.java;h=81b394bd3c3ecd8ed26d73ddac2074221efd3f4a;hb=86b84a537a05d03a21ba115bffe3575cedf98be0;hp=5be7f55c0e2ce1752552a647413d21659d0736cc;hpb=b2f9f869650be0ea7c8cb2586744064b007866dc;p=jalview.git diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 5be7f55..81b394b 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -95,6 +95,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer public Color getResidueColour(final SequenceI seq, int position, FeatureColourFinder finder) { + allGroups = av.getAlignment().findAllGroups(seq); return resColourFinder.getResidueColour(av.getShowBoxes(), av.getResidueShading(), allGroups, seq, position, @@ -480,21 +481,30 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } } - public void drawCursor(SequenceI seq, int res, int x1, int y1) + /** + * Draw a sequence canvas cursor + * + * @param g + * graphics context to draw on + * @param s + * character to draw at cursor + * @param x1 + * x position of cursor in graphics context + * @param y1 + * y position of cursor in graphics context + */ + public void drawCursor(Graphics g, char s, int x1, int y1) { int pady = av.getCharHeight() / 5; int charOffset = 0; - graphics.setColor(Color.black); - graphics.fillRect(x1, y1, av.getCharWidth(), av.getCharHeight()); + g.setColor(Color.black); + g.fillRect(x1, y1, av.getCharWidth(), av.getCharHeight()); if (av.isValidCharWidth()) { - graphics.setColor(Color.white); - - char s = seq.getCharAt(res); - + g.setColor(Color.white); charOffset = (av.getCharWidth() - fm.charWidth(s)) / 2; - graphics.drawString(String.valueOf(s), charOffset + x1, + g.drawString(String.valueOf(s), charOffset + x1, (y1 + av.getCharHeight()) - pady); }