X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=1574d0350772b2e8882ebb5f29efbbd05d8155b5;hb=2947e06daee7e5b9d76be0d817dc45f0c8e94400;hp=4b759fdb337f2055e99808401cb6bdf85609d951;hpb=f5a779f10f361429eb273c55d66064a8cb1bf4e2;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 4b759fd..1574d03 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -123,6 +123,8 @@ public class AlignmentPanel extends GAlignmentPanel if (overviewPanel != null) overviewPanel.updateOverviewImage(); + alignFrame.updateEditMenuBar(); + repaint(); } @@ -712,18 +714,19 @@ public class AlignmentPanel extends GAlignmentPanel pg.setFont(new Font(av.getFont().getName(), Font.ITALIC, av.getFont().getSize())); + SequenceI seq; for (int i = startSeq; i < endSeq; i++) { + seq = av.getAlignment().getSequenceAt(i); if ( (av.getSelectionGroup() != null) && - av.getSelectionGroup().getSequences(false).contains( - av.getAlignment().getSequenceAt(i))) + av.getSelectionGroup().getSequences(false).contains(seq)) { currentColor = Color.gray; currentTextColor = Color.black; } else { - currentColor = av.getAlignment().getSequenceAt(i).getColor(); + currentColor = av.getSequenceColour(seq); currentTextColor = Color.black; } @@ -733,10 +736,17 @@ public class AlignmentPanel extends GAlignmentPanel pg.setColor(currentTextColor); - String string = av.getAlignment().getSequenceAt(i).getDisplayId - ( av.getShowJVSuffix()); + int xPos = 0; + if (av.rightAlignIds) + { + fm = pg.getFontMetrics(); + xPos = idWidth - fm.stringWidth( + seq.getDisplayId(av.getShowJVSuffix()) + ) - 4; + } - pg.drawString(string, 0, + pg.drawString(seq.getDisplayId( av.getShowJVSuffix()), + xPos, ( ( (i - startSeq) * av.charHeight) + av.getCharHeight()) - (av.getCharHeight() / 5)); } @@ -827,8 +837,13 @@ public class AlignmentPanel extends GAlignmentPanel { SequenceI s = av.alignment.getSequenceAt(i); String string = s.getDisplayId( av.getShowJVSuffix()); - - pg.drawString(string, 0, + int xPos = 0; + if (av.rightAlignIds) + { + FontMetrics fm = getFontMetrics(italic); + xPos = idWidth - fm.stringWidth( string ) - 4; + } + pg.drawString(string, xPos, ( (i * av.charHeight) + ypos + av.charHeight) - (av.charHeight / 5)); }