Merge branch 'hotfix/JAL-1521' into Release_2_8_2_Branch
[jalview.git] / src / jalview / gui / PCAPanel.java
index 213b748..3483cc4 100644 (file)
@@ -97,10 +97,8 @@ public class PCAPanel extends GPCAPanel implements Runnable,
       JOptionPane
               .showMessageDialog(
                       Desktop.desktop,
-                      "The sequences must be aligned before calculating PCA.\n"
-                              + "Try using the Pad function in the edit menu,\n"
-                              + "or one of the multiple sequence alignment web services.",
-                      "Sequences not aligned", JOptionPane.WARNING_MESSAGE);
+                      MessageManager.getString("label.pca_sequences_not_aligned"),
+                      MessageManager.getString("label.sequences_not_aligned"), JOptionPane.WARNING_MESSAGE);
 
       return;
     }
@@ -112,11 +110,12 @@ public class PCAPanel extends GPCAPanel implements Runnable,
     Thread worker = new Thread(this);
     worker.start();
   }
+
   @Override
   protected void scoreMatrix_menuSelected()
   {
     scoreMatrixMenu.removeAll();
-    for (final String sm:ResidueProperties.scoreMatrices.keySet())
+    for (final String sm : ResidueProperties.scoreMatrices.keySet())
     {
       if (ResidueProperties.getScoreMatrix(sm) != null)
       {
@@ -149,9 +148,10 @@ public class PCAPanel extends GPCAPanel implements Runnable,
       }
     }
   }
+
   public void bgcolour_actionPerformed(ActionEvent e)
   {
-    Color col = JColorChooser.showDialog(this, "Select Background Colour",
+    Color col = JColorChooser.showDialog(this, MessageManager.getString("label.select_backgroud_colour"),
             rc.bgColour);
 
     if (col != null)
@@ -168,11 +168,11 @@ public class PCAPanel extends GPCAPanel implements Runnable,
   {
     long progId = System.currentTimeMillis();
     IProgressIndicator progress = this;
-    String message = "Recalculating PCA";
+    String message = MessageManager.getString("label.pca_recalculating");
     if (getParent() == null)
     {
       progress = ap.alignFrame;
-      message = "Calculating PCA";
+      message = MessageManager.getString("label.pca_calculating");
     }
     progress.setProgressBar(message, progId);
     try
@@ -204,8 +204,8 @@ public class PCAPanel extends GPCAPanel implements Runnable,
     if (getParent() == null)
     {
       addKeyListener(rc);
-      Desktop.addInternalFrame(this, MessageManager.getString("label.principal_component_analysis"), 475,
-              450);
+      Desktop.addInternalFrame(this, MessageManager
+              .getString("label.principal_component_analysis"), 475, 450);
     }
   }
 
@@ -302,7 +302,8 @@ public class PCAPanel extends GPCAPanel implements Runnable,
     try
     {
       cap.setText(pcaModel.getDetails());
-      Desktop.addInternalFrame(cap, MessageManager.getString("label.pca_details"), 500, 500);
+      Desktop.addInternalFrame(cap,
+              MessageManager.getString("label.pca_details"), 500, 500);
     } catch (OutOfMemoryError oom)
     {
       new OOMWarning("opening PCA details", oom);
@@ -376,8 +377,10 @@ public class PCAPanel extends GPCAPanel implements Runnable,
         // af.addSortByOrderMenuItem(ServiceName + " Ordering",
         // msaorder);
 
-        Desktop.addInternalFrame(af, MessageManager.formatMessage("label.original_data_for_params", new String[]{this.title}),
-                AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+        Desktop.addInternalFrame(af, MessageManager.formatMessage(
+                "label.original_data_for_params", new String[]
+                { this.title }), AlignFrame.DEFAULT_WIDTH,
+                AlignFrame.DEFAULT_HEIGHT);
       }
     }
     /*
@@ -487,7 +490,6 @@ public class PCAPanel extends GPCAPanel implements Runnable,
     }
   }
 
-  
   public void viewMenu_menuSelected()
   {
     buildAssociatedViewMenu();
@@ -566,7 +568,9 @@ public class PCAPanel extends GPCAPanel implements Runnable,
       cap.setText(pcaModel.getPointsasCsv(false,
               xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(),
               zCombobox.getSelectedIndex()));
-      Desktop.addInternalFrame(cap, MessageManager.formatMessage("label.points_for_params", new String[]{this.getTitle()}), 500, 500);
+      Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+              "label.points_for_params", new String[]
+              { this.getTitle() }), 500, 500);
     } catch (OutOfMemoryError oom)
     {
       new OOMWarning("exporting PCA points", oom);
@@ -589,8 +593,9 @@ public class PCAPanel extends GPCAPanel implements Runnable,
       cap.setText(pcaModel.getPointsasCsv(true,
               xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(),
               zCombobox.getSelectedIndex()));
-      Desktop.addInternalFrame(cap, MessageManager.formatMessage("label.transformed_points_for_params", new String[]{this.getTitle()}),
-              500, 500);
+      Desktop.addInternalFrame(cap, MessageManager.formatMessage(
+              "label.transformed_points_for_params", new String[]
+              { this.getTitle() }), 500, 500);
     } catch (OutOfMemoryError oom)
     {
       new OOMWarning("exporting transformed PCA points", oom);
@@ -661,14 +666,14 @@ public class PCAPanel extends GPCAPanel implements Runnable,
   {
     if (progressBarHandlers == null || !progressBars.contains(new Long(id)))
     {
-      throw new Error(
-              "call setProgressBar before registering the progress bar's handler.");
+      throw new Error(MessageManager.getString("error.call_setprogressbar_before_registering_handler"));
     }
     progressBarHandlers.put(new Long(id), handler);
     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()
       {
@@ -677,10 +682,7 @@ public class PCAPanel extends GPCAPanel implements Runnable,
         public void actionPerformed(ActionEvent e)
         {
           handler.cancelActivity(id);
-          us.setProgressBar(
-                  "Cancelled "
-                          + ((JLabel) progressPanel.getComponent(0))
-                                  .getText(), id);
+          us.setProgressBar(MessageManager.formatMessage("label.cancelled_params", new String[]{((JLabel) progressPanel.getComponent(0)).getText()}), id);
         }
       });
       progressPanel.add(cancel, BorderLayout.EAST);