JAL-1517 source formatting
[jalview.git] / src / jalview / gui / AlignFrame.java
index 92316b3..bf9888c 100644 (file)
@@ -153,9 +153,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public AlignmentPanel alignPanel;
 
   AlignViewport viewport;
+
   public AlignViewControllerI avc;
 
   Vector alignPanels = new Vector();
 
@@ -299,7 +298,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void init()
   {
-    avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
+    avc = new jalview.controller.AlignViewController(this, viewport,
+            alignPanel);
     if (viewport.getAlignmentConservationAnnotation() == null)
     {
       BLOSUM62Colour.setEnabled(false);
@@ -343,7 +343,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     addKeyListener();
-    
+
   }
 
   /**
@@ -489,7 +489,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
         case KeyEvent.VK_F2:
           viewport.cursorMode = !viewport.cursorMode;
-          statusBar.setText(MessageManager.formatMessage("label.keyboard_editing_mode", new String[]{(viewport.cursorMode ? "on" : "off")}));
+          statusBar.setText(MessageManager.formatMessage(
+                  "label.keyboard_editing_mode", new String[]
+                  { (viewport.cursorMode ? "on" : "off") }));
           if (viewport.cursorMode)
           {
             alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes;
@@ -570,7 +572,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public void addAlignmentPanel(final AlignmentPanel ap, boolean newPanel)
   {
     ap.alignFrame = this;
-    avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
+    avc = new jalview.controller.AlignViewController(this, viewport,
+            alignPanel);
 
     alignPanels.addElement(ap);
 
@@ -821,7 +824,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+      JButton cancel = new JButton(
+              MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
@@ -855,9 +859,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   }
 
   @Override
-  public void setStatus(String text) {
+  public void setStatus(String text)
+  {
     statusBar.setText(text);
   };
+
   /*
    * Added so Castor Mapping file can obtain Jalview Version
    */
@@ -1004,9 +1010,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       currentFileFormat = chooser.getSelectedFormat();
       if (currentFileFormat == null)
       {
-        JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                MessageManager.getString("label.select_file_format_before_saving"),
-                MessageManager.getString("label.file_format_not_specified"), JOptionPane.WARNING_MESSAGE);
+        JOptionPane
+                .showInternalMessageDialog(
+                        Desktop.desktop,
+                        MessageManager
+                                .getString("label.select_file_format_before_saving"),
+                        MessageManager
+                                .getString("label.file_format_not_specified"),
+                        JOptionPane.WARNING_MESSAGE);
         value = chooser.showSaveDialog(this);
         return;
       }
@@ -1042,8 +1053,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       success = new Jalview2XML().SaveAlignment(this, file, shortName);
 
-      statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
-
+      statusBar.setText(MessageManager.formatMessage(
+              "label.successfully_saved_to_file_in_format", new String[]
+              { fileName, format }));
 
     }
     else
@@ -1064,8 +1076,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         int reply = JOptionPane
                 .showInternalConfirmDialog(
                         Desktop.desktop,
-                        MessageManager.getString("label.alignment_contains_hidden_columns"),
-                        MessageManager.getString("action.save_omit_hidden_columns"),
+                        MessageManager
+                                .getString("label.alignment_contains_hidden_columns"),
+                        MessageManager
+                                .getString("action.save_omit_hidden_columns"),
                         JOptionPane.YES_NO_OPTION,
                         JOptionPane.QUESTION_MESSAGE);
 
@@ -1095,7 +1109,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           out.print(output);
           out.close();
           this.setTitle(file);
