public abstract class FeatureRendererModel
implements jalview.api.FeatureRenderer
{
+ /*
+ * column indices of fields in Feature Settings table
+ * todo: transfer valuers as data beans instead of Object[][]
+ */
+ public static final int TYPE_COLUMN = 0;
+
+ public static final int COLOUR_COLUMN = 1;
+
+ public static final int FILTER_COLUMN = 2;
+
+ public static final int SHOW_COLUMN = 3;
/*
* global transparency for feature
{
for (int i = 0; i < data.length; i++)
{
- String type = data[i][0].toString();
- setColour(type, (FeatureColourI) data[i][1]);
- if (((Boolean) data[i][2]).booleanValue())
+ String type = data[i][TYPE_COLUMN].toString();
+ setColour(type, (FeatureColourI) data[i][COLOUR_COLUMN]);
+ if (((Boolean) data[i][SHOW_COLUMN]).booleanValue())
{
av_featuresdisplayed.setVisible(type);
}
protected boolean featureMatchesFilters(SequenceFeature sf)
{
KeyedMatcherSetI filter = featureFilters.get(sf.getType());
- return filter == null ? true : filter.matches(key -> sf
- .getValueAsString(key));
+ // TODO temporary fudge for Score and Label
+ return filter == null ? true
+ : filter.matches(
+ key -> "Label".equals(key[0]) ? sf.getDescription()
+ : ("Score".equals(key[0])
+ ? String.valueOf(sf.getScore())
+ : sf.getValueAsString(key)));
}
}