Merge branch 'JAL-3878_ws-overhaul-3' into mmw/Release_2_12_ws_merge
[jalview.git] / src / jalview / gui / AlignFrame.java
index 7011d4d..63bbb72 100644 (file)
  */
 package jalview.gui;
 
+import java.util.Locale;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
+import java.awt.print.PageFormat;
+import java.awt.print.PrinterJob;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Deque;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.ButtonGroup;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JLayeredPane;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.SwingUtilities;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
+
+import ext.vamsas.ServiceHandle;
 import jalview.analysis.AlignmentSorter;
 import jalview.analysis.AlignmentUtils;
 import jalview.analysis.CrossRef;
@@ -38,6 +103,7 @@ import jalview.api.SplitContainerI;
 import jalview.api.ViewStyleI;
 import jalview.api.analysis.SimilarityParamsI;
 import jalview.bin.Cache;
+import jalview.bin.Console;
 import jalview.bin.Jalview;
 import jalview.commands.CommandI;
 import jalview.commands.EditCommand;
@@ -98,6 +164,7 @@ import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemes;
 import jalview.schemes.ResidueColourScheme;
 import jalview.schemes.TCoffeeColourScheme;
+import jalview.util.HttpUtils;
 import jalview.util.ImageMaker.TYPE;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
@@ -197,7 +264,6 @@ public class AlignFrame extends GAlignFrame
 {
 
   public static int frameCount;
-
   public static final int DEFAULT_WIDTH = 700;
 
   public static final int DEFAULT_HEIGHT = 500;
@@ -231,7 +297,6 @@ public class AlignFrame extends GAlignFrame
   private int id;
 
   private DataSourceType protocol ;
-
   /**
    * Creates a new AlignFrame object with specific width and height.
    * 
@@ -326,9 +391,7 @@ public class AlignFrame extends GAlignFrame
   public AlignFrame(AlignmentI al, HiddenColumns hiddenColumns, int width,
           int height, String sequenceSetId, String viewId)
   {
-
     id = (++frameCount);
-
     setSize(width, height);
 
     if (al.getDataset() == null)
@@ -385,7 +448,6 @@ public class AlignFrame extends GAlignFrame
    * initalise the alignframe from the underlying viewport data and the
    * configurations
    */
-
   void init()
   {
     boolean newPanel = (alignPanel == null);
@@ -408,7 +470,6 @@ public class AlignFrame extends GAlignFrame
       alignPanel = new AlignmentPanel(this, viewport);
     }
     addAlignmentPanel(alignPanel, newPanel);
-
     // setBackground(Color.white); // BH 2019
 
     if (!Jalview.isHeadlessMode())
@@ -431,7 +492,7 @@ public class AlignFrame extends GAlignFrame
       // modifyPID.setEnabled(false);
     }
 
-    String sortby = jalview.bin.Cache.getDefault(Preferences.SORT_ALIGNMENT,
+    String sortby = Cache.getDefault(Preferences.SORT_ALIGNMENT,
             "No sort");
 
     if (sortby.equals("Id"))
@@ -476,14 +537,14 @@ public class AlignFrame extends GAlignFrame
       wrapMenuItem_actionPerformed(null);
     }
 
-    if (jalview.bin.Cache.getDefault(Preferences.SHOW_OVERVIEW, false))
+    if (Cache.getDefault(Preferences.SHOW_OVERVIEW, false))
     {
       this.overviewMenuItem_actionPerformed(null);
     }
 
     addKeyListener();
 
-    final List<AlignmentPanel> selviews = new ArrayList<>();
+    final List<AlignmentViewPanel> selviews = new ArrayList<>();
     final List<AlignmentPanel> origview = new ArrayList<>();
     final String menuLabel = MessageManager
             .getString("label.copy_format_from");
@@ -551,16 +612,15 @@ public class AlignFrame extends GAlignFrame
                 }
               }
             });
