Search in sources :

Example 1 with PeakPreviewComboRenderer

use of net.sf.mzmine.modules.peaklistmethods.peakpicking.deconvolution.PeakPreviewComboRenderer in project mzmine2 by mzmine.

the class ShapeModelerSetupDialog method addComponents.

/**
 * This function add all the additional components for this dialog over the original
 * ParameterSetupDialog.
 */
private void addComponents() {
    PeakList[] peakLists = MZmineCore.getProjectManager().getCurrentProject().getPeakLists();
    // Elements of pnlpreview
    JPanel pnlpreview = new JPanel(new BorderLayout());
    preview = new JCheckBox(" Show preview of peak building ");
    preview.addActionListener(this);
    preview.setHorizontalAlignment(SwingConstants.CENTER);
    preview.setEnabled(peakLists.length > 0);
    pnlpreview.add(new JSeparator(), BorderLayout.NORTH);
    pnlpreview.add(preview, BorderLayout.CENTER);
    pnlpreview.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
    JComponent[] tableComponents = new JComponent[4];
    tableComponents[0] = new JLabel("Feature list");
    comboPeakList = new JComboBox<PeakList>();
    for (PeakList peakList : peakLists) {
        comboPeakList.addItem(peakList);
    }
    comboPeakList.setFont(comboFont);
    comboPeakList.addActionListener(this);
    tableComponents[1] = comboPeakList;
    comboPeak = new JComboBox<PeakListRow>();
    comboPeak.setFont(comboFont);
    comboPeak.setRenderer(new PeakPreviewComboRenderer());
    tableComponents[2] = new JLabel("Peak");
    tableComponents[3] = comboPeak;
    pnlLabelsFields = GUIUtils.makeTablePanel(2, 2, tableComponents);
    // Put all together
    pnlVisible = new JPanel(new BorderLayout());
    pnlVisible.add(pnlpreview, BorderLayout.NORTH);
    // Panel for XYPlot
    pnlPlotXY = new JPanel(new BorderLayout());
    GUIUtils.addMarginAndBorder(pnlPlotXY, 10);
    pnlPlotXY.setBackground(Color.white);
    ticPlot = new TICPlot((ActionListener) this);
    pnlPlotXY.add(ticPlot, BorderLayout.CENTER);
    toolBar = new TICToolBar(ticPlot);
    toolBar.getComponentAtIndex(0).setVisible(false);
    pnlPlotXY.add(toolBar, BorderLayout.EAST);
    mainPanel.add(pnlVisible, 0, getNumberOfParameters() + 3, 3, 1, 0, 0);
    updateMinimumSize();
    pack();
    setLocationRelativeTo(MZmineCore.getDesktop().getMainWindow());
}
Also used : JPanel(javax.swing.JPanel) PeakPreviewComboRenderer(net.sf.mzmine.modules.peaklistmethods.peakpicking.deconvolution.PeakPreviewComboRenderer) TICToolBar(net.sf.mzmine.modules.visualization.tic.TICToolBar) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator) JCheckBox(javax.swing.JCheckBox) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) BorderLayout(java.awt.BorderLayout) ActionListener(java.awt.event.ActionListener) PeakList(net.sf.mzmine.datamodel.PeakList) TICPlot(net.sf.mzmine.modules.visualization.tic.TICPlot)

Aggregations

BorderLayout (java.awt.BorderLayout)1 ActionListener (java.awt.event.ActionListener)1 JCheckBox (javax.swing.JCheckBox)1 JComponent (javax.swing.JComponent)1 JLabel (javax.swing.JLabel)1 JPanel (javax.swing.JPanel)1 JSeparator (javax.swing.JSeparator)1 PeakList (net.sf.mzmine.datamodel.PeakList)1 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)1 PeakPreviewComboRenderer (net.sf.mzmine.modules.peaklistmethods.peakpicking.deconvolution.PeakPreviewComboRenderer)1 TICPlot (net.sf.mzmine.modules.visualization.tic.TICPlot)1 TICToolBar (net.sf.mzmine.modules.visualization.tic.TICToolBar)1