{
boolean scrolled = scrollToPosition(results, 0, true, false);
- boolean noFastPaint = scrolled && av.getWrapAlignment();
+ boolean fastPaint = !(scrolled && av.getWrapAlignment());
- getSeqPanel().seqCanvas.highlightSearchResults(results, noFastPaint);
+ getSeqPanel().seqCanvas.highlightSearchResults(results, fastPaint);
}
/**
highlight.addResult(sequences.get(0), sf.getBegin(),
sf.getEnd());
- ap.getSeqPanel().seqCanvas.highlightSearchResults(highlight,
- true);
+ ap.getSeqPanel().seqCanvas.highlightSearchResults(highlight);
}
FeatureColourI col = fr.getFeatureStyle(name.getText());
if (col == null)
* suppress fastPaint here - if feature colour changed,
* we need to repaint the whole alignment
*/
- ap.getSeqPanel().seqCanvas.highlightSearchResults(null,
- true);
+ ap.getSeqPanel().seqCanvas.highlightSearchResults(null);
ap.paintAlignment(true, true);
}
}).response(new RunResponse(JvOptionPane.NO_OPTION)
sequences.get(0).getDatasetSequence().deleteFeature(sf);
// update Feature Settings for removal of feature / group
fr.featuresAdded();
- ap.getSeqPanel().seqCanvas.highlightSearchResults(null,
- true);
+ ap.getSeqPanel().seqCanvas.highlightSearchResults(null);
ap.paintAlignment(true, true);
}
}).defaultResponse(new Runnable()
{
public void run()
{
- ap.getSeqPanel().seqCanvas.highlightSearchResults(null,
- true);
+ ap.getSeqPanel().seqCanvas.highlightSearchResults(null);
ap.paintAlignment(true, true);
}
}).showInternalDialog(mainPanel, title,
* Highlights search results in the visible region by rendering as white text
* on a black background. Any previous highlighting is removed. Answers true
* if any highlight was left on the visible alignment (so status bar should be
+ * set to match), else false. This method does _not_ set the 'fastPaint' flag,
+ * so allows the next repaint to update the whole display.
+ *
+ * @param results
+ * @return
+ */
+ public boolean highlightSearchResults(SearchResultsI results)
+ {
+ return highlightSearchResults(results, false);
+
+ }
+
+ /**
+ * Highlights search results in the visible region by rendering as white text
+ * on a black background. Any previous highlighting is removed. Answers true
+ * if any highlight was left on the visible alignment (so status bar should be
* set to match), else false.
* <p>
- * Currently fastPaint is not implemented for wrapped alignments. If a wrapped
- * alignment had to be scrolled to show the highlighted region, then it should
- * be fully redrawn, otherwise a fast paint can be performed. This argument
- * could be removed if fast paint of scrolled wrapped alignment is coded in
- * future (JAL-2609).
+ * Optionally, set the 'fastPaint' flag for a faster redraw if only the
+ * highlighted regions are modified. This speeds up highlighting across linked
+ * alignments.
+ * <p>
+ * Currently fastPaint is not implemented for scrolled wrapped alignments. If
+ * a wrapped alignment had to be scrolled to show the highlighted region, then
+ * it should be fully redrawn, otherwise a fast paint can be performed. This
+ * argument could be removed if fast paint of scrolled wrapped alignment is
+ * coded in future (JAL-2609).
*
* @param results
- * @param noFastPaint
+ * @param doFastPaint
+ * if true, sets a flag so the next repaint only redraws the modified
+ * image
* @return
*/
public boolean highlightSearchResults(SearchResultsI results,
- boolean noFastPaint)
+ boolean doFastPaint)
{
if (fastpainting)
{
boolean wrapped = av.getWrapAlignment();
try
{
- fastPaint = !noFastPaint;
+ fastPaint = doFastPaint;
fastpainting = fastPaint;
/*
ap.setToScrollComplementPanel(true);
}
- boolean noFastPaint = wasScrolled && av.getWrapAlignment();
- if (seqCanvas.highlightSearchResults(results, noFastPaint))
+ boolean fastPaint = !(wasScrolled && av.getWrapAlignment());
+ if (seqCanvas.highlightSearchResults(results, fastPaint))
{
setStatusMessage(results);
}
SearchResultsI highlight = new SearchResults();
highlight.addResult(sequence, features.get(0).getBegin(), features
.get(0).getEnd());
- seqCanvas.highlightSearchResults(highlight, false);
+ seqCanvas.highlightSearchResults(highlight, true);
/*
* open the Amend Features dialog; clear highlighting afterwards,