* compute the perceived colour for a given column position in sequenceI,
* taking transparency and feature visibility into account.
*
- * @param col
- * - background colour (due to alignment/group shading schemes, etc).
* @param sequenceI
* - sequence providing features
* @param r
* @param g
* @return
*/
- Color findFeatureColour(Color col, SequenceI sequenceI, int r, Graphics g);
+ Color findFeatureColour(SequenceI sequenceI, int r, Graphics g);
/**
* trigger the feature discovery process for a newly created feature renderer.
Graphics g = featureRenderer.getTransparency() == 1f ? null
: offscreenImage.getGraphics();
- Color c = featureRenderer.findFeatureColour(defaultColour, seq, column,
- g);
+ Color c = featureRenderer.findFeatureColour(seq, column, g);
if (c != null && g != null)
{
c = new Color(offscreenImage.getRGB(0, 0));
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
-import java.awt.image.BufferedImage;
public class FeatureRenderer extends FeatureRendererModel
{
protected SequenceI lastSeq;
- BufferedImage offscreenImage;
-
private volatile SequenceFeature[] lastSequenceFeatures;
int sfSize;
* This is used by Structure Viewers and the Overview Window to get the
* feature colour of the rendered sequence
*
- * @param defaultColour
* @param seq
* @param column
* @return
*/
@Override
- public Color findFeatureColour(Color defaultColour, SequenceI seq,
- int column, Graphics g)
+ public Color findFeatureColour(SequenceI seq, int column, Graphics g)
{
if (!av.isShowSequenceFeatures())
{
- return defaultColour;
+ return null;
}
SequenceFeature[] sequenceFeatures = seq.getSequenceFeatures();
if (lastSequenceFeatures == null || sfSize == 0)
{
- return defaultColour;
+ return null;
}
if (Comparison.isGap(lastSeq.getCharAt(column)))
{
renderedColour = drawSequence(g, lastSeq, column, column, 0, true);
}
- return renderedColour == null ? defaultColour : renderedColour;
+ return renderedColour;
}
/**
if (transparency != 1.0f && g != null)
{
/*
- * get colour as rendered including transparency
- * and reset transparency
+ * reset transparency
*/
- if (offscreenImage != null && drawnColour != null)
- {
- drawnColour = new Color(offscreenImage.getRGB(0, 0));
- }
Graphics2D g2 = (Graphics2D) g;
g2.setComposite(NO_TRANSPARENCY);
}