/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+ * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
{\r
if (cs != null)\r
{\r
- resBoxColour = cs.findColour(seq.getSequence(i, i + 1), i);\r
+ resBoxColour = cs.findColour(seq.getCharAt(i), i);\r
}\r
else if(forOverview && !jalview.util.Comparison.isGap(seq.getCharAt(i)))\r
{\r
public void drawSequence(SequenceI seq, SequenceGroup[] sg,\r
int start, int end, int y1)\r
{\r
+ if(seq==null)\r
+ return;\r
+\r
allGroups = sg;\r
\r
drawBoxes(seq, start, end, y1);\r
\r
public void drawText(SequenceI seq, int start, int end, int y1)\r
{\r
+ Font boldFont = null;\r
+ boolean bold = false;\r
+ if(av.upperCasebold)\r
+ {\r
+ boldFont = new Font(av.getFont().getName(), Font.BOLD, av.charHeight);\r
+\r
+ graphics.setFont(av.getFont());\r
+ }\r
\r
y1 += av.charHeight - av.charHeight / 5; // height/5 replaces pady\r
\r
}\r
}\r
\r
+ if (av.upperCasebold)\r
+ {\r
+ fm = graphics.getFontMetrics();\r
+ if ('A' <= s && s <= 'Z')\r
+ {\r
+ if(!bold)\r
+ {\r
+\r
+ graphics.setFont(boldFont);\r
+ }\r
+ bold = true;\r
+ }\r
+ else if(bold)\r
+ {\r
+ graphics.setFont(av.font);\r
+ bold = false;\r
+ }\r
+\r
+ }\r
+\r
charOffset = (av.charWidth - fm.charWidth(s)) / 2;\r
graphics.drawString(String.valueOf(s),\r
charOffset + av.charWidth * (i - start),\r
{\r
if (i < seq.getLength())\r
{\r
- s = seq.getSequence().charAt(i);\r
+ s = seq.getCharAt(i);\r
}\r
\r
charOffset = (av.charWidth - fm.charWidth(s)) / 2;\r