import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
{
minmax = new Hashtable<String, float[][]>();
}
+
+ Set<String> oldGroups = new HashSet<String>(featureGroups.keySet());
AlignmentI alignment = av.getAlignment();
for (int i = 0; i < alignment.getHeight(); i++)
{
int index = 0;
while (index < features.length)
{
+ String fgrp = features[index].getFeatureGroup();
+ oldGroups.remove(fgrp);
if (!featuresDisplayed.isRegistered(features[index].getType()))
{
- String fgrp = features[index].getFeatureGroup();
if (fgrp != null)
{
Boolean groupDisplayed = featureGroups.get(fgrp);
index++;
}
}
+
+ /*
+ * oldGroups now consists of groups that no longer
+ * have any feature in them - remove these
+ */
+ for (String grp : oldGroups)
+ {
+ featureGroups.remove(grp);
+ }
+
updateRenderOrder(allfeatures);
findingFeatures = false;
}
}
/**
- * Returns the configured colour for a specific feature using current feature
- * settings. This does not include any consideration of feature visibility,
- * colour transparency, graduated colour shading etc.
+ * Returns the configured colour for a particular feature instance. This
+ * includes calculation of 'colour by label', or of a graduated score colour,
+ * if applicable. It does not take into account feature visibility or colour
+ * transparency.
*
* @param feature
* @return
public Color getColour(SequenceFeature feature)
{
FeatureColourI fc = getFeatureStyle(feature.getType());
- return fc.getColor(feature);
+ return fc.isColored(feature) ? fc.getColor(feature) : null;
}
+ /**
+ * Answers true unless the feature has a score value which lies outside a
+ * minimum or maximum threshold configured for colouring. This method does not
+ * check feature type or group visibility.
+ *
+ * @param sequenceFeature
+ * @return
+ */
protected boolean showFeature(SequenceFeature sequenceFeature)
{
FeatureColourI fc = getFeatureStyle(sequenceFeature.type);