\r
gg.translate(transX, transY);\r
\r
- drawPanel(gg, sr, er, ss, es, sr, ss, 0);\r
+ drawPanel(gg, sr, er, ss, es, 0);\r
gg.translate( -transX, -transY);\r
\r
repaint();\r
}\r
else\r
{\r
- drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, av.startRes,\r
- av.startSeq, 0);\r
+ drawPanel(gg, av.startRes, av.endRes, av.startSeq, av.endSeq, 0);\r
}\r
\r
g.drawImage(img, 0, 0, this);\r
if(g.getClip()==null)\r
g.setClip(0, 0, cWidth * av.charWidth, canvasHeight);\r
\r
- drawPanel(g, startRes, endx, 0, al.getHeight(), startRes, 0, ypos);\r
+ drawPanel(g, startRes, endx, 0, al.getHeight(), ypos);\r
g.setClip(null);\r
\r
\r
return annotations.adjustPanelHeight();\r
}\r
\r
- synchronized public void drawPanel(Graphics g, int x1, int x2, int y1, int y2,\r
- int startx, int starty, int offset)\r
+ synchronized public void drawPanel(Graphics g, int startRes, int endRes, int startSeq, int endSeq, int offset)\r
{\r
\r
g.setFont(av.getFont());\r
SequenceI nextSeq;\r
/// First draw the sequences\r
/////////////////////////////\r
- for (int i = y1; i < y2; i++)\r
+ for (int i = startSeq; i < endSeq; i++)\r
{\r
nextSeq = av.alignment.getSequenceAt(i);\r
\r
- sr.drawSequence(g, nextSeq, av.alignment.findAllGroups(nextSeq), x1, x2,\r
- (x1 - startx) * av.charWidth,\r
+ sr.drawSequence(g, nextSeq, av.alignment.findAllGroups(nextSeq), startRes, endRes,\r
+ (startRes - startRes) * av.charWidth,\r
offset +\r
- (i - starty) * av.charHeight,\r
+ (i - startSeq) * av.charHeight,\r
av.charWidth, av.charHeight);\r
\r
if (av.showSequenceFeatures)\r
{\r
- fr.drawSequence(g, nextSeq, x1, x2,\r
- (x1 - startx) * av.charWidth,\r
- offset +\r
- (i - starty) * av.charHeight,\r
+ fr.drawSequence(g, nextSeq, startRes, endRes,\r
+ offset +(i - startSeq) * av.charHeight,\r
av.charWidth, av.charHeight);\r
}\r
/// Highlight search Results once all sequences have been drawn\r
//////////////////////////////////////////////////////////\r
if (searchResults != null)\r
{\r
- int[] visibleResults = searchResults.getResults(nextSeq, x1, x2);\r
+ int[] visibleResults = searchResults.getResults(nextSeq, startRes, endRes);\r
if (visibleResults != null)\r
for (int r = 0; r < visibleResults.length; r += 2)\r
{\r
sr.drawHighlightedText(nextSeq, visibleResults[r],\r
visibleResults[r + 1],\r
- (visibleResults[r] - startx) * av.charWidth,\r
- offset + ( (i - starty) * av.charHeight),\r
+ (visibleResults[r] - startRes) * av.charWidth,\r
+ offset + ( (i - startSeq) * av.charHeight),\r
av.charWidth, av.charHeight);\r
}\r
}\r
int top = -1;\r
int bottom = -1;\r
\r
- for (i = y1; i < y2; i++)\r
+ for (i = startSeq; i < endSeq; i++)\r
{\r
- sx = (group.getStartRes() - startx) * av.charWidth;\r
- sy = offset + ((i - starty) * av.charHeight);\r
+ sx = (group.getStartRes() - startRes) * av.charWidth;\r
+ sy = offset + ((i - startSeq) * av.charHeight);\r
ex = (((group.getEndRes() + 1) - group.getStartRes()) * av.charWidth) -\r
1;\r
\r
continue;\r
}\r
\r
- if ( (sx <= (x2-x1)*av.charWidth) &&\r
+ if ( (sx <= (endRes-startRes)*av.charWidth) &&\r
group.sequences.contains(av.alignment.getSequenceAt(\r
i)))\r
{\r
\r
if (bottom == -1)\r
{\r
- if(i == y2-1 || // Dont check for i+1 if on the bottom row\r
+ if(i == endSeq-1 || // Dont check for i+1 if on the bottom row\r
!group.sequences.contains(av.alignment.getSequenceAt(i+1 )))\r
\r
bottom = sy + av.charHeight;\r
if (sx + ex > imgWidth)\r
ex = imgWidth;\r
\r
- else if (sx + ex >= (x2 - x1 + 1) * av.charWidth)\r
- ex = (x2 - x1 + 1) * av.charWidth;\r
+ else if (sx + ex >= (endRes - startRes + 1) * av.charWidth)\r
+ ex = (endRes - startRes + 1) * av.charWidth;\r
\r
if (top != -1)\r
{\r
\r
if (inGroup)\r
{\r
- sy = offset + ( (i - starty) * av.charHeight);\r
+ sy = offset + ( (i - startSeq) * av.charHeight);\r
if (sx >= 0 && sx < imgWidth)\r
g.drawLine(sx, oldY, sx, sy);\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
+ else if (sx + ex >= (endRes - startRes + 1) * av.charWidth)\r
+ ex = (endRes - startRes + 1) * av.charWidth;\r
\r
if (top != -1)\r
{\r