use of net.sf.mzmine.chartbasics.chartthemes.EIsotopePatternChartTheme 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();
}
Aggregations