import jalview.datamodel.SequenceI;
import jalview.renderer.seqfeatures.FeatureRenderer;
import jalview.schemes.FeatureColour;
-import jalview.schemes.UserColourScheme;
+import jalview.util.ColorUtils;
import java.awt.Color;
import java.beans.PropertyChangeListener;
continue;
}
- if ((features[i].getBegin() <= res)
- && (features[i].getEnd() >= res))
+ // check if start/end are at res, and if not a contact feature, that res
+ // lies between start and end
+ if ((features[i].getBegin() == res || features[i].getEnd() == res)
+ || (!features[i].isContactFeature()
+ && (features[i].getBegin() < res) && (features[i]
+ .getEnd() >= res)))
{
tmp.add(features[i]);
}
FeatureColourI fc = featureColours.get(featureType);
if (fc == null)
{
- Color col = UserColourScheme.createColourFromName(featureType);
+ Color col = ColorUtils.createColourFromName(featureType);
fc = new FeatureColour(col);
featureColours.put(featureType, fc);
}
return fc.isColored(sequenceFeature);
}
+ /**
+ * Answers true if the feature type is currently selected to be displayed,
+ * else false
+ *
+ * @param type
+ * @return
+ */
protected boolean showFeatureOfType(String type)
{
- return av.getFeaturesDisplayed().isVisible(type);
+ return type == null ? false : av.getFeaturesDisplayed().isVisible(type);
}
@Override