import jalview.api.AlignViewportI;
import jalview.datamodel.SequenceI;
import jalview.renderer.AnnotationRenderer;
+import jalview.renderer.seqfeatures.FeatureColourFinder;
import jalview.viewmodel.OverviewDimensions;
import java.awt.Color;
{
int lastcol = -1;
int lastrow = -1;
- int color = Color.white.getRGB();
+ int rgbcolor = Color.white.getRGB();
SequenceI seq = null;
+ FeatureColourFinder finder = new FeatureColourFinder(fr);
final boolean hasHiddenCols = av.hasHiddenColumns();
boolean hiddenRow = false;
{
if (doCopy)
{
- color = miniMe.getRGB(col, row - 1);
+ rgbcolor = 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);
+ rgbcolor = getColumnColourFromSequence(seq, hiddenRow,
+ hasHiddenCols, lastcol, finder);
}
// else we just use the color we already have , so don't need to set it
- miniMe.setRGB(col, row, color);
+ miniMe.setRGB(col, row, rgbcolor);
}
}
}
* Find the colour of a sequence at a specified column position
*/
private int getColumnColourFromSequence(jalview.datamodel.SequenceI seq,
- boolean hiddenRow, boolean hasHiddenCols, int lastcol)
+ boolean hiddenRow, boolean hasHiddenCols, int lastcol,
+ FeatureColourFinder finder)
{
- int color;
+ Color color = Color.white;
- if (seq == null)
+ if ((seq != null) && (seq.getLength() > lastcol))
{
- color = Color.white.getRGB();
- }
- else if (seq.getLength() > lastcol)
- {
- color = sr.getResidueBoxColour(seq, lastcol).getRGB();
-
- if (av.isShowSequenceFeatures())
- {
- color = fr.findFeatureColour(color, seq, lastcol);
- }
- }
- else
- {
- color = Color.white.getRGB();
+ color = sr.getResidueColour(seq, lastcol, finder);
}
if (hiddenRow
|| (hasHiddenCols && !av.getColumnSelection()
.isVisible(lastcol)))
{
- color = new Color(color).darker().darker().getRGB();
+ color = color.darker().darker();
}
- return color;
+ return color.getRGB();
}
}