List of usage examples for org.jfree.chart ContextAwareChartPanel ContextAwareChartPanel
public ContextAwareChartPanel(JFreeChart chart)
From source file:net.sf.maltcms.chromaui.normalization.spi.actions.OpenPeakGroupRtBoxPlot.java
@Override public void actionPerformed(ActionEvent ev) { IChromAUIProject project = Utilities.actionsGlobalContext().lookup(IChromAUIProject.class); if (project != null && !context.isEmpty()) { PeakGroupBoxPlotTopComponent pgbpt = new PeakGroupBoxPlotTopComponent(); PeakGroupRtBoxPlot pgbp = new PeakGroupRtBoxPlot(project, context); JPanel bg = new JPanel(); BoxLayout bl = new BoxLayout(bg, BoxLayout.Y_AXIS); bg.setLayout(bl);/*from w w w .j a v a 2 s.com*/ for (JFreeChart chart : pgbp.createChart()) { ChartPanel cp = new ContextAwareChartPanel(chart); bg.add(cp); } JScrollPane jsp = new JScrollPane(bg); pgbpt.add(jsp, BorderLayout.CENTER); IRegistry registry = Lookup.getDefault().lookup(IRegistryFactory.class).getDefault(); for (IPeakGroupDescriptor pgd : context) { registry.registerTopComponentFor(pgd, pgbpt); } pgbpt.open(); pgbpt.requestActive(); } else { Logger.getLogger(getClass().getName()).warning("No IChromAUI project is in lookup!"); } }
From source file:net.sf.maltcms.chromaui.normalization.spi.actions.OpenPeakGroupBoxPlot.java
@Override public void actionPerformed(ActionEvent ev) { IChromAUIProject project = Utilities.actionsGlobalContext().lookup(IChromAUIProject.class); if (project != null && !context.isEmpty()) { IPeakNormalizer normalizer = NormalizationDialog .getPeakNormalizer(context.get(0).getPeakGroupContainer()); if (normalizer == null) { return; }/*from ww w. j a v a 2 s . c om*/ PeakGroupBoxPlotTopComponent pgbpt = new PeakGroupBoxPlotTopComponent(); PeakGroupBoxPlot pgbp = new PeakGroupBoxPlot(project, context, normalizer); JPanel bg = new JPanel(); BoxLayout bl = new BoxLayout(bg, BoxLayout.Y_AXIS); bg.setLayout(bl); for (JFreeChart chart : pgbp.createChart()) { ChartPanel cp = new ContextAwareChartPanel(chart); bg.add(cp); } JScrollPane jsp = new JScrollPane(bg); pgbpt.add(jsp, BorderLayout.CENTER); IRegistry registry = Lookup.getDefault().lookup(IRegistryFactory.class).getDefault(); for (IPeakGroupDescriptor pgd : context) { registry.registerTopComponentFor(pgd, pgbpt); } pgbpt.open(); pgbpt.requestActive(); } else { Logger.getLogger(getClass().getName()).warning("No IChromAUI project is in lookup!"); } }