import com.stevesoft.pat.Regex;
import jalview.api.AlignViewportI;
+import jalview.api.FeatureRenderer;
import jalview.api.FinderI;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.SearchResultMatchI;
private AlignViewportI viewport;
/*
+ * feature renderer model - if available
+ */
+ FeatureRenderer frm = null;
+
+ /*
* sequence index in alignment to search from
*/
private int sequenceIndex;
lastFeature = null;
}
SequenceI seq = viewport.getAlignment().getSequenceAt(sequenceIndex);
- long fpos = 0;
SequenceFeaturesI sf = seq.getFeatures();
- for (SequenceFeature feature : sf.getAllFeatures(null))
+
+ // TODO - stash feature list and search incrementally
+ List<SequenceFeature> allFeatures = null;
+ if (frm != null)
+ {
+ allFeatures = frm.findFeaturesAtResidue(seq, seq.getStart(),
+ seq.getEnd());
+ }
+ else
+ {
+ allFeatures = sf.getAllFeatures(null);
+ }
+ // so we can check we are advancing when debugging
+ long fpos = 0;
+
+ for (SequenceFeature feature : allFeatures)
{
fpos++;
if (lastFeature != null)
continue;
}
}
+
if (searchPattern.search(feature.type) || (feature.description != null
&& searchPattern.search(feature.description)))
{
{
return searchResults;
}
+
+ @Override
+ public void setFeatureRenderer(FeatureRenderer featureRenderer)
+ {
+ frm = featureRenderer;
+ }
}
finder = new jalview.analysis.Finder(av);
finders.put(av, finder);
}
+ finder.setFeatureRenderer(ap.getFeatureRenderer());
boolean isCaseSensitive = caseSensitive.isSelected();
boolean doSearchDescription = searchDescription.isSelected();