Search in sources :

Example 1 with SpectraToolTipGenerator

use of net.sf.mzmine.modules.visualization.spectra.simplespectra.renderers.SpectraToolTipGenerator in project mzmine2 by mzmine.

the class IsotopePatternPreviewDialog method addDialogComponents.

@Override
protected void addDialogComponents() {
    super.addDialogComponents();
    pFormula = parameterSet.getParameter(IsotopePatternPreviewParameters.formula);
    pMinIntensity = parameterSet.getParameter(IsotopePatternPreviewParameters.minIntensity);
    pMergeWidth = parameterSet.getParameter(IsotopePatternPreviewParameters.mergeWidth);
    pCharge = parameterSet.getParameter(IsotopePatternPreviewParameters.charge);
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    cmpMinIntensity = (PercentComponent) getComponentForParameter(IsotopePatternPreviewParameters.minIntensity);
    cmpMergeWidth = (DoubleComponent) getComponentForParameter(IsotopePatternPreviewParameters.mergeWidth);
    cmpCharge = (IntegerComponent) getComponentForParameter(IsotopePatternPreviewParameters.charge);
    cmpFormula = (StringComponent) getComponentForParameter(IsotopePatternPreviewParameters.formula);
    // panels
    newMainPanel = new JPanel(new BorderLayout());
    pnText = new JScrollPane();
    pnlChart = new EChartPanel(chart);
    pnSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, pnlChart, pnText);
    table = new JTable();
    pnlParameters = new JPanel(new FlowLayout());
    pnlControl = new JPanel(new BorderLayout());
    pnText.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
    pnText.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    pnText.setMinimumSize(new Dimension(350, 300));
    pnlChart.setMinimumSize(new Dimension(350, 200));
    // TODO: can you do this cleaner?
    pnlChart.setPreferredSize(new Dimension((int) (screenSize.getWidth() / 3), (int) (screenSize.getHeight() / 3)));
    table.setMinimumSize(new Dimension(350, 300));
    table.setDefaultEditor(Object.class, null);
    // controls
    ttGen = new SpectraToolTipGenerator();
    theme = new EIsotopePatternChartTheme();
    theme.initialize();
    // reorganize
    getContentPane().remove(mainPanel);
    organizeParameterPanel();
    pnlControl.add(pnlParameters, BorderLayout.CENTER);
    pnlControl.add(pnlButtons, BorderLayout.SOUTH);
    newMainPanel.add(pnSplit, BorderLayout.CENTER);
    newMainPanel.add(pnlControl, BorderLayout.SOUTH);
    getContentPane().add(newMainPanel);
    pnlButtons.remove(super.btnCancel);
    chart = ChartFactory.createXYBarChart("Isotope pattern preview", "m/z", false, "Abundance", new XYSeriesCollection(new XYSeries("")));
    pnlChart.setChart(chart);
    pnText.setViewportView(table);
    updateMinimumSize();
    pack();
}
Also used : JScrollPane(javax.swing.JScrollPane) XYSeries(org.jfree.data.xy.XYSeries) JPanel(javax.swing.JPanel) EChartPanel(net.sf.mzmine.chartbasics.gui.swing.EChartPanel) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable) Dimension(java.awt.Dimension) JSplitPane(javax.swing.JSplitPane) SpectraToolTipGenerator(net.sf.mzmine.modules.visualization.spectra.simplespectra.renderers.SpectraToolTipGenerator) EIsotopePatternChartTheme(net.sf.mzmine.chartbasics.chartthemes.EIsotopePatternChartTheme) XYSeriesCollection(org.jfree.data.xy.XYSeriesCollection)

Aggregations

BorderLayout (java.awt.BorderLayout)1 Dimension (java.awt.Dimension)1 FlowLayout (java.awt.FlowLayout)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 JSplitPane (javax.swing.JSplitPane)1 JTable (javax.swing.JTable)1 EIsotopePatternChartTheme (net.sf.mzmine.chartbasics.chartthemes.EIsotopePatternChartTheme)1 EChartPanel (net.sf.mzmine.chartbasics.gui.swing.EChartPanel)1 SpectraToolTipGenerator (net.sf.mzmine.modules.visualization.spectra.simplespectra.renderers.SpectraToolTipGenerator)1 XYSeries (org.jfree.data.xy.XYSeries)1 XYSeriesCollection (org.jfree.data.xy.XYSeriesCollection)1