MousePos o = (MousePos) obj;
boolean b = (column == o.column && seqIndex == o.seqIndex
&& annotationIndex == o.annotationIndex);
- // System.out.println(obj + (b ? "= " : "!= ") + this);
return b;
}
}
else
{
- seqIndex = Math.min((y / charHeight) + av.getRanges().getStartSeq(),
+ ViewportRanges ranges = av.getRanges();
+ seqIndex = Math.min((y / charHeight) + ranges.getStartSeq(),
alignmentHeight - 1);
+ seqIndex = Math.min(seqIndex, ranges.getEndSeq());
}
return new MousePos(col, seqIndex, annIndex);
return;
}
- // System.out.print(y1+" "+y2+" "+fixedLeft+" "+fixedRight+"~~");
// Selection spans a hidden region
if (fixedLeft < y1 && (fixedRight > y2 || fixedRight == -1))
{
@Override
public void mouseExited(MouseEvent e)
{
+ if (ap.getScalePanel().isMouseDragging())
+ {
+ ap.getScalePanel().mouseExited(e);
+ return;
+ }
+ lastMousePosition = null;
ap.alignFrame.setStatus(" ");
if (av.getWrapAlignment())
{
return;
}
-
if (mouseDragging && scrollThread == null)
{
startScrolling(e.getPoint());
{
scrollThread = new ScrollThread();
scrollThread.setMousePosition(mousePos);
- if (!Platform.isJS())
- {
- /*
- * Java - run in a new thread
- */
- scrollThread.start();
- }
- else
+ if (Platform.isJS())
{
/*
* Javascript - run every 20ms until scrolling stopped
* or reaches the limit of scrollable alignment
*/
- // java.util.Timer version:
- // Timer t = new Timer("ScrollThreadTimer", true);
- // TimerTask task = new TimerTask()
- // {
- // @Override
- // public void run()
- // {
- // if (!scrollThread.scrollOnce())
- // {
- // cancel();
- // }
- // }
- // };
- // t.schedule(task, 20, 20);
Timer t = new Timer(20, new ActionListener()
{
@Override
// if (!scrollOnce() {t.stop();}) gives compiler error :-(
scrollThread.scrollOnce();
}
- }
- });
- t.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
if (scrollThread == null)
{
- // finished and nulled itself
- t.stop();
+ // SeqPanel.stopScrolling called
+ ((Timer) e.getSource()).stop();
}
}
});
t.start();
}
+ else
+ {
+ /*
+ * Java - run in a new thread
+ */
+ scrollThread.start();
+ }
}
}