+ int alwidth = av.alignment.getWidth();\r
+ int alheight = av.alignment.getHeight()\r
+ +av.alignment.getHiddenSequences().getSize();\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
+\r
+ Graphics mg = miniMe.getGraphics();\r
+ mg.setColor(Color.orange);\r
+ mg.fillRect(0,0,width, miniMe.getHeight());\r
+\r
+ float sampleCol = (float) alwidth / (float) width;\r
+ float sampleRow = (float) alheight / (float) sequencesHeight;\r
+\r
+ int lastcol=-1, lastrow=-1;\r
+ int color = Color.white.getRGB();\r
+ int row, col;\r
+ jalview.datamodel.SequenceI seq;\r
+ boolean hiddenRow = false;\r
+ for (row = 0; row < sequencesHeight; row++)\r
+ {\r
+ if((int)(row*sampleRow)==lastrow)\r
+ {\r
+ //No need to recalculate the colours,\r
+ //Just copy from the row above\r
+ for (col = 0; col < width; col++)\r
+ {\r
+ miniMe.setRGB(col, row, miniMe.getRGB(col, row-1));\r
+ }\r
+ continue;\r
+ }\r
+\r
+ lastrow = (int)(row*sampleRow);\r
+\r
+ hiddenRow = false;\r
+ if (av.hasHiddenRows)\r
+ {\r
+ seq = av.alignment.getHiddenSequences().getHiddenSequence(lastrow);\r
+ if (seq == null)\r
+ {\r
+ int index =\r
+ av.alignment.getHiddenSequences().findIndexWithoutHiddenSeqs(lastrow);\r
+\r
+ seq = av.alignment.getSequenceAt(index);\r
+ }\r
+ else\r
+ {\r
+ hiddenRow = true;\r
+ }\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
+ miniMe.setRGB(col,row,color);\r
+ continue;\r
+ }\r
+\r
+\r
+ lastcol = (int)(col*sampleCol);\r
+\r
+ if (seq.getLength() > lastcol)\r
+ {\r
+ color = sr.getResidueBoxColour(\r
+ seq, lastcol).getRGB();\r
+\r
+ if (av.showSequenceFeatures)\r
+ color = fr.findFeatureColour(color, seq, lastcol);\r
+ }\r
+ else\r
+ {\r
+ color = -1; //White\r
+ }\r
+\r
+ if(hiddenRow ||\r
+ (av.hasHiddenColumns && !av.getColumnSelection().isVisible(lastcol)))\r
+ {\r
+ color = new Color(color).darker().darker().getRGB();\r
+ }\r
+\r
+\r
+ miniMe.setRGB(col,row,color);\r
+\r
+\r
+ }\r
+ }\r
+\r
+ if (av.conservation != null)\r
+ {\r
+ for (col = 0; col < width; col++)\r
+ {\r
+ lastcol = (int) (col * sampleCol);\r
+ {\r
+ mg.translate(col, sequencesHeight);\r
+ ap.annotationPanel.drawGraph(mg, av.conservation,\r
+ (int) (sampleCol) + 1,\r
+ graphHeight,\r
+ (int) (col * sampleCol),\r
+ (int) (col * sampleCol) + 1);\r
+ mg.translate( -col, -sequencesHeight);\r
+ }\r
+ }\r
+ }\r
+ System.gc();\r
+\r
+ resizing = false;\r
+\r
+ setBoxPosition();\r
+\r
+ if(resizeAgain)\r
+ {\r
+ resizeAgain = false;\r
+ updateOverviewImage();\r
+ }\r
+ }\r