/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
import jalview.api.AlignmentViewPanel;
import jalview.bin.JalviewLite;
import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SearchResults;
+import jalview.datamodel.SearchResultsI;
import jalview.datamodel.SequenceI;
import jalview.structure.StructureSelectionManager;
* Highlight the given results on the alignment.
*
*/
- public void highlightSearchResults(SearchResults results)
+ public void highlightSearchResults(SearchResultsI results)
{
scrollToPosition(results);
seqPanel.seqCanvas.highlightSearchResults(results);
* @param results
* @return false if results were not found
*/
- public boolean scrollToPosition(SearchResults results)
+ public boolean scrollToPosition(SearchResultsI results)
{
return scrollToPosition(results, true);
}
* - when set, the overview will be recalculated (takes longer)
* @return false if results were not found
*/
- public boolean scrollToPosition(SearchResults results,
+ public boolean scrollToPosition(SearchResultsI results,
boolean redrawOverview)
{
- return scrollToPosition(results, redrawOverview, false);
+ return scrollToPosition(results, 0, redrawOverview, false);
}
/**
* - when set, the overview will be recalculated (takes longer)
* @return false if results were not found
*/
- public boolean scrollToPosition(SearchResults results,
+ public boolean scrollToPosition(SearchResultsI results,
+ int verticalOffset,
boolean redrawOverview, boolean centre)
{
// do we need to scroll the panel?
{
return false;
}
+ /*
+ * allow for offset of target sequence (actually scroll to one above it)
+ */
+
SequenceI seq = alignment.getSequenceAt(seqIndex);
int[] r = results.getResults(seq, 0, alignment.getWidth());
if (r == null)
{
return false;
}
+
+ /*
+ * allow for offset of target sequence (actually scroll to one above it)
+ */
+ seqIndex = Math.max(0, seqIndex - verticalOffset);
return scrollTo(start, end, seqIndex, false, redrawOverview);
}
return true;
{
start = ostart;
}
+
if (!av.getWrapAlignment())
{
/*
* @param seqOffset
* the number of visible sequences to show above the mapped region
*/
- protected void scrollToCentre(SearchResults sr, int seqOffset)
+ protected void scrollToCentre(SearchResultsI sr, int seqOffset)
{
/*
* To avoid jumpy vertical scrolling (if some sequences are gapped or not
* mapped), we can make the scroll-to location a sequence above the one
* actually mapped.
*/
- SequenceI mappedTo = sr.getResultSequence(0);
+ SequenceI mappedTo = sr.getResults().get(0).getSequence();
List<SequenceI> seqs = av.getAlignment().getSequences();
/*
{
return; // failsafe, shouldn't happen
}
- sequenceIndex = Math.max(0, sequenceIndex - seqOffset);
- sr.getResults().get(0)
- .setSequence(av.getAlignment().getSequenceAt(sequenceIndex));
/*
* Scroll to position but centring the target residue. Also set a state flag
* to prevent adjustmentValueChanged performing this recursively.
*/
setFollowingComplementScroll(true);
- scrollToPosition(sr, true, true);
+ // this should be scrollToPosition(sr,verticalOffset,
+ scrollToPosition(sr, seqOffset, true, true);
}
private void sendViewPosition()