* region in results (if any) and redraw the overview
* @param results
*/
- public void scrollToPosition(SearchResults results) {
- scrollToPosition(results, true);
+ public boolean scrollToPosition(SearchResults results) {
+ return scrollToPosition(results, true);
}
/**
* scroll the view to show the position of the highlighted
* region in results (if any)
* @param results
* @param redrawOverview - when set, the overview will be recalculated (takes longer)
+ * @return false if results were not found
*/
- public void scrollToPosition(SearchResults results, boolean redrawOverview) {
+ public boolean scrollToPosition(SearchResults results, boolean redrawOverview) {
+ // TODO: properly locate search results in view when large numbers of hidden columns exist before highlighted region
// do we need to scroll the panel?
if (results != null && results.getSize()>0)
{
int seqIndex = av.alignment.findIndex(results);
if (seqIndex==-1)
{
- return;
+ return false;
}
SequenceI seq = av.alignment.getSequenceAt(seqIndex);
+
int [] r = results.getResults(seq, seq.getStart(), seq.getEnd());
if (r==null)
{
- return;
+ return false;
}
int start = r[0];
int end = r[1];
if (start<0)
{
- return;
+ return false;
}
if (end==seq.getEnd())
{
- return;
+ return false;
}
if (!av.wrapAlignment)
{
overviewPanel.setBoxPosition();
}
paintAlignment(!redrawOverview);
+ return true;
}
void scrollToWrappedVisible(int res)