-    if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
+    if (Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase(Locale.ROOT)
             .indexOf("devel") > -1
-            || Cache.getDefault("VERSION", "DEVELOPMENT").toLowerCase()
-                    .indexOf("test") > -1)
+            || Cache.getDefault("VERSION", "DEVELOPMENT")
+                    .toLowerCase(Locale.ROOT).indexOf("test") > -1)
     {
       formatMenu.add(vsel);
     }
     addFocusListener(new FocusAdapter()
     {
-
       @Override
       public void focusGained(FocusEvent e)
       {
@@ -579,7 +639,6 @@ public class AlignFrame extends GAlignFrame
    * @param format
    *          format of file
    */
-
   @Deprecated
   public void setFileName(String file, FileFormatI format)
   {
@@ -610,7 +669,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param file
    */
-
   public void setFileObject(File file)
   {
     this.fileObject = file;
@@ -620,12 +678,10 @@ public class AlignFrame extends GAlignFrame
    * Add a KeyListener with handlers for various KeyPressed and KeyReleased
    * events
    */
-
   void addKeyListener()
   {
     addKeyListener(new KeyAdapter()
     {
-
       @Override
       public void keyPressed(KeyEvent evt)
       {
@@ -655,7 +711,7 @@ public class AlignFrame extends GAlignFrame
           }
           if (viewport.cursorMode)
           {
-            alignPanel.getSeqPanel().moveCursor(0, 1);
+            alignPanel.getSeqPanel().moveCursor(0, 1, evt.isShiftDown());
           }
           break;
 
@@ -666,7 +722,7 @@ public class AlignFrame extends GAlignFrame
           }
           if (viewport.cursorMode)
           {
-            alignPanel.getSeqPanel().moveCursor(0, -1);
+            alignPanel.getSeqPanel().moveCursor(0, -1, evt.isShiftDown());
           }
 
           break;
@@ -679,7 +735,7 @@ public class AlignFrame extends GAlignFrame
           }
           else
           {
-            alignPanel.getSeqPanel().moveCursor(-1, 0);
+            alignPanel.getSeqPanel().moveCursor(-1, 0, evt.isShiftDown());
           }
 
           break;
@@ -691,7 +747,7 @@ public class AlignFrame extends GAlignFrame
           }
           else
           {
-            alignPanel.getSeqPanel().moveCursor(1, 0);
+            alignPanel.getSeqPanel().moveCursor(1, 0, evt.isShiftDown());
           }
           break;
 
@@ -957,7 +1013,6 @@ public class AlignFrame extends GAlignFrame
    * Configure menu items that vary according to whether the alignment is
    * nucleotide or protein
    */
-
   public void setGUINucleotide()
   {
     AlignmentI al = getViewport().getAlignment();
@@ -982,7 +1037,6 @@ public class AlignFrame extends GAlignFrame
    * operation that affects the data in the current view (selection changed,
    * etc) to update the menus to reflect the new state.
    */
-
   @Override
   public void setMenusForViewport()
   {
@@ -996,7 +1050,6 @@ public class AlignFrame extends GAlignFrame
    * @param av
    *          AlignViewport
    */
-
   public void setMenusFromViewport(AlignViewport av)
   {
     padGapsMenuitem.setSelected(av.isPadGaps());
@@ -1052,7 +1105,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param b
    */
-
   public void setGroovyEnabled(boolean b)
   {
     runGroovy.setEnabled(b);
@@ -1065,7 +1117,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @see jalview.gui.IProgressIndicator#setProgressBar(java.lang.String, long)
    */
-
   @Override
   public void setProgressBar(String message, long id)
   {
@@ -1095,7 +1146,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @return true if any progress bars are still active
    */
-
   @Override
   public boolean operationInProgress()
   {
@@ -1107,7 +1157,6 @@ public class AlignFrame extends GAlignFrame
    * will cause the status bar to be hidden, with possibly undesirable flicker
    * of the screen layout.
    */
-
   @Override
   public void setStatus(String text)
   {
@@ -1117,10 +1166,9 @@ public class AlignFrame extends GAlignFrame
   /*
    * Added so Castor Mapping file can obtain Jalview Version
    */
-
   public String getVersion()
   {
-    return jalview.bin.Cache.getProperty("VERSION");
+    return Cache.getProperty("VERSION");
   }
 
   public FeatureRenderer getFeatureRenderer()
@@ -1433,10 +1481,7 @@ public class AlignFrame extends GAlignFrame
       Desktop.getInstance().closeAssociatedWindows();
 
       FileLoader loader = new FileLoader();
-//      DataSourceType protocol = fileName.startsWith("http:")
-//              ? DataSourceType.URL
-//              : DataSourceType.FILE;
-        loader.LoadFile(viewport, (fileObject == null ? fileName : fileObject), protocol, currentFileFormat);
+      loader.LoadFile(viewport, (fileObject == null ? fileName : fileObject), protocol, currentFileFormat);
     }
     else
     {
@@ -1467,7 +1512,6 @@ public class AlignFrame extends GAlignFrame
         final FeatureSettings nfs = newframe.featureSettings;
         SwingUtilities.invokeLater(new Runnable()
         {
-
           @Override
           public void run()
           {
@@ -1479,7 +1523,6 @@ public class AlignFrame extends GAlignFrame
       }
       this.closeMenuItem_actionPerformed(true);
     }
-
   }
 
   @Override
@@ -1499,7 +1542,7 @@ public class AlignFrame extends GAlignFrame
   public void save_actionPerformed(ActionEvent e)
   {
     if (fileName == null || (currentFileFormat == null)
-            || fileName.startsWith("http"))
+            || HttpUtils.startsWithHttpOrHttps(fileName))
     {
       saveAs_actionPerformed();
     }
@@ -1513,7 +1556,6 @@ public class AlignFrame extends GAlignFrame
    * Saves the alignment to a file with a name chosen by the user, if necessary
    * warning if a file would be overwritten
    */
-
   @Override
   public void saveAs_actionPerformed()
   {
@@ -1568,17 +1610,25 @@ public class AlignFrame extends GAlignFrame
    *
    * @return true if last call to saveAlignment(file, format) was successful.
    */
-
   public boolean isSaveAlignmentSuccessful()
   {
 
     if (!lastSaveSuccessful)
     {
-      JvOptionPane.showInternalMessageDialog(this, MessageManager
-              .formatMessage("label.couldnt_save_file", new Object[]
-              { lastFilenameSaved }),
-              MessageManager.getString("label.error_saving_file"),
-              JvOptionPane.WARNING_MESSAGE);
+      if (!Platform.isHeadless())
+      {
+        JvOptionPane.showInternalMessageDialog(this, MessageManager
+                .formatMessage("label.couldnt_save_file", new Object[]
+                { lastFilenameSaved }),
+                MessageManager.getString("label.error_saving_file"),
+                JvOptionPane.WARNING_MESSAGE);
+      }
+      else
+      {
+        Console.error(MessageManager
+                .formatMessage("label.couldnt_save_file", new Object[]
+                { lastFilenameSaved }));
+      }
     }
     else
     {
@@ -1601,7 +1651,6 @@ public class AlignFrame extends GAlignFrame
    * @param file
    * @param format
    */
-
   public void saveAlignment(String file, FileFormatI format)
   {
     lastSaveSuccessful = true;
@@ -1629,7 +1678,6 @@ public class AlignFrame extends GAlignFrame
     AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
     Runnable cancelAction = new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -1638,7 +1686,6 @@ public class AlignFrame extends GAlignFrame
     };
     Runnable outputAction = new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -1658,32 +1705,65 @@ public class AlignFrame extends GAlignFrame
         {
           // create backupfiles object and get new temp filename destination
           boolean doBackup = BackupFiles.getEnabled();
-          BackupFiles backupfiles = doBackup ? new BackupFiles(file) : null;
+          BackupFiles backupfiles = null;
+          if (doBackup)
+          {
+            Console.trace(
+                    "ALIGNFRAME making backupfiles object for " + file);
+            backupfiles = new BackupFiles(file);
+          }
           try
           {
             String tempFilePath = doBackup ? backupfiles.getTempFilePath()
                     : file;
+            Console.trace("ALIGNFRAME setting PrintWriter");
             PrintWriter out = new PrintWriter(new FileWriter(tempFilePath));
 
+            if (backupfiles != null)
+            {
+              Console.trace("ALIGNFRAME about to write to temp file "
+                      + backupfiles.getTempFilePath());
+            }
+
             out.print(output);
+            Console.trace("ALIGNFRAME about to close file");
             out.close();
+            Console.trace("ALIGNFRAME closed file");
             AlignFrame.this.setTitle(file);
             statusBar.setText(MessageManager.formatMessage(
                     "label.successfully_saved_to_file_in_format",
                     new Object[]
                     { fileName, format.getName() }));
             lastSaveSuccessful = true;
+          } catch (IOException e)
+          {
+            lastSaveSuccessful = false;
+            Console.error(
+                    "ALIGNFRAME Something happened writing the temp file");
+            Console.error(e.getMessage());
+            Console.debug(Cache.getStackTraceString(e));
           } catch (Exception ex)
           {
             lastSaveSuccessful = false;
-            ex.printStackTrace();
+            Console.error(
+                    "ALIGNFRAME Something unexpected happened writing the temp file");
+            Console.error(ex.getMessage());
+            Console.debug(Cache.getStackTraceString(ex));
           }
 
           if (doBackup)
           {
             backupfiles.setWriteSuccess(lastSaveSuccessful);
+            Console.debug("ALIGNFRAME writing temp file was "
+                    + (lastSaveSuccessful ? "" : "NOT ") + "successful");
             // do the backup file roll and rename the temp file to actual file
+            Console.trace(
+                    "ALIGNFRAME about to rollBackupsAndRenameTempFile");
             lastSaveSuccessful = backupfiles.rollBackupsAndRenameTempFile();
+            Console.debug(
+                    "ALIGNFRAME performed rollBackupsAndRenameTempFile "
+                            + (lastSaveSuccessful ? "" : "un")
+                            + "successfully");
           }
         }
       }
@@ -1713,7 +1793,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param fileFormatName
    */
-
   @Override
   protected void outputText_actionPerformed(String fileFormatName)
   {
@@ -1722,7 +1801,6 @@ public class AlignFrame extends GAlignFrame
     AlignExportSettingsI options = new AlignExportSettingsAdapter(false);
     Runnable outputAction = new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -1773,7 +1851,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void htmlMenuItem_actionPerformed(ActionEvent e)
   {
@@ -1789,7 +1866,6 @@ public class AlignFrame extends GAlignFrame
   }
 
   // ??
-
   public void createImageMap(File file, String image)
   {
     alignPanel.makePNGImageMap(file, image);
@@ -1801,7 +1877,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param f
    */
-
   @Override
   public void createPNG(File f)
   {
@@ -1814,7 +1889,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param f
    */
-
   @Override
   public void createEPS(File f)
   {
@@ -1827,7 +1901,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param f
    */
-
   @Override
   public void createSVG(File f)
   {
@@ -1847,7 +1920,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void printMenuItem_actionPerformed(ActionEvent e)
   {
@@ -1873,7 +1945,7 @@ public class AlignFrame extends GAlignFrame
           throws IOException, InterruptedException
   {
     final JalviewFileChooser chooser = new JalviewFileChooser(
-            jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+            Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new JalviewFileView());
     String tooltip = MessageManager
             .getString("label.load_jalview_annotations");
@@ -1881,12 +1953,11 @@ public class AlignFrame extends GAlignFrame
     chooser.setToolTipText(tooltip);
     chooser.setResponseHandler(0, new Runnable()
     {
-
       @Override
       public void run()
       {
         String choice = chooser.getSelectedFile().getPath();
-        jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
+        Cache.setProperty("LAST_DIRECTORY", choice);
         loadJalviewDataFile(chooser.getSelectedFile(), null, null, null);
       }
     });
@@ -1900,7 +1971,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param closeAllTabs
    */
-
   @Override
   public void closeMenuItem_actionPerformed(boolean closeAllTabs)
   {
@@ -1955,7 +2025,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param panelToClose
    */
-
   public void closeView(AlignmentPanel panelToClose)
   {
     int index = tabbedPane.getSelectedIndex();
@@ -1979,7 +2048,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * DOCUMENT ME!
    */
-
   void updateEditMenuBar()
   {
 
@@ -2033,7 +2101,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @return alignment objects for all views
    */
-
   AlignmentI[] getViewAlignments()
   {
     if (alignPanels != null)
@@ -2059,7 +2126,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void undoMenuItem_actionPerformed(ActionEvent e)
   {
@@ -2078,7 +2144,7 @@ public class AlignFrame extends GAlignFrame
     {
       if (originalSource != viewport)
       {
-        Cache.log.warn(
+        Console.warn(
                 "Implementation worry: mismatch of viewport origin for undo");
       }
       originalSource.updateHiddenColumns();
@@ -2088,7 +2154,6 @@ public class AlignFrame extends GAlignFrame
       // viewport.getColumnSelection()
       // .getHiddenColumns().size() > 0);
       originalSource.notifyAlignment();
-
     }
   }
 
@@ -2098,7 +2163,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void redoMenuItem_actionPerformed(ActionEvent e)
   {
@@ -2119,7 +2183,7 @@ public class AlignFrame extends GAlignFrame
 
       if (originalSource != viewport)
       {
-        Cache.log.warn(
+        Console.warn(
                 "Implementation worry: mismatch of viewport origin for redo");
       }
       originalSource.updateHiddenColumns();
@@ -2129,7 +2193,6 @@ public class AlignFrame extends GAlignFrame
       // viewport.getColumnSelection()
       // .getHiddenColumns().size() > 0);
       originalSource.notifyAlignment();
-
     }
   }
 
@@ -2176,20 +2239,37 @@ public class AlignFrame extends GAlignFrame
   }
 
   /**
-   * DOCUMENT ME!
+   * Calls AlignmentI.moveSelectedSequencesByOne with current sequence selection
+   * or the sequence under cursor in keyboard mode
    * 
    * @param up
-   *          DOCUMENT ME!
+   *          or down (if !up)
    */
-
   public void moveSelectedSequences(boolean up)
   {
     SequenceGroup sg = viewport.getSelectionGroup();
 
     if (sg == null)
     {
+      if (viewport.cursorMode)
+      {
+        sg = new SequenceGroup();
+        sg.addSequence(viewport.getAlignment().getSequenceAt(
+                alignPanel.getSeqPanel().seqCanvas.cursorY), false);
+      }
+      else
+      {
+        return;
+      }
+    }
+
+    if (sg.getSize() < 1)
+    {
       return;
     }
+
+    // TODO: JAL-3733 - add an event to the undo buffer for this !
+
     viewport.getAlignment().moveSelectedSequencesByOne(sg,
             viewport.getHiddenRepSequences(), up);
     alignPanel.paintAlignment(true, false);
@@ -2306,7 +2386,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void copy_actionPerformed()
   {
@@ -2339,7 +2418,7 @@ public class AlignFrame extends GAlignFrame
               .setContents(new StringSelection(""), null);
 
       Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss,
-              Desktop.getInstance());
+              d);
     } catch (OutOfMemoryError er)
     {
       new OOMWarning("copying region", er);
@@ -2374,7 +2453,6 @@ public class AlignFrame extends GAlignFrame
    * @throws InterruptedException
    * @throws IOException
    */
-
   @Override
   protected void pasteNew_actionPerformed(ActionEvent e)
           throws IOException, InterruptedException
@@ -2390,7 +2468,6 @@ public class AlignFrame extends GAlignFrame
    * @throws InterruptedException
    * @throws IOException
    */
-
   @Override
   protected void pasteThis_actionPerformed(ActionEvent e)
           throws IOException, InterruptedException
@@ -2735,6 +2812,7 @@ public class AlignFrame extends GAlignFrame
       System.out.println("Exception whilst pasting: " + ex);
       // could be anything being pasted in here
     }
+
   }
 
   @Override
@@ -2747,6 +2825,7 @@ public class AlignFrame extends GAlignFrame
       AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH,
               DEFAULT_HEIGHT);
       String newtitle = new String("Flanking alignment");
+
       Desktop d = Desktop.getInstance();
       if (d.jalviewClipboard != null && d.jalviewClipboard[2] != null)
       {
@@ -2789,7 +2868,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Action Cut (delete and copy) the selected region
    */
-
   @Override
   protected void cut_actionPerformed()
   {
@@ -2800,7 +2878,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Performs menu option to Delete the currently selected region
    */
-
   @Override
   protected void delete_actionPerformed()
   {
@@ -2813,7 +2890,6 @@ public class AlignFrame extends GAlignFrame
 
     Runnable okAction = new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -2831,7 +2907,6 @@ public class AlignFrame extends GAlignFrame
         viewport.getAlignment().deleteGroup(sg);
 
         viewport.notifyAlignment();
-
         if (viewport.getAlignment().getHeight() < 1)
         {
           try
@@ -2878,7 +2953,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void deleteGroups_actionPerformed(ActionEvent e)
   {
@@ -2912,7 +2986,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
   {
@@ -2925,7 +2998,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void deselectAllSequenceMenuItem_actionPerformed(ActionEvent e)
   {
@@ -2938,7 +3010,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void invertSequenceMenuItem_actionPerformed(ActionEvent e)
   {
@@ -2978,7 +3049,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void remove2LeftMenuItem_actionPerformed(ActionEvent e)
   {
@@ -2991,7 +3061,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void remove2RightMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3054,7 +3123,6 @@ public class AlignFrame extends GAlignFrame
       }
 
       viewport.notifyAlignment();
-
     }
   }
 
@@ -3064,7 +3132,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void removeGappedColumnMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3106,7 +3173,6 @@ public class AlignFrame extends GAlignFrame
     ranges.setStartRes(seq.findIndex(startRes) - 1);
     viewport.notifyAlignment();
 
-
   }
 
   /**
@@ -3115,7 +3181,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void removeAllGapsMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3143,6 +3208,7 @@ public class AlignFrame extends GAlignFrame
             viewport.getAlignment()));
 
     viewport.getRanges().setStartRes(seq.findIndex(startRes) - 1);
+
     viewport.notifyAlignment();
 
   }
@@ -3153,32 +3219,27 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void padGapsMenuitem_actionPerformed(ActionEvent e)
   {
     viewport.setPadGaps(padGapsMenuitem.isSelected());
     viewport.notifyAlignment();
-
   }
 
   /**
-   * DOCUMENT ME!
+   * Opens a Finder dialog
    * 
    * @param e
-   *          DOCUMENT ME!
    */
-
   @Override
   public void findMenuItem_actionPerformed(ActionEvent e)
   {
-    new Finder();
+    new Finder(alignPanel, false, null);
   }
 
   /**
    * Create a new view of the current alignment.
    */
-
   @Override
   public void newView_actionPerformed(ActionEvent e)
   {
@@ -3194,7 +3255,6 @@ public class AlignFrame extends GAlignFrame
    *          if true then duplicate all annnotation, groups and settings
    * @return new alignment panel, already displayed.
    */
-
   public AlignmentPanel newView(String viewTitle, boolean copyAnnotation)
   {
     /*
@@ -3267,7 +3327,6 @@ public class AlignFrame extends GAlignFrame
    * @param viewTitle
    * @return
    */
-
   protected String getNewViewName(String viewTitle)
   {
     int index = Desktop.getViewCount(viewport.getSequenceSetId());
@@ -3302,7 +3361,6 @@ public class AlignFrame extends GAlignFrame
    * @param comps
    * @return
    */
-
   protected List<String> getExistingViewNames(List<Component> comps)
   {
     List<String> existingNames = new ArrayList<>();
@@ -3323,7 +3381,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Explode tabbed views into separate windows.
    */
-
   @Override
   public void expandViews_actionPerformed(ActionEvent e)
   {
@@ -3333,7 +3390,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Gather views in separate windows back into a tabbed presentation.
    */
-
   @Override
   public void gatherViews_actionPerformed(ActionEvent e)
   {
@@ -3346,7 +3402,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void font_actionPerformed(ActionEvent e)
   {
@@ -3359,7 +3414,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void seqLimit_actionPerformed(ActionEvent e)
   {
@@ -3389,7 +3443,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @see jalview.jbgui.GAlignFrame#followHighlight_actionPerformed()
    */
-
   @Override
   protected void followHighlight_actionPerformed()
   {
@@ -3411,7 +3464,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void colourTextMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3425,7 +3477,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void wrapMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3462,7 +3513,6 @@ public class AlignFrame extends GAlignFrame
    * @param toggleSeqs
    * @param toggleCols
    */
-
   protected void toggleHiddenRegions(boolean toggleSeqs, boolean toggleCols)
   {
 
@@ -3530,7 +3580,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#hideAllButSelection_actionPerformed(java.awt.
    * event.ActionEvent)
    */
-
   @Override
   public void hideAllButSelection_actionPerformed(ActionEvent e)
   {
@@ -3545,7 +3594,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#hideAllSelection_actionPerformed(java.awt.event
    * .ActionEvent)
    */
-
   @Override
   public void hideAllSelection_actionPerformed(ActionEvent e)
   {
@@ -3565,7 +3613,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showAllhidden_actionPerformed(java.awt.event.
    * ActionEvent)
    */
-
   @Override
   public void showAllhidden_actionPerformed(ActionEvent e)
   {
@@ -3597,7 +3644,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void scaleAbove_actionPerformed(ActionEvent e)
   {
@@ -3612,7 +3658,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void scaleLeft_actionPerformed(ActionEvent e)
   {
@@ -3627,7 +3672,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void scaleRight_actionPerformed(ActionEvent e)
   {
@@ -3642,7 +3686,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void viewBoxesMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3656,7 +3699,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void viewTextMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3670,7 +3712,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void renderGapsMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3716,7 +3757,6 @@ public class AlignFrame extends GAlignFrame
    * @param evt
    *          DOCUMENT ME!
    */
-
   @Override
   public void showSeqFeatures_actionPerformed(ActionEvent evt)
   {
@@ -3733,7 +3773,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param e
    */
-
   @Override
   public void annotationPanelMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3812,7 +3851,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void overviewMenuItem_actionPerformed(ActionEvent e)
   {
@@ -3822,7 +3860,6 @@ public class AlignFrame extends GAlignFrame
     }
 
     JInternalFrame frame = new JInternalFrame();
-
     // BH 2019.07.26 we allow for an embedded
     // undecorated overview with defined size
     frame.setName(Platform.getAppID("overview"));
@@ -3833,7 +3870,6 @@ public class AlignFrame extends GAlignFrame
       dim = null; // hidden, not embedded
     }
     OverviewPanel overview = new OverviewPanel(alignPanel, dim);
-
     frame.setContentPane(overview);
     if (dim == null)
     {
@@ -3857,7 +3893,6 @@ public class AlignFrame extends GAlignFrame
     frame.addInternalFrameListener(
             new javax.swing.event.InternalFrameAdapter()
             {
-
               @Override
               public void internalFrameClosed(
                       javax.swing.event.InternalFrameEvent evt)
@@ -3886,7 +3921,6 @@ public class AlignFrame extends GAlignFrame
    * CovariationColourScheme(viewport.getAlignment().getAlignmentAnnotation
    * ()[0])); }
    */
-
   @Override
   public void annotationColour_actionPerformed()
   {
@@ -3906,7 +3940,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param selected
    */
-
   @Override
   public void applyToAllGroups_actionPerformed(boolean selected)
   {
@@ -3919,7 +3952,6 @@ public class AlignFrame extends GAlignFrame
    * @param name
    *          the name (not the menu item label!) of the colour scheme
    */
-
   @Override
   public void changeColour_actionPerformed(String name)
   {
@@ -3947,7 +3979,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param cs
    */
-
   @Override
   public void changeColour(ColourSchemeI cs)
   {
@@ -3962,7 +3993,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Show the PID threshold slider panel
    */
-
   @Override
   protected void modifyPID_actionPerformed()
   {
@@ -3974,7 +4004,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Show the Conservation slider panel
    */
-
   @Override
   protected void modifyConservation_actionPerformed()
   {
@@ -3986,7 +4015,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Action on selecting or deselecting (Colour) By Conservation
    */
-
   @Override
   public void conservationMenuItem_actionPerformed(boolean selected)
   {
@@ -4008,7 +4036,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Action on selecting or deselecting (Colour) Above PID Threshold
    */
-
   @Override
   public void abovePIDThreshold_actionPerformed(boolean selected)
   {
@@ -4037,7 +4064,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void sortPairwiseMenuItem_actionPerformed(ActionEvent e)
   {
@@ -4055,7 +4081,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void sortIDMenuItem_actionPerformed(ActionEvent e)
   {
@@ -4072,7 +4097,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void sortLengthMenuItem_actionPerformed(ActionEvent e)
   {
@@ -4089,7 +4113,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void sortGroupMenuItem_actionPerformed(ActionEvent e)
   {
@@ -4122,14 +4145,12 @@ public class AlignFrame extends GAlignFrame
     alignPanel.paintAlignment(true, false);
 
   }
-
   /**
    * DOCUMENT ME!
    * 
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void removeRedundancyMenuItem_actionPerformed(ActionEvent e)
   {
@@ -4142,7 +4163,6 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   public void pairwiseAlignmentMenuItem_actionPerformed(ActionEvent e)
   {
@@ -4171,9 +4191,6 @@ public class AlignFrame extends GAlignFrame
     viewport.setAutoCalculateConsensusAndConservation(
             autoCalculate.isSelected());
     if (viewport.getAutoCalculateConsensusAndConservation())
-    // ??
-    // viewport.autoCalculateConsensus = autoCalculate.isSelected();
-    // if (viewport.autoCalculateConsensus)
     {
       viewport.notifyAlignment();
     }
@@ -4201,7 +4218,6 @@ public class AlignFrame extends GAlignFrame
    * @param options
    *          parameters for the distance or similarity calculation
    */
-
   void newTreePanel(String type, String modelName,
           SimilarityParamsI options)
   {
@@ -4263,7 +4279,6 @@ public class AlignFrame extends GAlignFrame
    * @param order
    *          DOCUMENT ME!
    */
-
   public void addSortByOrderMenuItem(String title,
           final AlignmentOrder order)
   {
@@ -4273,7 +4288,6 @@ public class AlignFrame extends GAlignFrame
     sort.add(item);
     item.addActionListener(new java.awt.event.ActionListener()
     {
-
       @Override
       public void actionPerformed(ActionEvent e)
       {
@@ -4300,7 +4314,6 @@ public class AlignFrame extends GAlignFrame
    *          the label used to retrieve scores for each sequence on the
    *          alignment
    */
-
   public void addSortByAnnotScoreMenuItem(JMenu sort,
           final String scoreLabel)
   {
@@ -4308,7 +4321,6 @@ public class AlignFrame extends GAlignFrame
     sort.add(item);
     item.addActionListener(new java.awt.event.ActionListener()
     {
-
       @Override
       public void actionPerformed(ActionEvent e)
       {
@@ -4334,7 +4346,6 @@ public class AlignFrame extends GAlignFrame
    * rebuilding in subsequence calls.
    * 
    */
-
   @Override
   public void buildSortByAnnotationScoresMenu()
   {
@@ -4392,7 +4403,6 @@ public class AlignFrame extends GAlignFrame
    * closed, and adjust the tree leaf to sequence mapping when the alignment is
    * modified.
    */
-
   @Override
   public void buildTreeSortMenu()
   {
@@ -4405,7 +4415,6 @@ public class AlignFrame extends GAlignFrame
       final JMenuItem item = new JMenuItem(tp.getTitle());
       item.addActionListener(new java.awt.event.ActionListener()
       {
-
         @Override
         public void actionPerformed(ActionEvent e)
         {
@@ -4433,7 +4442,6 @@ public class AlignFrame extends GAlignFrame
     }
     return treePanels;
   }
-
   public boolean sortBy(AlignmentOrder alorder, String undoname)
   {
     SequenceI[] oldOrder = viewport.getAlignment().getSequencesArray();
@@ -4452,7 +4460,6 @@ public class AlignFrame extends GAlignFrame
    * be submitted for multiple alignment.
    * 
    */
-
   public jalview.datamodel.AlignmentView gatherSequencesForAlignment()
   {
     // Now, check we have enough sequences
@@ -4498,7 +4505,6 @@ public class AlignFrame extends GAlignFrame
    * region or the whole alignment. (where the first sequence in the set is the
    * one that the prediction will be for).
    */
-
   public AlignmentView gatherSeqOrMsaForSecStrPrediction()
   {
     AlignmentView seqs = null;
@@ -4532,13 +4538,12 @@ public class AlignFrame extends GAlignFrame
    * @param e
    *          DOCUMENT ME!
    */
-
   @Override
   protected void loadTreeMenuItem_actionPerformed(ActionEvent e)
   {
     // Pick the tree file
     JalviewFileChooser chooser = new JalviewFileChooser(
-            jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+            Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new JalviewFileView());
     chooser.setDialogTitle(
             MessageManager.getString("label.select_newick_like_tree_file"));
@@ -4547,7 +4552,6 @@ public class AlignFrame extends GAlignFrame
 
     chooser.setResponseHandler(0, new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -4612,7 +4616,6 @@ public class AlignFrame extends GAlignFrame
    *          position
    * @return TreePanel handle
    */
-
   public TreePanel showNewickTree(NewickFile nf, String treeTitle,
           AlignmentView input, int w, int h, int x, int y)
   {
@@ -4625,6 +4628,7 @@ public class AlignFrame extends GAlignFrame
       if (nf.getTree() != null)
       {
         tp = new TreePanel(alignPanel, nf, treeTitle, input);
+
         Dimension dim = Platform.getDimIfEmbedded(tp, -1, -1);
         if (dim == null)
         {
@@ -4660,11 +4664,11 @@ public class AlignFrame extends GAlignFrame
   public void buildWebServicesMenu()
   {
     SwingUtilities.invokeLater(() -> {
-      Cache.log.info("Rebuiling WS menu");
+      Console.info("Rebuiling WS menu");
       webService.removeAll();
       if (Cache.getDefault("SHOW_SLIVKA_SERVICES", true))
       {
-        Cache.log.info("Building web service menu for slivka");
+        Console.info("Building web service menu for slivka");
         SlivkaWSDiscoverer discoverer = SlivkaWSDiscoverer.getInstance();
         slivkaMenu.setServices(discoverer);
         slivkaMenu.setInProgress(discoverer.isRunning());
@@ -4738,7 +4742,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param webService
    */
-
   protected void build_urlServiceMenu(JMenu webService)
   {
     // TODO: remove this code when 2.7 is released
@@ -4776,7 +4779,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @return true if Show Cross-references menu should be enabled
    */
-
   public boolean canShowProducts()
   {
     SequenceI[] seqs = viewport.getAlignment().getSequencesArray();
@@ -4804,7 +4806,6 @@ public class AlignFrame extends GAlignFrame
         JMenuItem xtype = new JMenuItem(source);
         xtype.addActionListener(new ActionListener()
         {
-
           @Override
           public void actionPerformed(ActionEvent e)
           {
@@ -4818,7 +4819,7 @@ public class AlignFrame extends GAlignFrame
       showProducts.setEnabled(showp);
     } catch (Exception e)
     {
-      Cache.log.warn(
+      Console.warn(
               "canShowProducts threw an exception - please report to help@jalview.org",
               e);
       return false;
@@ -4837,7 +4838,6 @@ public class AlignFrame extends GAlignFrame
    * @param source
    *          the database to show cross-references for
    */
-
   protected void showProductsFor(final SequenceI[] sel, final boolean _odna,
           final String source)
   {
@@ -4849,7 +4849,6 @@ public class AlignFrame extends GAlignFrame
    * Construct and display a new frame containing the translation of this
    * frame's DNA sequences to their aligned protein (amino acid) equivalents.
    */
-
   @Override
   public void showTranslation_actionPerformed(GeneticCodeI codeTable)
   {
@@ -4861,8 +4860,8 @@ public class AlignFrame extends GAlignFrame
       al = dna.translateCdna(codeTable);
     } catch (Exception ex)
     {
-      jalview.bin.Cache.log.error(
-              "Exception during translation. Please report this !", ex);
+      Console.error("Exception during translation. Please report this !",
+              ex);
       final String msg = MessageManager.getString(
               "label.error_when_translating_sequences_submit_bug_report");
       final String errorTitle = MessageManager
@@ -4907,7 +4906,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param format
    */
-
   public void setFileFormat(FileFormatI format)
   {
     this.currentFileFormat = format;
@@ -4922,7 +4920,6 @@ public class AlignFrame extends GAlignFrame
    *          access mode of file (see jalview.io.AlignFile)
    * @return true if features file was parsed correctly.
    */
-
   public boolean parseFeaturesFile(Object file, DataSourceType sourceType)
   {
     // BH 2018
@@ -5114,6 +5111,7 @@ public class AlignFrame extends GAlignFrame
                         + " with " + toassoc.getDisplayId(true));
                 assocfiles++;
               }
+
             }
             // TODO: do we need to update overview ? only if features are
             // shown I guess
@@ -5174,7 +5172,6 @@ public class AlignFrame extends GAlignFrame
    * @throws InterruptedException
    * @throws IOException
    */
-
   public void loadJalviewDataFile(Object file, DataSourceType sourceType,
           FileFormatI format, SequenceI assocSeq)
   {
@@ -5232,7 +5229,7 @@ public class AlignFrame extends GAlignFrame
           }
         } catch (Exception x)
         {
-          Cache.log.debug(
+          Console.debug(
                   "Exception when processing data source as T-COFFEE score file",
                   x);
           tcf = null;
@@ -5289,6 +5286,7 @@ public class AlignFrame extends GAlignFrame
       }
       if (isAnnotation)
       {
+
         updateForAnnotations();
       }
     } catch (Exception ex)
@@ -5361,7 +5359,6 @@ public class AlignFrame extends GAlignFrame
    * Method invoked by the ChangeListener on the tabbed pane, in other words
    * when a different tabbed pane is selected by the user or programmatically.
    */
-
   @Override
   public void tabSelectionChanged(int index)
   {
@@ -5432,7 +5429,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * On right mouse click on view tab, prompt for and set new view name.
    */
-
   @Override
   public void tabbedPane_mousePressed(MouseEvent e)
   {
@@ -5459,7 +5455,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Open the dialog for regex description parsing.
    */
-
   @Override
   protected void extractScores_actionPerformed(ActionEvent e)
   {
@@ -5483,7 +5478,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showDbRefs_actionPerformed(java.awt.event.ActionEvent
    * )
    */
-
   @Override
   protected void showDbRefs_actionPerformed(ActionEvent e)
   {
@@ -5496,7 +5490,6 @@ public class AlignFrame extends GAlignFrame
    * @seejalview.jbgui.GAlignFrame#showNpFeats_actionPerformed(java.awt.event.
    * ActionEvent)
    */
-
   @Override
   protected void showNpFeats_actionPerformed(ActionEvent e)
   {
@@ -5509,7 +5502,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param av
    */
-
   public boolean closeView(AlignViewportI av)
   {
     if (viewport == av)
@@ -5553,7 +5545,6 @@ public class AlignFrame extends GAlignFrame
             Cache.getDefault(DBRefFetcher.TRIM_RETRIEVED_SEQUENCES, true));
     trimrs.addActionListener(new ActionListener()
     {
-
       @Override
       public void actionPerformed(ActionEvent e)
       {
@@ -5575,7 +5566,6 @@ public class AlignFrame extends GAlignFrame
       {
         new Thread(new Runnable()
         {
-
           @Override
           public void run()
           {
@@ -5587,7 +5577,6 @@ public class AlignFrame extends GAlignFrame
                     alignPanel.alignFrame.featureSettings, isNucleotide);
             dbRefFetcher.addListener(new FetchFinishedListenerI()
             {
-
               @Override
               public void finished()
               {
@@ -5611,7 +5600,6 @@ public class AlignFrame extends GAlignFrame
     rfetch.add(fetchr);
     new Thread(new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -5620,7 +5608,6 @@ public class AlignFrame extends GAlignFrame
         // .getSequenceFetcherSingleton();
         javax.swing.SwingUtilities.invokeLater(new Runnable()
         {
-
           @Override
           public void run()
           {
@@ -5675,7 +5662,6 @@ public class AlignFrame extends GAlignFrame
                         dbRefFetcher
                                 .addListener(new FetchFinishedListenerI()
                                 {
-
                                   @Override
                                   public void finished()
                                   {
@@ -5710,7 +5696,6 @@ public class AlignFrame extends GAlignFrame
                         { src.getDbSource() }));
                 fetchr.addActionListener(new ActionListener()
                 {
-
                   @Override
                   public void actionPerformed(ActionEvent e)
                   {
@@ -5731,7 +5716,6 @@ public class AlignFrame extends GAlignFrame
                         dbRefFetcher
                                 .addListener(new FetchFinishedListenerI()
                                 {
-
                                   @Override
                                   public void finished()
                                   {
@@ -5800,7 +5784,6 @@ public class AlignFrame extends GAlignFrame
                           dbRefFetcher
                                   .addListener(new FetchFinishedListenerI()
                                   {
-
                                     @Override
                                     public void finished()
                                     {
@@ -5852,7 +5835,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Left justify the whole alignment.
    */
-
   @Override
   protected void justifyLeftMenuItem_actionPerformed(ActionEvent e)
   {
@@ -5863,7 +5845,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Right justify the whole alignment.
    */
-
   @Override
   protected void justifyRightMenuItem_actionPerformed(ActionEvent e)
   {
@@ -5885,7 +5866,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showUnconservedMenuItem_actionPerformed(java.
    * awt.event.ActionEvent)
    */
-
   @Override
   protected void showUnconservedMenuItem_actionPerformed(ActionEvent e)
   {
@@ -5900,7 +5880,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showGroupConsensus_actionPerformed(java.awt.event
    * .ActionEvent)
    */
-
   @Override
   protected void showGroupConsensus_actionPerformed(ActionEvent e)
   {
@@ -5916,7 +5895,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showGroupConservation_actionPerformed(java.awt
    * .event.ActionEvent)
    */
-
   @Override
   protected void showGroupConservation_actionPerformed(ActionEvent e)
   {
@@ -5931,7 +5909,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt
    * .event.ActionEvent)
    */
-
   @Override
   protected void showConsensusHistogram_actionPerformed(ActionEvent e)
   {
@@ -5946,7 +5923,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt
    * .event.ActionEvent)
    */
-
   @Override
   protected void showSequenceLogo_actionPerformed(ActionEvent e)
   {
@@ -5976,7 +5952,6 @@ public class AlignFrame extends GAlignFrame
    * jalview.jbgui.GAlignFrame#makeGrpsFromSelection_actionPerformed(java.awt
    * .event.ActionEvent)
    */
-
   @Override
   protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
   {
@@ -6028,7 +6003,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param alignmentPanel
    */
-
   public void setDisplayedView(AlignmentPanel alignmentPanel)
   {
     if (!viewport.getSequenceSetId()
@@ -6053,7 +6027,6 @@ public class AlignFrame extends GAlignFrame
    * @param forAlignment
    *          update non-sequence-related annotations
    */
-
   @Override
   protected void setAnnotationsVisibility(boolean visible,
           boolean forSequences, boolean forAlignment)
@@ -6087,7 +6060,6 @@ public class AlignFrame extends GAlignFrame
   /**
    * Store selected annotation sort order for the view and repaint.
    */
-
   @Override
   protected void sortAnnotations_actionPerformed()
   {
@@ -6101,7 +6073,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @return alignment panels in this alignment frame
    */
-
   public List<? extends AlignmentViewPanel> getAlignPanels()
   {
     // alignPanels is never null
@@ -6113,7 +6084,6 @@ public class AlignFrame extends GAlignFrame
    * Open a new alignment window, with the cDNA associated with this (protein)
    * alignment, aligned as is the protein.
    */
-
   protected void viewAsCdna_actionPerformed()
   {
     // TODO no longer a menu action - refactor as required
@@ -6164,7 +6134,6 @@ public class AlignFrame extends GAlignFrame
    * 
    * @param show
    */
-
   @Override
   protected void showComplement_actionPerformed(boolean show)
   {
@@ -6179,7 +6148,6 @@ public class AlignFrame extends GAlignFrame
    * Generate the reverse (optionally complemented) of the selected sequences,
    * and add them to the alignment
    */
-
   @Override
   protected void showReverse_actionPerformed(boolean complement)
   {
@@ -6205,7 +6173,6 @@ public class AlignFrame extends GAlignFrame
    * AlignFrame is set as currentAlignFrame in Desktop, to allow the script to
    * be targeted at this alignment.
    */
-
   @Override
   protected void runGroovy_actionPerformed()
   {
@@ -6239,7 +6206,6 @@ public class AlignFrame extends GAlignFrame
    * @param columnsContaining
    * @return
    */
-
   public boolean hideFeatureColumns(String featureType,
           boolean columnsContaining)
   {
@@ -6272,7 +6238,6 @@ public class AlignFrame extends GAlignFrame
    * Rebuilds the Colour menu, including any user-defined colours which have
    * been loaded either on startup or during the session
    */
-
   public void buildColourMenu()
   {
     colourMenu.removeAll();
@@ -6300,7 +6265,6 @@ public class AlignFrame extends GAlignFrame
    * Open a dialog (if not already open) that allows the user to select and
    * calculate PCA or Tree analysis
    */
-
   protected void openTreePcaDialog()
   {
     if (alignPanel.getCalculationDialog() == null)
@@ -6316,7 +6280,6 @@ public class AlignFrame extends GAlignFrame
   {
     hmmerMenu.setEnabled(HmmerCommand.isHmmerAvailable());
   }
-
   @Override
   protected void loadVcf_actionPerformed()
   {
@@ -6328,7 +6291,6 @@ public class AlignFrame extends GAlignFrame
     final AlignFrame us = this;
     chooser.setResponseHandler(0, new Runnable()
     {
-
       @Override
       public void run()
       {
@@ -6461,4 +6423,3 @@ public class AlignFrame extends GAlignFrame
     }
   }
 }
-