X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=e1b5abb3c2e6571347faec893b4acb813d0d058f;hb=ab43013b7e357b84b4abade0dba949668dfb2a0e;hp=d6109311b409902f893f6cf3382b73e7e4038014;hpb=eaf9092bfa74b5162589c8775f68a19dd79dbb1d;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index d610931..e1b5abb 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. @@ -1139,14 +1139,17 @@ public class AlignmentPanel extends GAlignmentPanel implements return idwidth.intValue() + 4; } - void makeAlignmentImage(int type, File file) + void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file) { long progress = System.currentTimeMillis(); boolean headless = (System.getProperty("java.awt.headless") != null && System .getProperty("java.awt.headless").equals("true")); if (alignFrame != null && !headless) { - alignFrame.setProgressBar(MessageManager.formatMessage("status.saving_file", new String[]{(type == jalview.util.ImageMaker.PNG ? MessageManager.getString("label.png_image") : MessageManager.getString("label.eps_file"))}), progress); + alignFrame.setProgressBar(MessageManager.formatMessage( + "status.saving_file", + new String[] + { type.getLabel() }), progress); } try { @@ -1190,16 +1193,22 @@ public class AlignmentPanel extends GAlignmentPanel implements jalview.util.ImageMaker im; final String imageAction, imageTitle; - if (type == jalview.util.ImageMaker.PNG) + if (type == jalview.util.ImageMaker.TYPE.PNG) { imageAction = "Create PNG image from alignment"; imageTitle = null; } - else + else if (type == jalview.util.ImageMaker.TYPE.EPS) { imageAction = "Create EPS file from alignment"; imageTitle = alignFrame.getTitle(); } + else + { + imageAction = "Create SVG file from alignment"; + imageTitle = alignFrame.getTitle(); + } + im = new jalview.util.ImageMaker(this, type, imageAction, width, height, file, imageTitle); if (av.getWrapAlignment()) @@ -1243,7 +1252,7 @@ public class AlignmentPanel extends GAlignmentPanel implements */ public void makeEPS(File epsFile) { - makeAlignmentImage(jalview.util.ImageMaker.EPS, epsFile); + makeAlignmentImage(jalview.util.ImageMaker.TYPE.EPS, epsFile); } /** @@ -1251,9 +1260,13 @@ public class AlignmentPanel extends GAlignmentPanel implements */ public void makePNG(File pngFile) { - makeAlignmentImage(jalview.util.ImageMaker.PNG, pngFile); + makeAlignmentImage(jalview.util.ImageMaker.TYPE.PNG, pngFile); } + public void makeSVG(File svgFile) + { + makeAlignmentImage(jalview.util.ImageMaker.TYPE.SVG, svgFile); + } public void makePNGImageMap(File imgMapFile, String imageName) { // /////ONLY WORKS WITH NONE WRAPPED ALIGNMENTS @@ -1490,11 +1503,8 @@ public class AlignmentPanel extends GAlignmentPanel implements return av.getAlignment(); } - /** - * get the name for this view - * - * @return - */ + + @Override public String getViewName() { return av.viewName;