Search in sources :

Example 1 with TICPlotType

use of net.sf.mzmine.modules.visualization.tic.TICPlotType 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();
}
Also used : JPanel(javax.swing.JPanel) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JSeparator(javax.swing.JSeparator) JCheckBox(javax.swing.JCheckBox) TICPlotType(net.sf.mzmine.modules.visualization.tic.TICPlotType) BorderLayout(java.awt.BorderLayout) RawDataFile(net.sf.mzmine.datamodel.RawDataFile) TICPlot(net.sf.mzmine.modules.visualization.tic.TICPlot) DoubleRangeComponent(net.sf.mzmine.parameters.parametertypes.ranges.DoubleRangeComponent)

Aggregations

BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 BoxLayout (javax.swing.BoxLayout)1 JCheckBox (javax.swing.JCheckBox)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JSeparator (javax.swing.JSeparator)1 RawDataFile (net.sf.mzmine.datamodel.RawDataFile)1 TICPlot (net.sf.mzmine.modules.visualization.tic.TICPlot)1 TICPlotType (net.sf.mzmine.modules.visualization.tic.TICPlotType)1 DoubleRangeComponent (net.sf.mzmine.parameters.parametertypes.ranges.DoubleRangeComponent)1