JAL-3364 tidy and i18n makeAlignmentImage
[jalview.git] / src / jalview / gui / AppJmol.java
index ea7fb6b..d8564c5 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.gui;
 
+import static jalview.util.ImageMaker.TYPE.PNG;
+
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.PDBEntry;
@@ -27,6 +29,7 @@ import jalview.datamodel.SequenceI;
 import jalview.gui.StructureViewer.ViewerType;
 import jalview.structures.models.AAStructureBindingModel;
 import jalview.util.BrowserLauncher;
+import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.ws.dbsources.Pdb;
@@ -566,27 +569,11 @@ public class AppJmol extends StructureViewerBase
     int width = getWidth();
     int height = getHeight();
 
-    jalview.util.ImageMaker im;
-
-    if (type == jalview.util.ImageMaker.TYPE.PNG)
-    {
-      im = new jalview.util.ImageMaker(this,
-              jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from view",
-              width, height, null, null, null, 0, false);
-    }
-    else if (type == jalview.util.ImageMaker.TYPE.EPS)
-    {
-      im = new jalview.util.ImageMaker(this,
-              jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from view",
-              width, height, null, this.getTitle(), null, 0, false);
-    }
-    else
-    {
-
-      im = new jalview.util.ImageMaker(this,
-              jalview.util.ImageMaker.TYPE.SVG, "Make SVG file from PCA",
-              width, height, null, this.getTitle(), null, 0, false);
-    }
+    String dialogTitle = MessageManager
+            .formatMessage("label.make_pdb_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)
     {