JAL-3060 more extensive extract method refactoring of FeatureEditor
[jalview.git] / src / jalview / gui / SeqPanel.java
index db0d902..875743b 100644 (file)
@@ -745,8 +745,8 @@ public class SeqPanel extends JPanel
       ap.setToScrollComplementPanel(true);
     }
 
-    boolean noFastPaint = wasScrolled && av.getWrapAlignment();
-    if (seqCanvas.highlightSearchResults(results, noFastPaint))
+    boolean fastPaint = !(wasScrolled && av.getWrapAlignment());
+    if (seqCanvas.highlightSearchResults(results, fastPaint))
     {
       setStatusMessage(results);
     }
@@ -1673,23 +1673,13 @@ public class SeqPanel extends JPanel
         SearchResultsI highlight = new SearchResults();
         highlight.addResult(sequence, features.get(0).getBegin(), features
                 .get(0).getEnd());
-        seqCanvas.highlightSearchResults(highlight, false);
+        seqCanvas.highlightSearchResults(highlight, true);
 
         /*
-         * open the Amend Features dialog; clear highlighting afterwards,
-         * whether changes were made or not
+         * open the Amend Features dialog
          */
-        List<SequenceI> seqs = Collections.singletonList(sequence);
-        new FeatureEditor(ap).amendFeatures(seqs, features, false,
-                new Runnable()
-                {
-                  @Override
-                  public void run()
-                  {
-                    av.setSearchResults(null); // clear highlighting
-                    seqCanvas.repaint(); // draw new/amended features
-                  }
-                });
+        new FeatureEditor(ap, Collections.singletonList(sequence), features,
+                false).showDialog();
       }
     }
   }