JAL-1473 menu entries for different score models available for NJ/UPGMA tree building...
[jalview.git] / src / jalview / gui / AlignFrame.java
old mode 100755 (executable)
new mode 100644 (file)
index d15f742..5160a3a
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
- * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
+ * Copyright (C) 2014 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -14,6 +14,7 @@
  * PURPOSE.  See the GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.gui;
 
@@ -24,6 +25,7 @@ import jalview.analysis.CrossRef;
 import jalview.analysis.NJTree;
 import jalview.analysis.ParseProperties;
 import jalview.analysis.SequenceIdMatcher;
+import jalview.api.AlignViewControllerGuiI;
 import jalview.api.AlignViewControllerI;
 import jalview.bin.Cache;
 import jalview.commands.CommandI;
@@ -70,12 +72,14 @@ import jalview.schemes.PIDColourScheme;
 import jalview.schemes.PurinePyrimidineColourScheme;
 import jalview.schemes.RNAHelicesColourChooser;
 import jalview.schemes.ResidueProperties;
+import jalview.schemes.ScoreMatrix;
 import jalview.schemes.StrandColourScheme;
 import jalview.schemes.TCoffeeColourScheme;
 import jalview.schemes.TaylorColourScheme;
 import jalview.schemes.TurnColourScheme;
 import jalview.schemes.UserColourScheme;
 import jalview.schemes.ZappoColourScheme;
+import jalview.util.MessageManager;
 import jalview.ws.jws1.Discoverer;
 import jalview.ws.jws2.Jws2Discoverer;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
@@ -134,7 +138,7 @@ import javax.swing.SwingUtilities;
  * @version $Revision$
  */
 public class AlignFrame extends GAlignFrame implements DropTargetListener,
