FeatureColourI removed
[jalview.git] / src / jalview / analysis / Finder.java
index 756897c..1fa15e3 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
- * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
+ * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
  * 
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -68,6 +68,7 @@ public class Finder
       searchString = searchString.toUpperCase();
     }
     regex = new com.stevesoft.pat.Regex(searchString);
+    regex.setIgnoreCase(!caseSensitive);
     searchResults = new SearchResults();
     idMatch = new Vector();
     Sequence seq;
@@ -111,7 +112,7 @@ public class Finder
     {
       seq = (Sequence) alignment.getSequenceAt(seqIndex);
 
-      if ((selection != null)
+      if ((selection != null && selection.getSize()>0)
               && !selection.getSequences(null).contains(seq))
       {
         seqIndex++;
@@ -121,8 +122,6 @@ public class Finder
       }
 
       item = seq.getSequenceAsString();
-      if (!caseSensitive)
-        item = item.toUpperCase();
 
       if ((selection != null)
               && (selection.getEndRes() < alignment.getWidth() - 1))
@@ -157,7 +156,7 @@ public class Finder
         {
           resIndex = regex.matchedFrom();
 
-          if ((selection != null)
+          if ((selection != null && selection.getSize()>0)
                   && ((resIndex + Integer.parseInt(spaces.elementAt(
                           resIndex).toString())) < selection.getStartRes()))
           {