-          statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
+          statusBar.setText(MessageManager.formatMessage(
+                  "label.successfully_saved_to_file_in_format",
+                  new String[]
+                  { fileName, format }));
         } catch (Exception ex)
         {
           success = false;
@@ -1106,8 +1123,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (!success)
     {
-      JOptionPane.showInternalMessageDialog(this, MessageManager.formatMessage("label.couldnt_save_file", new String[]{fileName}),
-              MessageManager.getString("label.error_saving_file"), JOptionPane.WARNING_MESSAGE);
+      JOptionPane.showInternalMessageDialog(this, MessageManager
+              .formatMessage("label.couldnt_save_file", new String[]
+              { fileName }), MessageManager
+              .getString("label.error_saving_file"),
+              JOptionPane.WARNING_MESSAGE);
     }
 
     return success;
@@ -1144,8 +1164,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       int reply = JOptionPane
               .showInternalConfirmDialog(
                       Desktop.desktop,
-                      MessageManager.getString("label.alignment_contains_hidden_columns"),
-                      MessageManager.getString("action.save_omit_hidden_columns"),
+                      MessageManager
+                              .getString("label.alignment_contains_hidden_columns"),
+                      MessageManager
+                              .getString("action.save_omit_hidden_columns"),
                       JOptionPane.YES_NO_OPTION,
                       JOptionPane.QUESTION_MESSAGE);
 
@@ -1163,8 +1185,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       cap.setText(new FormatAdapter().formatSequences(e.getActionCommand(),
               viewport.getAlignment(), omitHidden,
               viewport.getColumnSelection()));
-      Desktop.addInternalFrame(cap,
-              MessageManager.formatMessage("label.alignment_output_command", new String[]{e.getActionCommand()}), 600, 500);
+      Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+              "label.alignment_output_command", new String[]
+              { e.getActionCommand() }), 600, 500);
     } catch (OutOfMemoryError oom)
     {
       new OOMWarning("Outputting alignment as " + e.getActionCommand(), oom);
@@ -1260,8 +1283,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     JalviewFileChooser chooser = new JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new JalviewFileView());
-    chooser.setDialogTitle(MessageManager.getString("label.load_jalview_annotations"));
-    chooser.setToolTipText(MessageManager.getString("label.load_jalview_annotations"));
+    chooser.setDialogTitle(MessageManager
+            .getString("label.load_jalview_annotations"));
+    chooser.setToolTipText(MessageManager
+            .getString("label.load_jalview_annotations"));
 
     int value = chooser.showOpenDialog(null);
 
@@ -1361,7 +1386,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       undoMenuItem.setEnabled(true);
       CommandI command = (CommandI) viewport.historyList.peek();