-        IProgressIndicator
+        IProgressIndicator, AlignViewControllerGuiI
 {
 
   /** DOCUMENT ME!! */
@@ -292,7 +296,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   void init()
   {
-    avc = new jalview.controller.AlignViewController(viewport, alignPanel);
+    avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
     if (viewport.getAlignmentConservationAnnotation() == null)
     {
       BLOSUM62Colour.setEnabled(false);
@@ -324,6 +328,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     setMenusFromViewport(viewport);
     buildSortByAnnotationScoresMenu();
+    buildTreeMenu();
     if (viewport.wrapAlignment)
     {
       wrapMenuItem_actionPerformed(null);
@@ -481,8 +486,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
         case KeyEvent.VK_F2:
           viewport.cursorMode = !viewport.cursorMode;
-          statusBar.setText("Keyboard editing mode is "
-                  + (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;
@@ -563,7 +567,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public void addAlignmentPanel(final AlignmentPanel ap, boolean newPanel)
   {
     ap.alignFrame = this;
-    avc = new jalview.controller.AlignViewController(viewport, alignPanel);
+    avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
 
     alignPanels.addElement(ap);
 
@@ -814,7 +818,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton("Cancel");
+      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
@@ -847,6 +851,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     return false;
   }
 
+  @Override
+  public void setStatus(String text) {
+    statusBar.setText(text);
+  };
   /*
    * Added so Castor Mapping file can obtain Jalview Version
    */
@@ -984,7 +992,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     chooser.setFileView(new JalviewFileView());
     chooser.setDialogTitle("Save Alignment to file");
-    chooser.setToolTipText("Save");
+    chooser.setToolTipText(MessageManager.getString("action.save"));\r
 
     int value = chooser.showSaveDialog(this);
 
@@ -994,8 +1002,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       if (currentFileFormat == null)
       {
         JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                "You must select a file format before saving!",
-                "File format not specified", JOptionPane.WARNING_MESSAGE);
+                MessageManager.getString("label.select_file_format_before_saving"),
+                MessageManager.getString("label.file_format_not_specified"), JOptionPane.WARNING_MESSAGE);
         value = chooser.showSaveDialog(this);
         return;
       }
@@ -1031,8 +1039,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       success = new Jalview2XML().SaveAlignment(this, file, shortName);
 
-      statusBar.setText("Successfully saved to file: " + fileName + " in "
-              + format + " format.");
+      statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
+
 
     }
     else
@@ -1053,9 +1061,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         int reply = JOptionPane
                 .showInternalConfirmDialog(
                         Desktop.desktop,
-                        "The Alignment contains hidden columns."
-                                + "\nDo you want to save only the visible alignment?",
-                        "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);
 
@@ -1085,8 +1092,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           out.print(output);
           out.close();
           this.setTitle(file);
-          statusBar.setText("Successfully saved to file: " + fileName
-                  + " in " + format + " format.");
+          statusBar.setText(MessageManager.formatMessage("label.successfully_saved_to_file_in_format",new String[]{fileName, format}));
         } catch (Exception ex)
         {
           success = false;
@@ -1097,8 +1103,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     if (!success)
     {
-      JOptionPane.showInternalMessageDialog(this, "Couldn't save file: "
-              + fileName, "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;
@@ -1135,9 +1141,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       int reply = JOptionPane
               .showInternalConfirmDialog(
                       Desktop.desktop,
-                      "The Alignment contains hidden columns."
-                              + "\nDo you want to output only the visible alignment?",
-                      "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);
 
@@ -1156,7 +1161,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               viewport.getAlignment(), omitHidden,
               viewport.getColumnSelection()));
       Desktop.addInternalFrame(cap,
-              "Alignment output - " + e.getActionCommand(), 600, 500);
+              MessageManager.formatMessage("label.alignment_output_command", new String[]{e.getActionCommand()}), 600, 500);\r
     } catch (OutOfMemoryError oom)
     {
       new OOMWarning("Outputting alignment as " + e.getActionCommand(), oom);
@@ -1252,8 +1257,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     JalviewFileChooser chooser = new JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new JalviewFileView());
-    chooser.setDialogTitle("Load Jalview Annotations or Features File");
-    chooser.setToolTipText("Load Jalview Annotations / Features file");
+    chooser.setDialogTitle(MessageManager.getString("label.load_jalview_annotations"));\r
+    chooser.setToolTipText(MessageManager.getString("label.load_jalview_annotations"));\r
 
     int value = chooser.showOpenDialog(null);
 
@@ -1353,12 +1358,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       undoMenuItem.setEnabled(true);
       CommandI command = (CommandI) viewport.historyList.peek();
-      undoMenuItem.setText("Undo " + command.getDescription());
+      undoMenuItem.setText(MessageManager.formatMessage("label.undo_command", new String[]{command.getDescription()}));
     }
     else
     {
       undoMenuItem.setEnabled(false);
-      undoMenuItem.setText("Undo");
+      undoMenuItem.setText(MessageManager.getString("action.undo"));
     }
 
     if (viewport.redoList.size() > 0)
@@ -1366,12 +1371,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       redoMenuItem.setEnabled(true);
 
       CommandI command = (CommandI) viewport.redoList.peek();
-      redoMenuItem.setText("Redo " + command.getDescription());
+      redoMenuItem.setText(MessageManager.formatMessage("label.redo_command", new String[]{command.getDescription()}));
     }
     else
     {
       redoMenuItem.setEnabled(false);
-      redoMenuItem.setText("Redo");
+      redoMenuItem.setText(MessageManager.getString("action.redo"));
     }
   }
 
@@ -1699,7 +1704,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     Desktop.jalviewClipboard = new Object[]
     { seqs, viewport.getAlignment().getDataset(), hiddenColumns };
