* Note this method does not check for a gap in the column so would return the * colour for features enclosing a gapped column. Check for gap before calling * if different behaviour is wanted. * * BH 2019.07.30 * * Adds a result ArrayList to parameters in order to avoid an unnecessary construction of that for every pixel checked. * * * @param seq * @param column * (1..) * @return */ private Color findFeatureColour(SequenceI seq, int column) { /* * check for new feature added while processing */ updateFeatures(); /* * inspect features in reverse renderOrder (the last in the array is * displayed on top) until we find one that is rendered at the position */ for (int renderIndex = renderOrder.length - 1; renderIndex >= 0; renderIndex--) { String type = renderOrder[renderIndex]; if (!showFeatureOfType(type)) { continue; } overlaps.clear(); seq.findFeatures(column, type, overlaps); if (overlaps.size() > 0) { for (SequenceFeature sequenceFeature : overlaps) { if (!featureGroupNotShown(sequenceFeature)) { Color col = getColour(sequenceFeature); if (col != null) { return col; } } } } } /* * no displayed feature found at position */ return null; } }