import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
+import java.util.List;
public class FeatureRenderer extends FeatureRendererModel
{
int startPos = seq.findPosition(start);
int endPos = seq.findPosition(end);
- int sfSize = sequenceFeatures.length;
Color drawnColour = null;
/*
continue;
}
- // loop through all features in sequence to find
- // current feature to render
- for (int sfindex = 0; sfindex < sfSize; sfindex++)
+ List<SequenceFeature> overlaps = seq.findFeatures(type, startPos, endPos);
+ for (SequenceFeature sequenceFeature : overlaps)
{
- final SequenceFeature sequenceFeature = sequenceFeatures[sfindex];
- if (!sequenceFeature.type.equals(type))
- {
- continue;
- }
-
/*
* a feature type may be flagged as shown but the group
* an instance of it belongs to may be hidden
continue;
}
- /*
- * check feature overlaps the target range
- * TODO: efficient retrieval of features overlapping a range
- */
- if (sequenceFeature.getBegin() > endPos
- || sequenceFeature.getEnd() < startPos)
- {
- continue;
- }
-
Color featureColour = getColour(sequenceFeature);
boolean isContactFeature = sequenceFeature.isContactFeature();
}
else if (showFeature(sequenceFeature))
{
+ /*
+ * showing feature score by height of colour
+ * is not implemented as a selectable option
+ *
if (av.isShowSequenceFeaturesHeight()
&& !Float.isNaN(sequenceFeature.score))
{
}
else
{
+ */
boolean drawn = renderFeature(g, seq,
seq.findIndex(sequenceFeature.begin) - 1,
seq.findIndex(sequenceFeature.end) - 1, featureColour,
{
drawnColour = featureColour;
}
- }
+ /*}*/
}
}
}