+ if (fstart == fend)\r
+ {\r
+ g.setColor(Color.red);\r
+ g.fillRoundRect((fstart - start) * width, y1, width,\r
+ height, 4, 4);\r
+ g.setColor(Color.white);\r
+\r
+ char s = seq.getSequence().charAt(fstart);\r
+ FontMetrics fm = g.getFontMetrics();\r
+ int charOffset = (width - fm.charWidth(s)) / 2;\r
+ int pady = height / 5;\r
+ g.drawString(String.valueOf(s),\r
+ charOffset + x1 + (width * (fstart - start)),\r
+ (y1 + height) - pady);\r
+ }\r
+ else\r
+ {\r
+ for (int i = fstart; i <= fend; i++)\r
+ {\r
+ char s = seq.getSequence().charAt(i);\r
+\r
+ if (jalview.util.Comparison.isGap(s))\r
+ {\r
+ continue;\r
+ }\r
+\r
+ g.setColor(Color.blue);\r
+ g.fillRect((i - start) * width, y1, width, height);\r
+\r
+ g.setColor(Color.white);\r
+\r
+ FontMetrics fm = g.getFontMetrics();\r
+ int charOffset = (width - fm.charWidth(s)) / 2;\r
+ int pady = height / 5;\r
+ g.drawString(String.valueOf(s),\r
+ charOffset + x1 + (width * (i - start)),\r
+ (y1 + height) - pady);\r
+ }\r
+ }\r
+ }\r