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;
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;
}
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);
}
}
/**
- * calculate the render colour for a specific feature using current feature
- * settings.
+ * 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 render colour for the given feature
+ * @return
*/
public Color getColour(SequenceFeature feature)
{
featureColours.put(featureType, col);
}
+ @Override
public void setTransparency(float value)
{
transparency = value;
}
+ @Override
public float getTransparency()
{
return transparency;
* @return list of groups
*/
@Override
- public List getGroups(boolean visible)
+ public List<String> getGroups(boolean visible)
{
if (featureGroups != null)
{