BufferedImage image;\r
Graphics2D gg;\r
FontMetrics fm;\r
- boolean validCharWidth;\r
int imgWidth = 0;\r
boolean fastPaint = false;\r
\r
if (fm == null)\r
fm = g.getFontMetrics();\r
\r
- validCharWidth = fm.charWidth('M') <= av.charWidth;\r
\r
g.setColor(Color.white);\r
g.fillRect(0, 0, (endRes - startRes) * av.charWidth, getHeight());\r
g.setColor(Color.white);\r
g.fillRect(0, 0, getWidth(), getHeight());\r
g.setColor(Color.black);\r
- if(validCharWidth)\r
- g.drawString("Alignment has no annotations", 20, 15);\r
+ if(av.validCharWidth)\r
+ g.drawString("Alignment has no annotations", 20, 15);\r
\r
return;\r
}\r
}\r
}\r
\r
- if (validCharWidth && validRes &&\r
+ if (av.validCharWidth && validRes &&\r
(row.annotations[column].displayCharacter.length() > 0))\r
{\r
\r
Graphics graphics;\r
boolean monospacedFont;\r
boolean forOverview = false;\r
- boolean validCharWidth = true;\r
\r
/**\r
* Creates a new SequenceRenderer object.\r
graphics = g;\r
fm = g.getFontMetrics();\r
monospacedFont = fm.getStringBounds("M",g).getWidth()==fm.getStringBounds("|",g).getWidth();\r
- validCharWidth = fm.charWidth('M') <= av.charWidth;\r
-\r
this.renderGaps = renderGaps;\r
}\r
\r
\r
drawBoxes(seq, start, end, y1);\r
\r
- if (validCharWidth)\r
+ if (av.validCharWidth)\r
drawText(seq, start, end, y1);\r
}\r
\r
char s = '~';\r
\r
// Need to find the sequence position here.\r
- for (int i = start; i <= end; i++)\r
+ if(av.validCharWidth)\r
{\r
+ for (int i = start; i <= end; i++)\r
+ {\r
if (i < seq.getLength())\r
{\r
- s = seq.getSequence().charAt(i);\r
+ s = seq.getSequence().charAt(i);\r
}\r
\r
charOffset = (av.charWidth - fm.charWidth(s)) / 2;\r
graphics.drawString(String.valueOf(s),\r
- charOffset + x1 + (av.charWidth * (i - start)),\r
- (y1 + av.charHeight) - pady);\r
+ charOffset + x1 + (av.charWidth * (i - start)),\r
+ (y1 + av.charHeight) - pady);\r
+ }\r
}\r
}\r
\r
int charOffset = 0;\r
graphics.setColor(Color.black);\r
graphics.fillRect(x1, y1, av.charWidth, av.charHeight);\r
- graphics.setColor(Color.white);\r
\r
- graphics.setColor(Color.white);\r
-\r
- char s = seq.getCharAt(res);\r
+ if(av.validCharWidth)\r
+ {\r
+ graphics.setColor(Color.white);\r
\r
- charOffset = (av.charWidth - fm.charWidth(s)) / 2;\r
- graphics.drawString(String.valueOf(s),\r
- charOffset + x1,\r
- (y1 + av.charHeight) - pady);\r
+ char s = seq.getCharAt(res);\r
\r
+ charOffset = (av.charWidth - fm.charWidth(s)) / 2;\r
+ graphics.drawString(String.valueOf(s),\r
+ charOffset + x1,\r
+ (y1 + av.charHeight) - pady);\r
+ }\r
\r
}\r
}\r