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