Better treatment of error states and cancellability in wsclient.
[jalview.git] / src / jalview / gui / IdPanel.java
index 8903ce3..fcf8e92 100755 (executable)
@@ -121,7 +121,7 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
       SequenceGroup selection = new SequenceGroup();\r
       SequenceGroup sg = av.alignment.findGroup(av.alignment.getSequenceAt(seq));\r
       selection.setStartRes(0);\r
-      selection.setEndRes(av.alignment.getWidth());\r
+      selection.setEndRes(av.alignment.getWidth()-1);\r
       for (int i =0; i< sg.getSize(); i++)\r
         selection.addSequence(sg.getSequenceAt(i));\r
 \r
@@ -140,9 +140,7 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
     else\r
       selectSeq(seq);\r
 \r
-    alignPanel.seqPanel.seqCanvas.paintFlag=true;\r
     alignPanel.repaint();\r
-    repaint();\r
   }\r
 \r
   void selectSeq(int seq)\r
@@ -178,6 +176,20 @@ public class IdPanel extends JPanel implements MouseListener, MouseMotionListene
     PaintRefresher.Refresh(this);\r
   }\r
 \r
+  public void highlightSearchResults( java.util.ArrayList found )\r
+  {\r
+    idCanvas.setHighlighted( found );\r
+\r
+    if(found == null)\r
+      return;\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
+        alignPanel.setScrollValues( av.getStartRes(), index);\r
+  }\r
+\r
   // this class allows scrolling off the bottom of the visible alignment\r
   class ScrollThread\r
       extends Thread\r