int LABEL_WEST;\r
int LABEL_EAST;\r
\r
+ boolean isOverview = false;\r
+\r
/**\r
* Creates a new SeqCanvas object.\r
*\r
*/\r
public void fastPaint(int horizontal, int vertical)\r
{\r
- if (((horizontal == 0) && (vertical == 0)) || (gg == null))\r
+ if (gg == null)\r
{\r
return;\r
}\r
\r
if (horizontal > 0) // scrollbar pulled right, image to the left\r
{\r
+ er ++;\r
transX = (er - sr - horizontal) * av.charWidth;\r
sr = er - horizontal;\r
}\r
else if (horizontal < 0)\r
{\r
- er = sr - horizontal;\r
+ er = sr - horizontal-1;\r
}\r
else if (vertical > 0) // scroll down\r
{\r
}\r
\r
gg.translate(transX, transY);\r
-\r
- gg.setColor(Color.white);\r
- gg.fillRect(0, 0, (er - sr + 1) * av.charWidth,\r
- (es - ss) * av.charHeight);\r
drawPanel(gg, sr, er, ss, es, sr, ss, 0);\r
gg.translate(-transX, -transY);\r
\r
// Set this to false to force a full panel paint\r
public void paintComponent(Graphics g)\r
{\r
+ sr.renderGaps(av.renderGaps);\r
+\r
if ((img != null) &&\r
(fastPaint || (getWidth() != g.getClipBounds().width) ||\r
(getHeight() != g.getClipBounds().height)))\r
return;\r
}\r
\r
+\r
img = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB);\r
gg = (Graphics2D) img.getGraphics();\r
gg.setFont(av.getFont());\r
gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,\r
- RenderingHints.VALUE_ANTIALIAS_ON);\r
+ RenderingHints.VALUE_ANTIALIAS_ON);\r
\r
gg.setColor(Color.white);\r
gg.fillRect(0, 0, imgWidth, imgHeight);\r
cWidth * av.charWidth, (int) clip.getBounds().getHeight());\r
}\r
\r
+ if (av.vconsensus!=null && av.alignment.getWidth() >= av.vconsensus.size())\r
+ {\r
+ endx = av.vconsensus.size() - 2;\r
+ }\r
+\r
+\r
drawPanel(g, startRes, endx, 0, al.getHeight(), startRes, 0, ypos);\r
g.setClip(clip);\r
g.translate(-LABEL_WEST, 0);\r
{\r
Graphics2D g = (Graphics2D) g1;\r
g.setFont(av.getFont());\r
- sr.renderGaps(av.renderGaps);\r
\r
SequenceI nextSeq;\r
\r
}\r
\r
\r
- if (group != null)\r
+ if (group != null && !isOverview)\r
{\r
do\r
{\r
ex = (((group.getEndRes() + 1) - group.getStartRes()) * av.charWidth) -\r
1;\r
\r
+ if(sx+ex<0 || sx>imgWidth)\r
+ {\r
+ continue;\r
+ }\r
\r
- if ((sx < (x2-x1)*av.charWidth) &&\r
+ if ( (sx <= (x2-x1)*av.charWidth) &&\r
group.sequences.contains(av.alignment.getSequenceAt(\r
i)))\r
{\r
}\r
else\r
{\r
- if (inGroup)\r
+ if (inGroup)\r
+ {\r
+ if (sx >= 0 && sx < imgWidth)\r
+ g.drawLine(sx, oldY, sx, sy);\r
+\r
+ if (sx + ex < imgWidth)\r
+ g.drawLine(sx + ex, oldY, sx + ex, sy);\r
+\r
+ if (sx < 0)\r
{\r
- g.drawLine(sx, oldY, sx, sy);\r
- g.drawLine(sx + ex, oldY, sx + ex, sy);\r
+ ex += sx;\r
+ sx = 0;\r
+ }\r
\r
- if (top != -1)\r
- {\r
- g.drawLine(sx, top, sx + ex, top);\r
- top = -1;\r
- }\r
+ if (sx + ex > imgWidth)\r
+ ex = imgWidth;\r
\r
- if (bottom != -1)\r
- {\r
- g.drawLine(sx, bottom, sx + ex, bottom);\r
- bottom = -1;\r
- }\r
+ else if (sx + ex >= (x2 - x1 + 1) * av.charWidth)\r
+ ex = (x2 - x1 + 1) * av.charWidth;\r
\r
- inGroup = false;\r
+ if (top != -1)\r
+ {\r
+ g.drawLine(sx, top, sx + ex, top);\r
+ top = -1;\r
+ }\r
+\r
+ if (bottom != -1)\r
+ {\r
+ g.drawLine(sx, bottom, sx + ex, bottom);\r
+ bottom = -1;\r
+ }\r
+\r
+ inGroup = false;\r
}\r
}\r
}\r
\r
-\r
if (inGroup)\r
{\r
- if (top != -1)\r
- {\r
- g.drawLine(sx, top, sx + ex, top);\r
- top = -1;\r
- }\r
-\r
- if (bottom != -1)\r
- {\r
- g.drawLine(sx, bottom - 1, sx + ex, bottom - 1);\r
- bottom = -1;\r
- }\r
-\r
- sy = offset + ((i - starty) * av.charHeight);\r
+ sy = offset + ( (i - starty) * av.charHeight);\r
+ if (sx >= 0 && sx < imgWidth)\r
g.drawLine(sx, oldY, sx, sy);\r
+\r
+ if (sx + ex < imgWidth)\r
g.drawLine(sx + ex, oldY, sx + ex, sy);\r
+\r
+ if (sx < 0)\r
+ {\r
+ ex += sx;\r
+ sx = 0;\r
+ }\r
+\r
+ if (sx + ex > imgWidth)\r
+ ex = imgWidth;\r
+ else if (sx + ex >= (x2 - x1 + 1) * av.charWidth)\r
+ ex = (x2 - x1 + 1) * av.charWidth;\r
+\r
+ if (top != -1)\r
+ {\r
+ g.drawLine(sx, top, sx + ex, top);\r
+ top = -1;\r
+ }\r
+\r
+ if (bottom != -1)\r
+ {\r
+ g.drawLine(sx, bottom - 1, sx + ex, bottom - 1);\r
+ bottom = -1;\r
+ }\r
+\r
inGroup = false;\r
}\r
\r