use of net.sf.mzmine.modules.visualization.tic.TICPlot in project mzmine2 by mzmine.
the class ParameterSetupDialogWithChromatogramPreview method addDialogComponents.
/**
* This function add all the additional components for this dialog over the original
* ParameterSetupDialog.
*/
@Override
protected void addDialogComponents() {
super.addDialogComponents();
dataFiles = MZmineCore.getProjectManager().getCurrentProject().getDataFiles();
if (dataFiles.length == 0)
return;
RawDataFile[] selectedFiles = MZmineCore.getDesktop().getSelectedDataFiles();
if (selectedFiles.length > 0)
previewDataFile = selectedFiles[0];
else
previewDataFile = dataFiles[0];
previewCheckBox = new JCheckBox("Show preview");
previewCheckBox.addActionListener(this);
previewCheckBox.setHorizontalAlignment(SwingConstants.CENTER);
mainPanel.add(new JSeparator(), 0, getNumberOfParameters() + 1, 3, 1);
mainPanel.add(previewCheckBox, 0, getNumberOfParameters() + 2, 3, 1);
// Elements of pnlLab
JPanel pnlLab = new JPanel();
pnlLab.setLayout(new BoxLayout(pnlLab, BoxLayout.Y_AXIS));
pnlLab.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
pnlLab.add(Box.createVerticalStrut(5));
pnlLab.add(new JLabel("Data file "));
pnlLab.add(Box.createVerticalStrut(20));
pnlLab.add(new JLabel("Plot Type "));
pnlLab.add(Box.createVerticalStrut(25));
pnlLab.add(new JLabel("RT range "));
pnlLab.add(Box.createVerticalStrut(15));
pnlLab.add(new JLabel("m/z range "));
// Elements of pnlFlds
JPanel pnlFlds = new JPanel();
pnlFlds.setLayout(new BoxLayout(pnlFlds, BoxLayout.Y_AXIS));
pnlFlds.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
comboDataFileName = new JComboBox<RawDataFile>(dataFiles);
comboDataFileName.setSelectedItem(previewDataFile);
comboDataFileName.addActionListener(this);
ticViewComboBox = new JComboBox<TICPlotType>(TICPlotType.values());
ticViewComboBox.setSelectedItem(TICPlotType.TIC);
ticViewComboBox.addActionListener(this);
rtRangeBox = new DoubleRangeComponent(MZmineCore.getConfiguration().getRTFormat());
rtRangeBox.setValue(previewDataFile.getDataRTRange(1));
mzRangeBox = new DoubleRangeComponent(MZmineCore.getConfiguration().getMZFormat());
mzRangeBox.setValue(previewDataFile.getDataMZRange(1));
pnlFlds.add(comboDataFileName);
pnlFlds.add(Box.createVerticalStrut(10));
pnlFlds.add(ticViewComboBox);
pnlFlds.add(Box.createVerticalStrut(20));
pnlFlds.add(rtRangeBox);
pnlFlds.add(Box.createVerticalStrut(5));
pnlFlds.add(mzRangeBox);
// Put all together
pnlPreviewFields = new JPanel(new BorderLayout());
pnlPreviewFields.add(pnlLab, BorderLayout.WEST);
pnlPreviewFields.add(pnlFlds, BorderLayout.CENTER);
pnlPreviewFields.setVisible(false);
ticPlot = new TICPlot(this);
ticPlot.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
ticPlot.setMinimumSize(new Dimension(400, 300));
mainPanel.add(pnlPreviewFields, 0, getNumberOfParameters() + 3, 3, 1, 0, 0);
updateMinimumSize();
pack();
}
Aggregations