+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param e DOCUMENT ME!\r
+ */\r
+ public void mouseReleased(MouseEvent e)\r
+ {\r
+ if (scrollThread != null)\r
+ {\r
+ scrollThread.running = false;\r
+ }\r
+\r
+ mouseDragging = false;\r
+ PaintRefresher.Refresh(av.alignment);\r
+ }\r
+\r
+ /**\r
+ * DOCUMENT ME!\r
+ *\r
+ * @param found DOCUMENT ME!\r
+ */\r
+ public void highlightSearchResults(java.util.Vector found)\r
+ {\r
+ idCanvas.setHighlighted(found);\r
+\r
+ if (found == null)\r
+ {\r
+ return;\r
+ }\r
+\r
+ int index = av.alignment.findIndex((SequenceI) found.get(0));\r
+\r
+ // do we need to scroll the panel?\r
+ if ((av.getStartSeq() > index) || (av.getEndSeq() < index))\r
+ {\r
+ alignPanel.setScrollValues(av.getStartRes(), index);\r
+ }\r
+ }\r
+\r
+ // this class allows scrolling off the bottom of the visible alignment\r
+ class ScrollThread extends Thread\r
+ {\r
+ boolean running = false;\r
+ boolean up = true;\r
+\r
+ public ScrollThread(boolean up)\r
+ {\r
+ this.up = up;\r
+ start();\r
+ }\r
+\r
+ public void stopScrolling()\r
+ {\r
+ running = false;\r
+ }\r
+\r
+ public void run()\r
+ {\r
+ running = true;\r
+\r
+ while (running)\r
+ {\r
+ if (alignPanel.scrollUp(up))\r
+ {\r
+ // scroll was ok, so add new sequence to selection\r
+ int seq = av.getStartSeq();\r
+\r
+ if (!up)\r
+ {\r
+ seq = av.getEndSeq();\r
+ }\r
+\r
+ if (seq < lastid)\r
+ {\r
+ selectSeqs(lastid - 1, seq);\r
+ }\r
+ else if (seq > lastid)\r
+ {\r
+ selectSeqs(lastid + 1, seq);\r
+ }\r
+\r
+ lastid = seq;\r
+ }\r
+ else\r
+ {\r
+ running = false;\r
+ }\r
+\r
+ alignPanel.repaint();\r
+\r
+ try\r
+ {\r
+ Thread.sleep(100);\r
+ }\r
+ catch (Exception ex)\r
+ {\r
+ }\r
+ }\r
+ }\r
+ }\r