JAL-3060 extract FeatureEditor class
[jalview.git] / src / jalview / gui / Finder.java
index f526592..244e6df 100755 (executable)
@@ -223,21 +223,25 @@ public class Finder extends GFinder
     for (SearchResultMatchI match : searchResults.getResults())
     {
       seqs.add(match.getSequence().getDatasetSequence());
-      features.add(new SequenceFeature(searchString, desc, null,
-              match.getStart(), match.getEnd(), desc));
+      features.add(new SequenceFeature(searchString, desc, match.getStart(),
+              match.getEnd(), desc));
     }
 
-    if (ap.getSeqPanel().seqCanvas.getFeatureRenderer().amendFeatures(seqs,
-            features, true, ap))
+    new FeatureEditor(ap).amendFeatures(seqs, features, true, new Runnable()
     {
-      /*
-       * ensure feature display is turned on to show the new features,
-       * and remove them as highlighted regions
-       */
-      ap.alignFrame.showSeqFeatures.setSelected(true);
-      av.setShowSequenceFeatures(true);
-      ap.highlightSearchResults(null);
-    }
+      @Override
+              public void run()
+              {
+
+                /*
+                 * ensure feature display is turned on to show the new features,
+                 * and remove them as highlighted regions
+                 */
+                ap.alignFrame.showSeqFeatures.setSelected(true);
+                av.setShowSequenceFeatures(true);
+                ap.highlightSearchResults(null);
+              }
+            });
   }
 
   /**