Displays number of matches found in search
authoramwaterhouse <Andrew Waterhouse>
Mon, 10 Jan 2005 17:39:32 +0000 (17:39 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 10 Jan 2005 17:39:32 +0000 (17:39 +0000)
src/jalview/gui/Finder.java

index d78669c..909ba1f 100755 (executable)
@@ -117,6 +117,7 @@ public class Finder extends GFinder
        if(item.indexOf(searchString,r)>-1)\r
        {\r
          resIndex = item.indexOf(searchString,r);\r
+\r
          searchResults.add( Integer.toString(seqIndex) );\r
          searchResults.add( Integer.toString( resIndex) );\r
          searchResults.add( Integer.toString( (resIndex+searchString.length()-1) ) );\r
@@ -127,6 +128,8 @@ public class Finder extends GFinder
            resIndex++;\r
            break;\r
          }\r
+\r
+         r=resIndex+1;\r
        }\r
       }\r
       if(!found)\r
@@ -143,11 +146,18 @@ public class Finder extends GFinder
       for(int i=0; i<searchResults.size(); i++)\r
         allResults[i] = Integer.parseInt(searchResults.get(i).toString());\r
 \r
+      if (findAll)\r
+      {\r
+        String message =  (searchResults.size()/3) + " matches found.";\r
+        JOptionPane.showInternalMessageDialog(this, message, null,\r
+                                              JOptionPane.INFORMATION_MESSAGE);\r
+      }\r
+\r
+\r
     }\r
     else\r
     {\r
-      JOptionPane.showInternalMessageDialog(this, "Finished searching", null,\r
-                                            JOptionPane.INFORMATION_MESSAGE);\r
+      JOptionPane.showInternalMessageDialog(this, "Finished searching", null, JOptionPane.INFORMATION_MESSAGE);\r
       resIndex=0;\r
       seqIndex=0;\r
     }\r