Search in sources :

Example 1 with TICToolBar

use of net.sf.mzmine.modules.visualization.tic.TICToolBar in project mzmine2 by mzmine.

the class PeakResolverSetupDialog method addDialogComponents.

/**
 * This function add all the additional components for this dialog over the original
 * ParameterSetupDialog.
 */
@Override
protected void addDialogComponents() {
    super.addDialogComponents();
    final PeakList[] peakLists = MZmineCore.getProjectManager().getCurrentProject().getPeakLists();
    // Elements of panel.
    preview = new JCheckBox("Show preview");
    preview.addActionListener(this);
    preview.setHorizontalAlignment(SwingConstants.CENTER);
    preview.setEnabled(peakLists.length > 0);
    // Preview panel.
    final JPanel previewPanel = new JPanel(new BorderLayout());
    previewPanel.add(new JSeparator(), BorderLayout.NORTH);
    previewPanel.add(preview, BorderLayout.CENTER);
    previewPanel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
    // Feature list combo-box.
    comboPeakList = new JComboBox<PeakList>();
    comboPeakList.setFont(COMBO_FONT);
    for (final PeakList peakList : peakLists) {
        if (peakList.getNumberOfRawDataFiles() == 1) {
            comboPeakList.addItem(peakList);
        }
    }
    comboPeakList.addActionListener(this);
    // Peaks combo box.
    comboPeak = new JComboBox<PeakListRow>();
    comboPeak.setFont(COMBO_FONT);
    comboPeak.setRenderer(new PeakPreviewComboRenderer());
    comboPeak.setPreferredSize(new Dimension(PREFERRED_PEAK_COMBO_WIDTH, comboPeak.getPreferredSize().height));
    pnlLabelsFields = GUIUtils.makeTablePanel(2, 2, new JComponent[] { new JLabel("Feature list"), comboPeakList, new JLabel("Chromatogram"), comboPeak });
    // Put all together.
    pnlVisible = new JPanel(new BorderLayout());
    pnlVisible.add(previewPanel, BorderLayout.NORTH);
    // TIC plot.
    ticPlot = new TICPlot(this);
    ticPlot.setMinimumSize(MINIMUM_TIC_DIMENSIONS);
    // Tool bar.
    final TICToolBar toolBar = new TICToolBar(ticPlot);
    toolBar.getComponentAtIndex(0).setVisible(false);
    // Panel for XYPlot.
    pnlPlotXY = new JPanel(new BorderLayout());
    pnlPlotXY.setBackground(Color.white);
    pnlPlotXY.add(ticPlot, BorderLayout.CENTER);
    pnlPlotXY.add(toolBar, BorderLayout.EAST);
    GUIUtils.addMarginAndBorder(pnlPlotXY, 10);
    mainPanel.add(pnlVisible, 0, getNumberOfParameters() + 3, 2, 1, 0, 0, GridBagConstraints.HORIZONTAL);
    // Layout and position.
    updateBounds();
}
Also used : JPanel(javax.swing.JPanel) TICToolBar(net.sf.mzmine.modules.visualization.tic.TICToolBar) JComponent(javax.swing.JComponent) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JSeparator(javax.swing.JSeparator) JCheckBox(javax.swing.JCheckBox) PeakListRow(net.sf.mzmine.datamodel.PeakListRow) BorderLayout(java.awt.BorderLayout) PeakList(net.sf.mzmine.datamodel.PeakList) TICPlot(net.sf.mzmine.modules.visualization.tic.TICPlot)

Example 2 with TICToolBar

use of net.sf.mzmine.modules.visualization.tic.TICToolBar 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)2 JCheckBox (javax.swing.JCheckBox)2 JComponent (javax.swing.JComponent)2 JLabel (javax.swing.JLabel)2 JPanel (javax.swing.JPanel)2 JSeparator (javax.swing.JSeparator)2 PeakList (net.sf.mzmine.datamodel.PeakList)2 PeakListRow (net.sf.mzmine.datamodel.PeakListRow)2 TICPlot (net.sf.mzmine.modules.visualization.tic.TICPlot)2 TICToolBar (net.sf.mzmine.modules.visualization.tic.TICToolBar)2 Dimension (java.awt.Dimension)1 ActionListener (java.awt.event.ActionListener)1 PeakPreviewComboRenderer (net.sf.mzmine.modules.peaklistmethods.peakpicking.deconvolution.PeakPreviewComboRenderer)1