- private void buildImage(float sampleRow, float sampleCol)
- {
- int lastcol = -1;
- int lastrow = -1;
- int color = Color.white.getRGB();
-
- jalview.datamodel.SequenceI seq = null;
-
- final boolean 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 (int row = 0; row < od.getSequencesHeight() && !resizeAgain; row++)
- {
- boolean doCopy = true;
- int currentrow = (int) (row * sampleRow);
- if (currentrow != lastrow)
- {
- doCopy = false;
-
- lastrow = currentrow;
-
- // get the sequence which would be at alignment index 'lastrow' if no
- // columns were hidden, and determine whether it is hidden or not
- hiddenRow = av.getAlignment().isHidden(lastrow);
- seq = av.getAlignment().getSequenceAtAbsoluteIndex(lastrow);
- }
-
- if (seq == null)
- {
- System.out.println(lastrow + " null");
- continue;
- }
-
- for (int col = 0; col < od.getWidth() && !resizeAgain; col++)
- {
- if (doCopy)
- {
- color = miniMe.getRGB(col, row - 1);
- }
- else if ((int) (col * sampleCol) != lastcol
- || (int) (row * sampleRow) != lastrow)
- {
- lastcol = (int) (col * sampleCol);
- color = getColumnColourFromSequence(seq, hiddenRow, hasHiddenCols,
- lastcol);
- }
- // else if ((int) (col * sampleCol) == lastcol && (int) (row *
- // sampleRow) == lastrow))
- // we just use the color we already have , so don't need to set it
-
- miniMe.setRGB(col, row, color);
- }
- }
- }
-
- /*
- * Find the colour of a sequence at a specified column position