Search in sources :

Example 6 with SaveImage

use of net.sf.mzmine.util.SaveImage in project mzmine2 by mzmine.

the class TwoDPlot method actionPerformed.

@Override
public void actionPerformed(final ActionEvent event) {
    super.actionPerformed(event);
    final String command = event.getActionCommand();
    if ("SAVE_EMF".equals(command)) {
        JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("EMF Image", "EMF");
        chooser.setFileFilter(filter);
        int returnVal = chooser.showSaveDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            String file = chooser.getSelectedFile().getPath();
            if (!file.toLowerCase().endsWith(".emf"))
                file += ".emf";
            int width = (int) this.getSize().getWidth();
            int height = (int) this.getSize().getHeight();
            // Save image
            SaveImage SI = new SaveImage(getChart(), file, width, height, FileType.EMF);
            new Thread(SI).start();
        }
    }
    if ("SAVE_EPS".equals(command)) {
        JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("EPS Image", "EPS");
        chooser.setFileFilter(filter);
        int returnVal = chooser.showSaveDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            String file = chooser.getSelectedFile().getPath();
            if (!file.toLowerCase().endsWith(".eps"))
                file += ".eps";
            int width = (int) this.getSize().getWidth();
            int height = (int) this.getSize().getHeight();
            // Save image
            SaveImage SI = new SaveImage(getChart(), file, width, height, FileType.EPS);
            new Thread(SI).start();
        }
    }
}
Also used : JFileChooser(javax.swing.JFileChooser) FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter) SaveImage(net.sf.mzmine.util.SaveImage)

Example 7 with SaveImage

use of net.sf.mzmine.util.SaveImage in project mzmine2 by mzmine.

the class NeutralLossPlot method actionPerformed.

@Override
public void actionPerformed(final ActionEvent event) {
    super.actionPerformed(event);
    final String command = event.getActionCommand();
    if ("SAVE_EMF".equals(command)) {
        JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("EMF Image", "EMF");
        chooser.setFileFilter(filter);
        int returnVal = chooser.showSaveDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            String file = chooser.getSelectedFile().getPath();
            if (!file.toLowerCase().endsWith(".emf"))
                file += ".emf";
            int width = (int) this.getSize().getWidth();
            int height = (int) this.getSize().getHeight();
            // Save image
            SaveImage SI = new SaveImage(getChart(), file, width, height, FileType.EMF);
            new Thread(SI).start();
        }
    }
    if ("SAVE_EPS".equals(command)) {
        JFileChooser chooser = new JFileChooser();
        FileNameExtensionFilter filter = new FileNameExtensionFilter("EPS Image", "EPS");
        chooser.setFileFilter(filter);
        int returnVal = chooser.showSaveDialog(null);
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            String file = chooser.getSelectedFile().getPath();
            if (!file.toLowerCase().endsWith(".eps"))
                file += ".eps";
            int width = (int) this.getSize().getWidth();
            int height = (int) this.getSize().getHeight();
            // Save image
            SaveImage SI = new SaveImage(getChart(), file, width, height, FileType.EPS);
            new Thread(SI).start();
        }
    }
}
Also used : JFileChooser(javax.swing.JFileChooser) FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter) SaveImage(net.sf.mzmine.util.SaveImage)

Aggregations

JFileChooser (javax.swing.JFileChooser)7 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)7 SaveImage (net.sf.mzmine.util.SaveImage)7 AxesSetupDialog (net.sf.mzmine.util.dialogs.AxesSetupDialog)2 Color (java.awt.Color)1 Paint (java.awt.Paint)1 Window (java.awt.Window)1 HashMap (java.util.HashMap)1 JFrame (javax.swing.JFrame)1 Feature (net.sf.mzmine.datamodel.Feature)1 PeakIdentity (net.sf.mzmine.datamodel.PeakIdentity)1 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)1 ScanSelection (net.sf.mzmine.parameters.parametertypes.selectors.ScanSelection)1 NumberAxis (org.jfree.chart.axis.NumberAxis)1 LegendTitle (org.jfree.chart.title.LegendTitle)1