- float sampleCol = (float) alwidth / (float) width;
- float sampleRow = (float) alheight / (float) sequencesHeight;
-
- int lastcol = -1, lastrow = -1;
- int color = Color.white.getRGB();
- int row, col;
- jalview.datamodel.SequenceI seq;
- final boolean hasHiddenRows = av.hasHiddenRows(), hasHiddenCols = av
- .hasHiddenColumns();
- boolean hiddenRow = false;
- // get hidden row and hidden column map once at beginning.
- // clone featureRenderer settings to avoid race conditions... if state is
- // updated just need to refresh again
- for (row = 0; row < sequencesHeight; row++)
- {
- if (resizeAgain)
- {
- break;
- }
- if ((int) (row * sampleRow) == lastrow)
- {
- // No need to recalculate the colours,
- // Just copy from the row above
- for (col = 0; col < width; col++)
- {
- if (resizeAgain)
- {
- break;
- }
- miniMe.setRGB(col, row, miniMe.getRGB(col, row - 1));
- }
- continue;
- }
-
- lastrow = (int) (row * sampleRow);
-
- hiddenRow = false;
- if (hasHiddenRows)
- {
- seq = av.getAlignment().getHiddenSequences()
- .getHiddenSequence(lastrow);
- if (seq == null)
- {
- int index = av.getAlignment().getHiddenSequences()
- .findIndexWithoutHiddenSeqs(lastrow);
-
- seq = av.getAlignment().getSequenceAt(index);
- }
- else
- {
- hiddenRow = true;
- }
- }
- else
- {
- seq = av.getAlignment().getSequenceAt(lastrow);
- }
-
- if (seq == null)
- {
- System.out.println(lastrow + " null");
- continue;
- }
-
- for (col = 0; col < width; col++)
- {
- if (resizeAgain)
- {
- break;
- }
- if ((int) (col * sampleCol) == lastcol
- && (int) (row * sampleRow) == lastrow)
- {
- miniMe.setRGB(col, row, color);
- continue;
- }
-
- lastcol = (int) (col * sampleCol);
-
- if (seq.getLength() > lastcol)
- {
- color = sr.getResidueBoxColour(seq, lastcol).getRGB();
-
- if (av.isShowSequenceFeatures())
- {
- color = fr.findFeatureColour(color, seq, lastcol);
- }
- }
- else
- {
- color = -1; // White
- }