import jalview.datamodel.AlignmentView;
import jalview.datamodel.CigarArray;
import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SearchResultsI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
* @return true if group is defined on the alignment
*/
boolean isSelectionDefinedGroup();
+
+ /**
+ *
+ * @return true if there are search results on the view
+ */
+ boolean hasSearchResults();
+
+ /**
+ * set the search results for the view
+ *
+ * @param results
+ * - or null to clear current results
+ */
+ void setSearchResults(SearchResultsI results);
+
+ /**
+ * get search results for this view (if any)
+ *
+ * @return search results or null
+ */
+ SearchResultsI getSearchResults();
}
AlignViewport av;
- SearchResultsI searchResults = null;
-
boolean fastPaint = false;
int cursorX = 0;
// / Highlight search Results once all sequences have been drawn
// ////////////////////////////////////////////////////////
- if (searchResults != null)
+ if (av.hasSearchResults())
{
- int[] visibleResults = searchResults.getResults(nextSeq, startRes,
+ int[] visibleResults = av.getSearchResults().getResults(nextSeq,
+ startRes,
endRes);
if (visibleResults != null)
{
public void highlightSearchResults(SearchResultsI results)
{
- searchResults = results;
-
+ av.setSearchResults(results);
repaint();
}
viewport.setFollowHighlight(state);
if (state)
{
- alignPanel.scrollToPosition(
- alignPanel.getSeqPanel().seqCanvas.searchResults, false);
+ alignPanel.scrollToPosition(viewport.getSearchResults(), false);
}
}
AlignViewport av;
- SearchResultsI searchResults = null;
-
boolean fastPaint = false;
int LABEL_WEST;
// / Highlight search Results once all sequences have been drawn
// ////////////////////////////////////////////////////////
- if (searchResults != null)
+ if (av.hasSearchResults())
{
- int[] visibleResults = searchResults.getResults(nextSeq, startRes,
- endRes);
+ int[] visibleResults = av.getSearchResults().getResults(nextSeq,
+ startRes, endRes);
if (visibleResults != null)
{
for (int r = 0; r < visibleResults.length; r += 2)
{
img = null;
- searchResults = results;
+ av.setSearchResults(results);
repaint();
}
*/
private boolean selectionIsDefinedGroup = false;
+
@Override
public boolean isSelectionDefinedGroup()
{
return selectionGroup.getContext() == alignment
|| selectionIsDefinedGroup;
}
+
+ /**
+ * null, or currently highlighted results on this view
+ */
+ private SearchResultsI searchResults = null;
+
+ @Override
+ public boolean hasSearchResults()
+ {
+ return searchResults != null;
+ }
+
+ @Override
+ public void setSearchResults(SearchResultsI results)
+ {
+ searchResults = results;
+ }
+
+ @Override
+ public SearchResultsI getSearchResults()
+ {
+ return searchResults;
+ }
}