public boolean scrollToPosition(SearchResults results,
boolean redrawOverview)
{
+
// do we need to scroll the panel?
if (results != null && results.getSize() > 0)
{
}
if (av.applet.debug) {
// DEBUG
- System.out.println("DEBUG: scroll: start=" + r[0]
+ /*System.out.println("DEBUG: scroll: start=" + r[0]
+ " av.getStartRes()=" + av.getStartRes() + " end=" + r[1]
+ " seq.end=" + seq.getEnd() + " av.getEndRes()="
+ av.getEndRes() + " hextent=" + hextent);
+ */
}
int start = r[0];
int end = r[1];
}
public boolean scrollTo(int ostart, int end, int seqIndex, boolean scrollToNearest, boolean redrawOverview)
{
- int start=-1;
+ int startv, endv, starts, ends, width;
+
+ int start=-1;
if (av.hasHiddenColumns)
{
start = av.getColumnSelection().findColumnPosition(ostart);
// don't scroll - position isn't visible
return false;
}
- }
}
- if (!av.wrapAlignment)
- {
+ }
+ else
+ {
+ start = ostart;
+ }
+ if (!av.wrapAlignment)
+ {
+ /*
+ int spos=av.getStartRes(),sqpos=av.getStartSeq();
+ if ((startv = av.getStartRes()) >= start)
+ {
+ spos=start-1;
+// seqIn
+// setScrollValues(start - 1, seqIndex);
+ }
+ else if ((endv = av.getEndRes()) <= end)
+ {
+// setScrollValues(spos=startv + 1 + end - endv, seqIndex);
+ spos=startv + 1 + end - endv;
+ }
+ else if ((starts = av.getStartSeq()) > seqIndex)
+ {
+ setScrollValues(av.getStartRes(), seqIndex);
+ }
+ else if ((ends = av.getEndSeq()) <= seqIndex)
+ {
+ setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1);
+ }
+
+ /* */
if ((av.getStartRes() > end)
|| (av.getEndRes() < start)
|| ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
seqIndex = 0;
}
}
+ // System.out.println("trying to scroll to: "+start+" "+seqIndex);
setScrollValues(start, seqIndex);
- }
+ }/**/
}
else
{
annotationSpaceFillerHolder.setSize(new Dimension(e.width, height));
annotationPanelHolder.setSize(new Dimension(d.width, height));
seqPanelHolder.setSize(d.width,seqandannot-height);
+ seqPanel.seqCanvas.setSize(d.width, seqPanel.seqCanvas.getSize().height);
int s=apvscroll.getValue();
if (s>mheight-height)
{
{
width = av.getColumnSelection().findColumnPosition(width);
}
-
- av.setStartRes(x);
- av.setEndRes((x + (seqPanel.seqCanvas.getSize().width / av.charWidth)) - 1);
+ if (x<0) { x = 0; };
hextent = seqPanel.seqCanvas.getSize().width / av.charWidth;
vextent = seqPanel.seqCanvas.getSize().height / av.charHeight;
if ((hextent + x) > width)
{
+ System.err.println("hextent was "+hextent+" and x was "+x);
+
x = width - hextent;
}
if (x < 0)
{
+ System.err.println("x was "+x);
x = 0;
}
}
av.setEndSeq(endSeq);
+ av.setStartRes(x);
+ av.setEndRes((x + (seqPanel.seqCanvas.getSize().width / av.charWidth)) - 1);
+
hscroll.setValues(x, hextent, 0, width);
vscroll.setValues(y, vextent, 0, height);