From: gmungoc Date: Tue, 30 Apr 2019 10:57:49 +0000 (+0100) Subject: JAL-3241 simplified enum constructors for classloadability in Java 11 X-Git-Tag: Release_2_11_0~15^2~11 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=8cfbcaf2a50aa790dad1dc43c4cbceb678f3224f;p=jalview.git JAL-3241 simplified enum constructors for classloadability in Java 11 --- diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index 7840261..7232042 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -78,22 +78,26 @@ public class ImageMaker public enum TYPE { - EPS("EPS", MessageManager.getString("label.eps_file"), getEPSChooser()), + EPS("EPS", MessageManager.getString("label.eps_file"), EPS_EXTENSION, + EPS_DESCRIPTION), PNG("PNG", MessageManager.getString("label.png_image"), - getPNGChooser()), - SVG("SVG", "SVG", getSVGChooser()); - - private JalviewFileChooser chooser; + PNG_EXTENSION, PNG_DESCRIPTION), + SVG("SVG", "SVG", SVG_EXTENSION, SVG_DESCRIPTION); private String name; private String label; - TYPE(String name, String label, JalviewFileChooser chooser) + private String extension; + + private String description; + + TYPE(String name, String label, String ext, String desc) { this.name = name; this.label = label; - this.chooser = chooser; + this.extension = ext; + this.description = desc; } public String getName() @@ -101,9 +105,9 @@ public class ImageMaker return name; } - public JalviewFileChooser getChooser() + public JalviewFileChooser getFileChooser() { - return chooser; + return new JalviewFileChooser(extension, description); } public String getLabel() @@ -126,7 +130,7 @@ public class ImageMaker setProgressMessage(MessageManager.formatMessage( "status.waiting_for_user_to_select_output_file", type.name)); JalviewFileChooser chooser; - chooser = type.getChooser(); + chooser = type.getFileChooser(); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle(title); chooser.setToolTipText(MessageManager.getString("action.save"));