extends Panel implements Runnable, MouseMotionListener, MouseListener\r
{\r
Image miniMe;\r
+ Image offscreen;\r
AlignViewport av;\r
AlignmentPanel ap;\r
float scalew = 1f;\r
scaleh = (float) sequencesHeight / (float) fullsizeHeight;\r
\r
miniMe = nullFrame.createImage(width, sequencesHeight + graphHeight);\r
+ offscreen = nullFrame.createImage(width, sequencesHeight + graphHeight);\r
\r
Graphics mg = miniMe.getGraphics();\r
float sampleCol = (float) alwidth / (float) width;\r
float sampleRow = (float) alheight / (float) sequencesHeight;\r
\r
- int lastcol=-1, lastrow=-1;\r
+ int lastcol=0, lastrow=0;\r
+ int xstart=0, ystart=0;\r
Color color = Color.yellow;\r
int row, col, sameRow = 0, sameCol = 0;\r
jalview.datamodel.SequenceI seq;\r
boolean hiddenRow = false;\r
- for (row = 0; row < sequencesHeight; row++)\r
+ for (row = 0; row <= sequencesHeight; row++)\r
{\r
if((int)(row*sampleRow)==lastrow)\r
{\r
continue;\r
}\r
\r
- lastrow = (int)(row*sampleRow);\r
-\r
hiddenRow = false;\r
if (av.hasHiddenRows)\r
{\r
else\r
seq = av.alignment.getSequenceAt(lastrow);\r
\r
- if(seq==null)\r
- {\r
- System.out.println(lastrow+" null");\r
- continue;\r
- }\r
-\r
for (col = 0; col < width; col++)\r
{\r
if ( (int) (col * sampleCol) == lastcol && (int) (row * sampleRow) == lastrow)\r
\r
mg.setColor(color);\r
if (sameCol == 1 && sameRow == 1)\r
- mg.drawLine(col, row, col, row);\r
+ mg.drawLine(xstart, ystart, xstart, ystart);\r
else\r
- mg.fillRect(col, row, col+sameCol, col+sameRow);\r
+ mg.fillRect(xstart, ystart, sameCol, sameRow);\r
\r
+ xstart = col;\r
sameCol = 1;\r
}\r
+ lastrow = (int)(row*sampleRow);\r
+ ystart = row;\r
sameRow = 1;\r
}\r
\r
\r
public void paint(Graphics g)\r
{\r
+ Graphics og = offscreen.getGraphics();\r
if (miniMe != null)\r
{\r
- g.drawImage(miniMe, 0, 0, this);\r
+ og.drawImage(miniMe, 0, 0, this);\r
+ og.setColor(Color.red);\r
+ og.drawRect(boxX, boxY, boxWidth, boxHeight);\r
+ og.drawRect(boxX + 1, boxY + 1, boxWidth - 2, boxHeight - 2);\r
+ g.drawImage(offscreen, 0,0, this);\r
}\r
else\r
{\r
g.drawString("Recalculating", 5, sequencesHeight / 2);\r
g.drawString("Overview.....", 5, (sequencesHeight / 2) + 20);\r
}\r
-\r
- g.setColor(Color.red);\r
- g.drawRect(boxX, boxY, boxWidth, boxHeight);\r
- g.drawRect(boxX + 1, boxY + 1, boxWidth - 2, boxHeight - 2);\r
}\r
\r
}\r