JAL-3364 tidy and i18n makeAlignmentImage
[jalview.git] / src / jalview / gui / PCAPanel.java
index 4f660a2..a833f98 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.gui;
 
+import static jalview.util.ImageMaker.TYPE.PNG;
+
 import jalview.analysis.scoremodels.ScoreModels;
 import jalview.api.AlignViewportI;
 import jalview.api.analysis.ScoreModelI;
@@ -431,25 +433,11 @@ public class PCAPanel extends GPCAPanel
     int width = getRotatableCanvas().getWidth();
     int height = getRotatableCanvas().getHeight();
 
-    ImageMaker im;
-
-    switch (type)
-    {
-    case PNG:
-      im = new ImageMaker(this, ImageMaker.TYPE.PNG,
-              "Make PNG image from PCA", width, height, null, null, null, 0,
-              false);
-      break;
-    case EPS:
-      im = new ImageMaker(this, ImageMaker.TYPE.EPS,
-              "Make EPS file from PCA", width, height, null,
-              this.getTitle(), null, 0, false);
-      break;
-    default:
-      im = new ImageMaker(this, ImageMaker.TYPE.SVG,
-              "Make SVG file from PCA", width, height, null,
-              this.getTitle(), null, 0, false);
-    }
+    String dialogTitle = MessageManager
+            .formatMessage("label.make_pca_image", type.getName());
+    String imageTitle = type == PNG ? null : this.getTitle();
+    ImageMaker im = new ImageMaker(this, type, dialogTitle, width, height,
+            null, imageTitle, null, 0, false);
 
     if (im.getGraphics() != null)
     {