-    statusBar.setText("Copied " + seqs.length + " sequences to clipboard.");
+    statusBar.setText(MessageManager.formatMessage("label.copied_sequences_to_clipboard", new String[]{Integer.valueOf(seqs.length).toString()}));
   }
 
   /**
@@ -2299,7 +2304,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                 viewport.getSelectionGroup());
       }
 
-      statusBar.setText("Removed " + trimRegion.getSize() + " columns.");
+      statusBar.setText(MessageManager.formatMessage("label.removed_columns", new String[]{Integer.valueOf(trimRegion.getSize()).toString()}));
 
       addHistoryItem(trimRegion);
 
@@ -2347,8 +2352,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
     addHistoryItem(removeGapCols);
 
-    statusBar.setText("Removed " + removeGapCols.getSize()
-            + " empty columns.");
+    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
@@ -2542,7 +2546,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     newap.av.viewName = newViewName;
 
     addAlignmentPanel(newap, true);
-
+    newap.alignmentChanged();
+    
     if (alignPanels.size() == 2)
     {
       viewport.gatherViewsHere = true;
@@ -2956,12 +2961,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     editPane.setEditable(false);
     StringBuffer contents = new AlignmentProperties(viewport.getAlignment())
             .formatAsHtml();
-    editPane.setText("<html>" + contents.toString() + "</html>");
+    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, "Alignment Properties: "
-            + getTitle(), 500, 400);
+    Desktop.instance.addInternalFrame(frame, MessageManager.formatMessage("label.alignment_properties", new String[]{getTitle()}), 500, 400);\r
   }
 
   /**
@@ -2981,7 +2985,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     JInternalFrame frame = new JInternalFrame();
     OverviewPanel overview = new OverviewPanel(alignPanel);
     frame.setContentPane(overview);
-    Desktop.addInternalFrame(frame, "Overview " + this.getTitle(),
+    Desktop.addInternalFrame(frame, MessageManager.formatMessage("label.overview_params", new String[]{this.getTitle()}),\r
             frame.getWidth(), frame.getHeight());
     frame.pack();
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
@@ -3367,7 +3371,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void userDefinedColour_actionPerformed(ActionEvent e)
   {
-    if (e.getActionCommand().equals("User Defined..."))
+    if (e.getActionCommand().equals(MessageManager.getString("action.user_defined")))\r
     {
       new UserDefinedColours(alignPanel, null);
     }
@@ -3416,8 +3420,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
               int option = JOptionPane.showInternalConfirmDialog(
                       jalview.gui.Desktop.desktop,
-                      "Remove from default list?",
-                      "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)
               {
@@ -3569,14 +3573,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             || (viewport.getSelectionGroup().getSize() < 2))
     {
       JOptionPane.showInternalMessageDialog(this,
-              "You must select at least 2 sequences.", "Invalid Selection",
+              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, "Pairwise Alignment", 600, 500);
+      Desktop.addInternalFrame(frame, MessageManager.getString("action.pairwise_alignment"), 600, 500);\r
     }
   }
 
@@ -3595,9 +3599,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             || (viewport.getAlignment().getHeight() < 4))
     {
       JOptionPane.showInternalMessageDialog(this,
-              "Principal component analysis must take\n"
-                      + "at least 4 input sequences.",
-              "Sequence selection insufficient",
+              MessageManager.getString("label.principal_component_analysis_must_take_least_four_input_sequences"),
+              MessageManager.getString("label.sequence_selection_insufficient"),
               JOptionPane.WARNING_MESSAGE);
 
       return;
@@ -3699,8 +3702,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         JOptionPane
                 .showMessageDialog(
                         Desktop.desktop,
-                        "You need to have more than two sequences selected to build a tree!",
-                        "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;
       }
 
@@ -3714,10 +3717,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           JOptionPane
                   .showMessageDialog(
                           Desktop.desktop,
-                          "The selected region to create a tree may\nonly contain residues or gaps.\n"
-                                  + "Try using the Pad function in the edit menu,\n"
-                                  + "or one of the multiple sequence alignment web services.",
-                          "Sequences in selection are 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;
@@ -3735,10 +3736,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         JOptionPane
                 .showMessageDialog(
                         Desktop.desktop,
-                        "The sequences must be aligned before creating a tree.\n"
-                                + "Try using the Pad function in the edit menu,\n"
-                                + "or one of the multiple sequence alignment web services.",
-                        "Sequences not aligned",
+                        MessageManager.getString("label.sequences_must_be_aligned_before_creating_tree"),
+                        MessageManager.getString("label.sequences_not_aligned"),
                         JOptionPane.WARNING_MESSAGE);
 
         return;
@@ -3891,6 +3890,28 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void buildTreeMenu()
   {
+    calculateTree.removeAll();
+    // build the calculate menu
+    for (final String type:new String[] {"NJ", "AV"})
+    {
+      for (final Object pwtype: ResidueProperties.scoreMatrices.keySet())
+      {
+        JMenuItem tm = new JMenuItem();
+        ScoreMatrix sm = (ScoreMatrix) ResidueProperties.scoreMatrices.get(pwtype);
+        final String title="Calculate "+type+" using "+sm.getName();
+        tm.setText(title);// MessageManager.getString("label.neighbour_blosum62"));
+        tm
+                .addActionListener(new java.awt.event.ActionListener()
+                {
+                  public void actionPerformed(ActionEvent e)
+                  {
+                    NewTreePanel(type, (String) pwtype, title);
+                  }
+                });
+        calculateTree.add(tm);
+
+      }
+    }
     sortByTreeMenu.removeAll();
 
     Vector comps = (Vector) PaintRefresher.components.get(viewport
@@ -4035,8 +4056,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     JalviewFileChooser chooser = new JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
     chooser.setFileView(new JalviewFileView());
-    chooser.setDialogTitle("Select a newick-like tree file");
-    chooser.setToolTipText("Load a tree file");
+    chooser.setDialogTitle(MessageManager.getString("label.select_newick_like_tree_file"));\r
+    chooser.setToolTipText(MessageManager.getString("label.load_tree_file"));\r
 
     int value = chooser.showOpenDialog(null);
 
@@ -4052,13 +4073,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       } catch (Exception ex)
       {
         JOptionPane.showMessageDialog(Desktop.desktop, ex.getMessage(),
-                "Problem reading tree file", JOptionPane.WARNING_MESSAGE);
+                MessageManager.getString("label.problem_reading_tree_file"), JOptionPane.WARNING_MESSAGE);
         ex.printStackTrace();
       }
       if (fin != null && fin.hasWarningMessage())
       {
         JOptionPane.showMessageDialog(Desktop.desktop,
-                fin.getWarningMessage(), "Possible problem with tree file",
+                fin.getWarningMessage(), MessageManager.getString("label.possible_problem_with_tree_file"),
                 JOptionPane.WARNING_MESSAGE);
       }
     }
@@ -4559,13 +4580,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      "Please select at least three bases in at least one sequence in order to perform a cDNA translation.",
-                      "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, "Translation of " + this.getTitle(),
+      Desktop.addInternalFrame(af, MessageManager.formatMessage("label.translation_of_params", new String[]{this.getTitle()}),\r
               DEFAULT_WIDTH, DEFAULT_HEIGHT);
     }
   }
@@ -4593,8 +4614,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
       .showMessageDialog(
               Desktop.desktop,
-              "Unfortunately, something went wrong when translating your sequences.\nPlease take a look in the Jalview java console\nand submit a bug report including the stacktrace.",
-              "Implementation error: Translation Failed", JOptionPane.ERROR_MESSAGE);
+              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)
@@ -4602,13 +4623,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      "Please select at least three bases in at least one sequence in order to perform a cDNA translation.",
-                      "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, "Translation of " + this.getTitle(),
+      Desktop.addInternalFrame(af, MessageManager.formatMessage("label.translation_of_params", new String[]{this.getTitle()}),\r
               DEFAULT_WIDTH, DEFAULT_HEIGHT);
     }
   }
@@ -4802,10 +4823,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   || JOptionPane
                           .showConfirmDialog(
                                   this,
-                                  "Do you want to automatically associate the "
-                                          + filesmatched.size()
-                                          + " PDB files with sequences in the alignment that have the same name ?",
-                                  "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)
 
           {
@@ -4838,10 +4858,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                           "AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false) || JOptionPane
                           .showConfirmDialog(
                                   this,
-                                  "<html>Do you want to <em>ignore</em> the "
-                                          + filesnotmatched.size()
-                                          + " files whose names did not match any sequence IDs ?</html>",
-                                  "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;
@@ -4900,8 +4918,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               tcoffeeColour.setSelected(true);
               changeColour(new TCoffeeColourScheme(viewport.getAlignment()));
               isAnnotation = true;
-              statusBar
-                      .setText("Successfully pasted T-Coffee scores to alignment.");
+              statusBar.setText(MessageManager.getString("label.successfully_pasted_tcoffee_scores_to_alignment"));
             }
             else
             {
@@ -4910,9 +4927,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               JOptionPane
                       .showMessageDialog(
                               Desktop.desktop,
-                              tcf.getWarningMessage() == null ? "Check that the file matches sequence IDs in the alignment."
+                              tcf.getWarningMessage() == null ? MessageManager.getString("label.check_file_matches_sequence_ids_alignment")
                                       : tcf.getWarningMessage(),
-                              "Problem reading T-COFFEE score file",
+                              MessageManager.getString("label.problem_reading_tcoffee_score_file"),
                               JOptionPane.WARNING_MESSAGE);
             }
           }
@@ -5030,7 +5047,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (SwingUtilities.isRightMouseButton(e))
     {
       String reply = JOptionPane.showInternalInputDialog(this,
-              "Enter View Name", "Edit View Name",
+              MessageManager.getString("label.enter_view_name"), MessageManager.getString("label.enter_view_name"),
               JOptionPane.QUESTION_MESSAGE);
 
       if (reply != null)
@@ -5125,12 +5142,12 @@ 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("Fetch DB References");
-    rfetch.setToolTipText("Retrieve and parse sequence database records for the alignment or the currently selected sequences");
+    final JMenu rfetch = new JMenu(MessageManager.getString("action.fetch_db_references"));\r
+    rfetch.setToolTipText(MessageManager.getString("label.retrieve_parse_sequence_database_records_alignment_or_selected_sequences"));\r
     webService.add(rfetch);
 
-    JMenuItem fetchr = new JMenuItem("Standard Databases");
-    fetchr.setToolTipText("Fetch from EMBL/EMBLCDS or Uniprot/PDB and any selected DAS sources");
+    JMenuItem fetchr = new JMenuItem(MessageManager.getString("label.standard_databases"));\r
+    fetchr.setToolTipText(MessageManager.getString("label.fetch_embl_uniprot"));\r
     fetchr.addActionListener(new ActionListener()
     {
 
@@ -5234,8 +5251,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .toArray(new DbSourceProxy[0]);
                 // fetch all entry
                 DbSourceProxy src = otherdb.get(0);
-                fetchr = new JMenuItem("Fetch All '" + src.getDbSource()
-                        + "'");
+                fetchr = new JMenuItem(MessageManager.formatMessage("label.fetch_all_param", new String[]{src.getDbSource()}));\r
                 fetchr.addActionListener(new ActionListener()
                 {
                   @Override
@@ -5310,7 +5326,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   ++i;
                   if (++icomp >= mcomp || i == (otherdb.size()))
                   {
-                    ifetch.setText(imname + " to '" + sname + "'");
+                    ifetch.setText(MessageManager.formatMessage("label.source_to_target",imname,sname));
                     dfetch.add(ifetch);
                     ifetch = new JMenu();
                     imname = null;
@@ -5322,7 +5338,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               ++dbi;
               if (comp >= mcomp || dbi >= (dbclasses.length))
               {
-                dfetch.setText(mname + " to '" + dbclass + "'");
+                dfetch.setText(MessageManager.formatMessage("label.source_to_target",mname,dbclass));
                 rfetch.add(dfetch);
                 dfetch = new JMenu();
                 mname = null;