-      undoMenuItem.setText(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()}));
+      undoMenuItem.setText(MessageManager.formatMessage(
+              "label.undo_command", new String[]
+              { command.getDescription() }));
     }
     else
     {
@@ -1374,7 +1401,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       redoMenuItem.setEnabled(true);
 
       CommandI command = (CommandI) viewport.redoList.peek();
-      redoMenuItem.setText(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()}));
+      redoMenuItem.setText(MessageManager.formatMessage(
+              "label.redo_command", new String[]
+              { command.getDescription() }));
     }
     else
     {
@@ -1707,7 +1736,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     Desktop.jalviewClipboard = new Object[]
     { seqs, viewport.getAlignment().getDataset(), hiddenColumns };
-    statusBar.setText(MessageManager.formatMessage("label.copied_sequences_to_clipboard", new String[]{Integer.valueOf(seqs.length).toString()}));
+    statusBar.setText(MessageManager.formatMessage(
+            "label.copied_sequences_to_clipboard", new String[]
+            { Integer.valueOf(seqs.length).toString() }));
   }
 
   /**
@@ -2065,59 +2096,61 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
   }
+
   @Override
   protected void expand_newalign(ActionEvent e)
   {
-    try {
-    AlignmentI alignment = AlignmentUtils.expandContext(getViewport().getAlignment(), -1);
-    AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH,
-            DEFAULT_HEIGHT);
-    String newtitle = new String("Flanking alignment");
-
-    if (Desktop.jalviewClipboard != null
-            && Desktop.jalviewClipboard[2] != null)
+    try
     {
-      Vector hc = (Vector) Desktop.jalviewClipboard[2];
-      for (int i = 0; i < hc.size(); i++)
+      AlignmentI alignment = AlignmentUtils.expandContext(getViewport()
+              .getAlignment(), -1);
+      AlignFrame af = new AlignFrame(alignment, DEFAULT_WIDTH,
+              DEFAULT_HEIGHT);
+      String newtitle = new String("Flanking alignment");
+
+      if (Desktop.jalviewClipboard != null
+              && Desktop.jalviewClipboard[2] != null)
       {
-        int[] region = (int[]) hc.elementAt(i);
-        af.viewport.hideColumns(region[0], region[1]);
+        Vector hc = (Vector) Desktop.jalviewClipboard[2];
+        for (int i = 0; i < hc.size(); i++)
+        {
+          int[] region = (int[]) hc.elementAt(i);
+          af.viewport.hideColumns(region[0], region[1]);
+        }
       }
-    }
 
-    // >>>This is a fix for the moment, until a better solution is
-    // found!!<<<
-    af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
-            .transferSettings(
-                    alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
+      // >>>This is a fix for the moment, until a better solution is
+      // found!!<<<
+      af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
+              .transferSettings(
+                      alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
 
-    // TODO: maintain provenance of an alignment, rather than just make the
-    // title a concatenation of operations.
-    {
-      if (title.startsWith("Copied sequences"))
-      {
-        newtitle = title;
-      }
-      else
+      // TODO: maintain provenance of an alignment, rather than just make the
+      // title a concatenation of operations.
       {
-        newtitle = newtitle.concat("- from " + title);
+        if (title.startsWith("Copied sequences"))
+        {
+          newtitle = title;
+        }
+        else
+        {
+          newtitle = newtitle.concat("- from " + title);
+        }
       }
-    }
 
-    Desktop.addInternalFrame(af, newtitle, DEFAULT_WIDTH,
-            DEFAULT_HEIGHT);
+      Desktop.addInternalFrame(af, newtitle, DEFAULT_WIDTH, DEFAULT_HEIGHT);
 
     } catch (Exception ex)
     {
       ex.printStackTrace();
       System.out.println("Exception whilst pasting: " + ex);
       // could be anything being pasted in here
-    }
-    catch (OutOfMemoryError oom)
+    } catch (OutOfMemoryError oom)
     {
       new OOMWarning("Viewing flanking region of alignment", oom);
     }
   }
+
   /**
    * DOCUMENT ME!
    * 
@@ -2201,7 +2234,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   protected void deleteGroups_actionPerformed(ActionEvent e)
   {
-    if (avc.deleteGroups()) {
+    if (avc.deleteGroups())
+    {
       PaintRefresher.Refresh(this, viewport.getSequenceSetId());
       alignPanel.updateAnnotation();
       alignPanel.paintAlignment(true);
@@ -2359,7 +2393,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 viewport.getSelectionGroup());
       }
 
-      statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()}));
+      statusBar.setText(MessageManager.formatMessage(
+              "label.removed_columns", new String[]
+              { Integer.valueOf(trimRegion.getSize()).toString() }));
 
       addHistoryItem(trimRegion);
 
@@ -2407,7 +2443,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     addHistoryItem(removeGapCols);
 
-    statusBar.setText(MessageManager.formatMessage("label.removed_empty_columns", new String[]{Integer.valueOf(removeGapCols.getSize()).toString()}));
+    statusBar.setText(MessageManager.formatMessage(
+            "label.removed_empty_columns", new String[]
+            { Integer.valueOf(removeGapCols.getSize()).toString() }));
 
     // This is to maintain viewport position on first residue
     // of first sequence
@@ -2602,7 +2640,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     addAlignmentPanel(newap, true);
     newap.alignmentChanged();
-    
+
     if (alignPanels.size() == 2)
     {
       viewport.gatherViewsHere = true;
@@ -3016,11 +3054,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     editPane.setEditable(false);
     StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
             .formatAsHtml();
-    editPane.setText(MessageManager.formatMessage("label.html_content", new String[]{contents.toString()}));
+    editPane.setText(MessageManager.formatMessage("label.html_content",
+            new String[]
+            { contents.toString() }));
     JInternalFrame frame = new JInternalFrame();
     frame.getContentPane().add(new JScrollPane(editPane));
 
-    Desktop.instance.addInternalFrame(frame, MessageManager.formatMessage("label.alignment_properties", new String[]{getTitle()}), 500, 400);
+    Desktop.instance.addInternalFrame(frame, MessageManager.formatMessage(
+            "label.alignment_properties", new String[]
+            { getTitle() }), 500, 400);
   }
 
   /**
@@ -3040,8 +3082,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     JInternalFrame frame = new JInternalFrame();
     OverviewPanel overview = new OverviewPanel(alignPanel);
     frame.setContentPane(overview);
-    Desktop.addInternalFrame(frame, MessageManager.formatMessage("label.overview_params", new String[]{this.getTitle()}),
-            frame.getWidth(), frame.getHeight());
+    Desktop.addInternalFrame(frame, MessageManager.formatMessage(
+            "label.overview_params", new String[]
+            { this.getTitle() }), frame.getWidth(), frame.getHeight());
     frame.pack();
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
     frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
@@ -3423,7 +3466,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void userDefinedColour_actionPerformed(ActionEvent e)
   {
-    if (e.getActionCommand().equals(MessageManager.getString("action.user_defined")))
+    if (e.getActionCommand().equals(
+            MessageManager.getString("action.user_defined")))
     {
       new UserDefinedColours(alignPanel, null);
     }
@@ -3472,8 +3516,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
               int option = JOptionPane.showInternalConfirmDialog(
                       jalview.gui.Desktop.desktop,
-                      MessageManager.getString("label.remove_from_default_list"),
-                      MessageManager.getString("label.remove_user_defined_colour"),
+                      MessageManager
+                              .getString("label.remove_from_default_list"),
+                      MessageManager
+                              .getString("label.remove_user_defined_colour"),
                       JOptionPane.YES_NO_OPTION);
               if (option == JOptionPane.YES_OPTION)
               {
@@ -3624,15 +3670,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if ((viewport.getSelectionGroup() == null)
             || (viewport.getSelectionGroup().getSize() < 2))
     {
-      JOptionPane.showInternalMessageDialog(this,
-              MessageManager.getString("label.you_must_select_least_two_sequences"), MessageManager.getString("label.invalid_selection"),
+      JOptionPane.showInternalMessageDialog(this, MessageManager
+              .getString("label.you_must_select_least_two_sequences"),
+              MessageManager.getString("label.invalid_selection"),
               JOptionPane.WARNING_MESSAGE);
     }
     else
     {
       JInternalFrame frame = new JInternalFrame();
       frame.setContentPane(new PairwiseAlignPanel(viewport));
-      Desktop.addInternalFrame(frame, MessageManager.getString("action.pairwise_alignment"), 600, 500);
+      Desktop.addInternalFrame(frame,
+              MessageManager.getString("action.pairwise_alignment"), 600,
+              500);
     }
   }
 
@@ -3650,10 +3699,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             .getSelectionGroup().getSize() > 0))
             || (viewport.getAlignment().getHeight() < 4))
     {
-      JOptionPane.showInternalMessageDialog(this,
-              MessageManager.getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
-              MessageManager.getString("label.sequence_selection_insufficient"),
-              JOptionPane.WARNING_MESSAGE);
+      JOptionPane
+              .showInternalMessageDialog(
+                      this,
+                      MessageManager
+                              .getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
+                      MessageManager
+                              .getString("label.sequence_selection_insufficient"),
+                      JOptionPane.WARNING_MESSAGE);
 
       return;
     }
@@ -3754,8 +3807,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         JOptionPane
                 .showMessageDialog(
                         Desktop.desktop,
-                        MessageManager.getString("label.you_need_more_two_sequences_selected_build_tree"),
-                        MessageManager.getString("label.not_enough_sequences"), JOptionPane.WARNING_MESSAGE);
+                        MessageManager
+                                .getString("label.you_need_more_two_sequences_selected_build_tree"),
+                        MessageManager
+                                .getString("label.not_enough_sequences"),
+                        JOptionPane.WARNING_MESSAGE);
         return;
       }
 
@@ -3769,8 +3825,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           JOptionPane
                   .showMessageDialog(
                           Desktop.desktop,
-                          MessageManager.getString("label.selected_region_to_tree_may_only_contain_residues_or_gaps"),
-                          MessageManager.getString("label.sequences_selection_not_aligned"),
+                          MessageManager
+                                  .getString("label.selected_region_to_tree_may_only_contain_residues_or_gaps"),
+                          MessageManager
+                                  .getString("label.sequences_selection_not_aligned"),
                           JOptionPane.WARNING_MESSAGE);
 
           return;
@@ -3788,8 +3846,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         JOptionPane
                 .showMessageDialog(
                         Desktop.desktop,
-                        MessageManager.getString("label.sequences_must_be_aligned_before_creating_tree"),
-                        MessageManager.getString("label.sequences_not_aligned"),
+                        MessageManager
+                                .getString("label.sequences_must_be_aligned_before_creating_tree"),
+                        MessageManager
+                                .getString("label.sequences_not_aligned"),
                         JOptionPane.WARNING_MESSAGE);
 
         return;
@@ -3944,15 +4004,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     calculateTree.removeAll();
     // build the calculate menu
-    
-    for (final String type:new String[] {"NJ", "AV"})
+
+    for (final String type : new String[]
+    { "NJ", "AV" })
     {
-      String treecalcnm = MessageManager.getString("label.tree_calc_"+type.toLowerCase());
-      for (final Object pwtype: ResidueProperties.scoreMatrices.keySet())
+      String treecalcnm = MessageManager.getString("label.tree_calc_"
+              + type.toLowerCase());
+      for (final Object pwtype : ResidueProperties.scoreMatrices.keySet())
       {
         JMenuItem tm = new JMenuItem();
         ScoreModelI sm = ResidueProperties.scoreMatrices.get(pwtype);
-        if (sm.isProtein()==!viewport.getAlignment().isNucleotide())
+        if (sm.isProtein() == !viewport.getAlignment().isNucleotide())
         {
           String smn = MessageManager.getStringOrReturn(
                   "label.score_model_", sm.getName());
@@ -4115,7 +4177,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     JalviewFileChooser chooser = new JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new JalviewFileView());
-    chooser.setDialogTitle(MessageManager.getString("label.select_newick_like_tree_file"));
+    chooser.setDialogTitle(MessageManager
+            .getString("label.select_newick_like_tree_file"));
     chooser.setToolTipText(MessageManager.getString("label.load_tree_file"));
 
     int value = chooser.showOpenDialog(null);
@@ -4131,14 +4194,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         viewport.setCurrentTree(ShowNewickTree(fin, choice).getTree());
       } catch (Exception ex)
       {
-        JOptionPane.showMessageDialog(Desktop.desktop, ex.getMessage(),
-                MessageManager.getString("label.problem_reading_tree_file"), JOptionPane.WARNING_MESSAGE);
+        JOptionPane
+                .showMessageDialog(
+                        Desktop.desktop,
+                        ex.getMessage(),
+                        MessageManager
+                                .getString("label.problem_reading_tree_file"),
+                        JOptionPane.WARNING_MESSAGE);
         ex.printStackTrace();
       }
       if (fin != null && fin.hasWarningMessage())
       {
-        JOptionPane.showMessageDialog(Desktop.desktop,
-                fin.getWarningMessage(), MessageManager.getString("label.possible_problem_with_tree_file"),
+        JOptionPane.showMessageDialog(Desktop.desktop, fin
+                .getWarningMessage(), MessageManager
+                .getString("label.possible_problem_with_tree_file"),
                 JOptionPane.WARNING_MESSAGE);
       }
     }
@@ -4243,7 +4312,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       @Override
       public void run()
       {
-        final List<JMenuItem> legacyItems=new ArrayList<JMenuItem>();
+        final List<JMenuItem> legacyItems = new ArrayList<JMenuItem>();
         try
         {
           System.err.println("Building ws menu again "
@@ -4276,7 +4345,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             // be
             // stored or retrieved from elsewhere
             // No MSAWS used any more:
-            // Vector msaws = null; // (Vector) Discoverer.services.get("MsaWS");
+            // Vector msaws = null; // (Vector)
+            // Discoverer.services.get("MsaWS");
             Vector secstrpr = (Vector) Discoverer.services
                     .get("SecStrPred");
             if (secstrpr != null)
@@ -4288,17 +4358,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .get(i);
                 jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
                         .getServiceClient(sh);
-                int p=secstrmenu.getItemCount();
+                int p = secstrmenu.getItemCount();
                 impl.attachWSMenuEntry(secstrmenu, me);
-                int q=secstrmenu.getItemCount();
-                for (int litm=p;litm<q; litm++)
+                int q = secstrmenu.getItemCount();
+                for (int litm = p; litm < q; litm++)
                 {
                   legacyItems.add(secstrmenu.getItem(litm));
                 }
               }
             }
           }
-          
+
           // Add all submenus in the order they should appear on the web
           // services menu
           wsmenu.add(msawsmenu);
@@ -4329,7 +4399,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   webService.add(me.webServiceNoServices);
                 }
                 // TODO: move into separate menu builder class.
-                boolean new_sspred=false;
+                boolean new_sspred = false;
                 if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
                 {
                   Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
@@ -4338,16 +4408,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                     if (jws2servs.hasServices())
                     {
                       jws2servs.attachWSMenuEntry(webService, me);
-                      for (Jws2Instance sv:jws2servs.getServices()) {
+                      for (Jws2Instance sv : jws2servs.getServices())
+                      {
                         if (sv.description.toLowerCase().contains("jpred"))
                         {
-                          for (JMenuItem jmi:legacyItems)
+                          for (JMenuItem jmi : legacyItems)
                           {
                             jmi.setVisible(false);
                           }
                         }
                       }
-                      
+
                     }
                     if (jws2servs.isRunning())
                     {
@@ -4633,14 +4704,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      MessageManager.getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
-                      MessageManager.getString("label.translation_failed"), JOptionPane.WARNING_MESSAGE);
+                      MessageManager
+                              .getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
+                      MessageManager.getString("label.translation_failed"),
+                      JOptionPane.WARNING_MESSAGE);
     }
     else
     {
       AlignFrame af = new AlignFrame(al, DEFAULT_WIDTH, DEFAULT_HEIGHT);
-      Desktop.addInternalFrame(af, MessageManager.formatMessage("label.translation_of_params", new String[]{this.getTitle()}),
-              DEFAULT_WIDTH, DEFAULT_HEIGHT);
+      Desktop.addInternalFrame(af, MessageManager.formatMessage(
+              "label.translation_of_params", new String[]
+              { this.getTitle() }), DEFAULT_WIDTH, DEFAULT_HEIGHT);
     }
   }
 
@@ -4663,12 +4737,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     } catch (Exception ex)
     {
       al = null;
-      jalview.bin.Cache.log.error("Exception during translation. Please report this !", ex);
+      jalview.bin.Cache.log.error(
+              "Exception during translation. Please report this !", ex);
       JOptionPane
-      .showMessageDialog(
-              Desktop.desktop,
-              MessageManager.getString("label.error_when_translating_sequences_submit_bug_report"),
-              MessageManager.getString("label.implementation_error") + MessageManager.getString("translation_failed"), JOptionPane.ERROR_MESSAGE);
+              .showMessageDialog(
+                      Desktop.desktop,
+                      MessageManager
+                              .getString("label.error_when_translating_sequences_submit_bug_report"),
+                      MessageManager
+                              .getString("label.implementation_error")
+                              + MessageManager
+                                      .getString("translation_failed"),
+                      JOptionPane.ERROR_MESSAGE);
       return;
     }
     if (al == null)
@@ -4676,14 +4756,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      MessageManager.getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
-                      MessageManager.getString("label.translation_failed"), JOptionPane.WARNING_MESSAGE);
+                      MessageManager
+                              .getString("label.select_at_least_three_bases_in_at_least_one_sequence_to_cDNA_translation"),
+                      MessageManager.getString("label.translation_failed"),
+                      JOptionPane.WARNING_MESSAGE);
     }
     else
     {
       AlignFrame af = new AlignFrame(al, DEFAULT_WIDTH, DEFAULT_HEIGHT);
-      Desktop.addInternalFrame(af, MessageManager.formatMessage("label.translation_of_params", new String[]{this.getTitle()}),
-              DEFAULT_WIDTH, DEFAULT_HEIGHT);
+      Desktop.addInternalFrame(af, MessageManager.formatMessage(
+              "label.translation_of_params", new String[]
+              { this.getTitle() }), DEFAULT_WIDTH, DEFAULT_HEIGHT);
     }
   }
 
@@ -4876,9 +4959,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   || JOptionPane
                           .showConfirmDialog(
                                   this,
-                                  MessageManager.formatMessage("label.automatically_associate_pdb_files_with_sequences_same_name",
-                                                 new String[]{Integer.valueOf(filesmatched.size()).toString()}),
-                                  MessageManager.getString("label.automatically_associate_pdb_files_by_name"),
+                                  MessageManager
+                                          .formatMessage(
+                                                  "label.automatically_associate_pdb_files_with_sequences_same_name",
+                                                  new String[]
+                                                  { Integer.valueOf(
+                                                          filesmatched
+                                                                  .size())
+                                                          .toString() }),
+                                  MessageManager
+                                          .getString("label.automatically_associate_pdb_files_by_name"),
                                   JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)
 
           {
@@ -4911,8 +5001,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                           "AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false) || JOptionPane
                           .showConfirmDialog(
                                   this,
-                                  MessageManager.formatMessage("label.ignore_unmatched_dropped_files_info", new String[]{Integer.valueOf(filesnotmatched.size()).toString()}),
-                                  MessageManager.getString("label.ignore_unmatched_dropped_files"),
+                                  MessageManager
+                                          .formatMessage(
+                                                  "label.ignore_unmatched_dropped_files_info",
+                                                  new String[]
+                                                  { Integer.valueOf(
+                                                          filesnotmatched
+                                                                  .size())
+                                                          .toString() }),
+                                  MessageManager
+                                          .getString("label.ignore_unmatched_dropped_files"),
                                   JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION))
           {
             return;
@@ -4971,7 +5069,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               tcoffeeColour.setSelected(true);
               changeColour(new TCoffeeColourScheme(viewport.getAlignment()));
               isAnnotation = true;
-              statusBar.setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
+              statusBar
+                      .setText(MessageManager
+                              .getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
             }
             else
             {
@@ -4980,9 +5080,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               JOptionPane
                       .showMessageDialog(
                               Desktop.desktop,
-                              tcf.getWarningMessage() == null ? MessageManager.getString("label.check_file_matches_sequence_ids_alignment")
+                              tcf.getWarningMessage() == null ? MessageManager
+                                      .getString("label.check_file_matches_sequence_ids_alignment")
                                       : tcf.getWarningMessage(),
-                              MessageManager.getString("label.problem_reading_tcoffee_score_file"),
+                              MessageManager
+                                      .getString("label.problem_reading_tcoffee_score_file"),
                               JOptionPane.WARNING_MESSAGE);
             }
           }
@@ -5100,7 +5202,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (SwingUtilities.isRightMouseButton(e))
     {
       String reply = JOptionPane.showInternalInputDialog(this,
-              MessageManager.getString("label.enter_view_name"), MessageManager.getString("label.enter_view_name"),
+              MessageManager.getString("label.enter_view_name"),
+              MessageManager.getString("label.enter_view_name"),
               JOptionPane.QUESTION_MESSAGE);
 
       if (reply != null)
@@ -5195,23 +5298,31 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     // TODO We probably want to store a sequence database checklist in
     // preferences and have checkboxes.. rather than individual sources selected
     // here
-    final JMenu rfetch = new JMenu(MessageManager.getString("action.fetch_db_references"));
-    rfetch.setToolTipText(MessageManager.getString("label.retrieve_parse_sequence_database_records_alignment_or_selected_sequences"));
+    final JMenu rfetch = new JMenu(
+            MessageManager.getString("action.fetch_db_references"));
+    rfetch.setToolTipText(MessageManager
+            .getString("label.retrieve_parse_sequence_database_records_alignment_or_selected_sequences"));
     webService.add(rfetch);
 
-    final JCheckBoxMenuItem trimrs = new JCheckBoxMenuItem(MessageManager.getString("option.trim_retrieved_seqs"));
-    trimrs.setToolTipText(MessageManager.getString("label.trim_retrieved_sequences"));
+    final JCheckBoxMenuItem trimrs = new JCheckBoxMenuItem(
+            MessageManager.getString("option.trim_retrieved_seqs"));
+    trimrs.setToolTipText(MessageManager
+            .getString("label.trim_retrieved_sequences"));
     trimrs.setSelected(Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true));
     trimrs.addActionListener(new ActionListener()
     {
-      public void actionPerformed(ActionEvent e) {
-      trimrs.setSelected(trimrs.isSelected());
-      Cache.setProperty("TRIM_FETCHED_DATASET_SEQS", Boolean.valueOf(trimrs.isSelected()).toString());
-    };
+      public void actionPerformed(ActionEvent e)
+      {
+        trimrs.setSelected(trimrs.isSelected());
+        Cache.setProperty("TRIM_FETCHED_DATASET_SEQS",
+                Boolean.valueOf(trimrs.isSelected()).toString());
+      };
     });
     rfetch.add(trimrs);
-    JMenuItem fetchr = new JMenuItem(MessageManager.getString("label.standard_databases"));
-    fetchr.setToolTipText(MessageManager.getString("label.fetch_embl_uniprot"));
+    JMenuItem fetchr = new JMenuItem(
+            MessageManager.getString("label.standard_databases"));
+    fetchr.setToolTipText(MessageManager
+            .getString("label.fetch_embl_uniprot"));
     fetchr.addActionListener(new ActionListener()
     {
 
@@ -5315,7 +5426,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .toArray(new DbSourceProxy[0]);
                 // fetch all entry
                 DbSourceProxy src = otherdb.get(0);
-                fetchr = new JMenuItem(MessageManager.formatMessage("label.fetch_all_param", new String[]{src.getDbSource()}));
+                fetchr = new JMenuItem(MessageManager.formatMessage(
+                        "label.fetch_all_param", new String[]
+                        { src.getDbSource() }));
                 fetchr.addActionListener(new ActionListener()
                 {
                   @Override
@@ -5390,7 +5503,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   ++i;
                   if (++icomp >= mcomp || i == (otherdb.size()))
                   {
-                    ifetch.setText(MessageManager.formatMessage("label.source_to_target",imname,sname));
+                    ifetch.setText(MessageManager.formatMessage(
+                            "label.source_to_target", imname, sname));
                     dfetch.add(ifetch);
                     ifetch = new JMenu();
                     imname = null;
@@ -5402,7 +5516,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               ++dbi;
               if (comp >= mcomp || dbi >= (dbclasses.length))
               {
-                dfetch.setText(MessageManager.formatMessage("label.source_to_target",mname,dbclass));
+                dfetch.setText(MessageManager.formatMessage(
+                        "label.source_to_target", mname, dbclass));
                 rfetch.add(dfetch);
                 dfetch = new JMenu();
                 mname = null;
@@ -5540,7 +5655,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
   {
-    if (avc.makeGroupsFromSelection()) {
+    if (avc.makeGroupsFromSelection())
+    {
       PaintRefresher.Refresh(this, viewport.getSequenceSetId());
       alignPanel.updateAnnotation();
       alignPanel.paintAlignment(true);