+ miniMe = null;\r
+\r
+ int alwidth = av.alignment.getWidth();\r
+ int alheight = av.alignment.getHeight();\r
+\r
+ if ((getWidth() > 0) && (getHeight() > 0))\r
+ {\r
+ width = getWidth();\r
+ sequencesHeight = getHeight() - graphHeight;\r
+ }\r
+\r
+ setPreferredSize(new Dimension(width, sequencesHeight + graphHeight));\r
+\r
+ int fullsizeWidth = alwidth * av.getCharWidth();\r
+ int fullsizeHeight = alheight * av.getCharHeight();\r
+\r
+ scalew = (float) width / (float) fullsizeWidth;\r
+ scaleh = (float) sequencesHeight / (float) fullsizeHeight;\r
+\r
+ miniMe = new BufferedImage(width, sequencesHeight + graphHeight,\r
+ BufferedImage.TYPE_INT_RGB);\r
+\r
+ Graphics mg = miniMe.getGraphics();\r
+ BufferedImage consensus = new BufferedImage(fullsizeWidth, 60,\r
+ BufferedImage.TYPE_3BYTE_BGR);\r
+ Graphics g = consensus.getGraphics();\r
+ ap.annotationPanel.drawGraph(g, av.conservation, fullsizeWidth, 60);\r
+ mg.drawImage(consensus, 0, sequencesHeight, width,\r
+ sequencesHeight + graphHeight, 0, 0, fullsizeWidth, 60, this);\r
+\r
+ boolean oldRenderGaps = av.renderGaps;\r
+\r
+ try\r
+ {\r
+ // We'll have to draw the full size alignment in chunks, as an image of the\r
+ // whole alignment requires too much memory\r
+ // Max size depends on the font size, the following is a\r
+ // guess at a size which works\r
+ int maxSize = 2000 / av.getFont().getSize();\r
+ BufferedImage block;\r
+ int blockx = 0;\r
+ int blocky = 0;\r
+ int blockw = 0;\r
+ int blockh = 0;\r
+ int eRes = 0;\r
+ int eSeq = 0;\r
+\r
+ av.setRenderGaps(false);\r
+\r
+ for (int sRes = 0, chunkx = 0; sRes < alwidth;\r
+ sRes += maxSize, chunkx++)\r
+ {\r
+ eSeq = 0;\r
+ eRes += maxSize;\r
+\r
+ if (eRes > alwidth)\r
+ {\r
+ eRes = alwidth;\r
+ }\r
+\r
+ for (int sSeq = 0, chunky = 0; sSeq < alheight;\r
+ sSeq += maxSize, chunky++)\r
+ {\r
+ eSeq += maxSize;\r
+\r
+ if (eSeq > alheight)\r
+ {\r
+ eSeq = alheight;\r
+ }\r
+\r
+ blocky = 0;\r
+ blockx = (int) ((float) sRes / (float) alwidth * width);\r
+\r
+ block = new BufferedImage((eRes - sRes) * av.charWidth,\r
+ (eSeq - sSeq) * av.charHeight,\r
+ BufferedImage.TYPE_3BYTE_BGR);\r
+ g = block.getGraphics();\r
+\r
+ ap.seqPanel.seqCanvas.drawPanel(g, sRes, eRes, sSeq, eSeq,\r
+ sRes, sSeq, 0);\r
+\r
+ blockh = (int) ((float) (eSeq - sSeq) / (float) alheight * sequencesHeight) +\r
+ 1;\r
+ blockw = (int) ((float) (eRes - sRes) / (float) alwidth * width) +\r
+ 1;\r
+\r
+ blocky += (int) ((float) sSeq / (float) alheight * sequencesHeight);\r
+\r
+ mg.drawImage(block, blockx, blocky, blockx + blockw,\r
+ blocky + blockh, 0, 0, block.getWidth(),\r
+ block.getHeight(), this);\r
+\r
+ block = null;\r
+ }\r
+ }\r
+ }\r
+ catch (OutOfMemoryError error)\r
+ {\r
+ System.err.println(\r
+ "Out of memory when trying to calculate the overview window image!");\r
+ }\r
+\r
+ av.setRenderGaps(oldRenderGaps);\r
+ resizing = false;\r
+\r
+ setBoxPosition();\r