- if (mouseDragging && (e.getY() >= getHeight())
- && (av.getAlignment().getHeight() > av.getRanges().getEndSeq()))
+ /**
+ * Starts scrolling either up or down
+ *
+ * @param up
+ */
+ void startScrolling(boolean up)
+ {
+ scrollThread = new ScrollThread(up);
+ if (Platform.isJS())
+ {
+ /*
+ * for JalviewJS using Swing Timer
+ */
+ Timer t = new Timer(20, new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ if (scrollThread != null)
+ {
+ // if (!scrollOnce() {t.stop();}) gives compiler error :-(
+ scrollThread.scrollOnce();
+ }
+ }
+ });
+ t.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ if (scrollThread == null)
+ {
+ // IdPanel.stopScrolling called
+ t.stop();
+ }
+ }
+ });
+ t.start();
+ }
+ else
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */