import jalview.commands.OrderCommand;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SearchResultsI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
? viewport.getSelectionGroup()
: new SequenceGroup();
+ SearchResultsI searchResults = viewport.getSearchResults();
if (invert)
{
List<SequenceI> nothighlighted = new ArrayList();
for (SequenceI seq : alignPanel.getAlignViewport().getAlignment()
.getSequences())
{
- if (!results.contains(seq))
+ if (!results.contains(seq) && (searchResults == null
+ || !searchResults.involvesSequence(seq)))
{
nothighlighted.add(seq);
}
}
results = nothighlighted;
}
+ else
+ {
+ // copy list and add in search results
+ results = new ArrayList(results);
+ if (searchResults != null)
+ {
+ for (SequenceI seq : alignPanel.getAlignViewport().getAlignment()
+ .getSequences())
+ {
+ if (searchResults.involvesSequence(seq))
+ {
+ results.add(seq);
+ }
+ }
+ }
+ }
if (results == null || results.size() == 0)
{