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();
}
}
}
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();
}
}
}
Aggregations