From: amwaterhouse Date: Tue, 3 Oct 2006 09:21:12 +0000 (+0000) Subject: BoldFont upperCase X-Git-Tag: Release_2_2~329 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e6879a932d0144d64a5ab703ae311aed0eeb83e5;p=jalview.git BoldFont upperCase --- diff --git a/src/jalview/appletgui/SequenceRenderer.java b/src/jalview/appletgui/SequenceRenderer.java index e786b11..510b32f 100755 --- a/src/jalview/appletgui/SequenceRenderer.java +++ b/src/jalview/appletgui/SequenceRenderer.java @@ -164,6 +164,14 @@ public class SequenceRenderer public void drawText(SequenceI seq, int start, int end, int y1) { + Font boldFont = null; + boolean bold = false; + if(av.upperCasebold) + { + boldFont = new Font(av.getFont().getName(), Font.BOLD, av.charHeight); + + graphics.setFont(av.getFont()); + } y1 += av.charHeight - av.charHeight / 5; // height/5 replaces pady @@ -219,6 +227,26 @@ public class SequenceRenderer } } + if (av.upperCasebold) + { + fm = graphics.getFontMetrics(); + if ('A' <= s && s <= 'Z') + { + if(!bold) + { + + graphics.setFont(boldFont); + } + bold = true; + } + else if(bold) + { + graphics.setFont(av.font); + bold = false; + } + + } + charOffset = (av.charWidth - fm.charWidth(s)) / 2; graphics.drawString(String.valueOf(s), charOffset + av.charWidth * (i - start),