Example usage for org.jfree.chart ChartPanel getRootPane

List of usage examples for org.jfree.chart ChartPanel getRootPane

Introduction

In this page you can find the example usage for org.jfree.chart ChartPanel getRootPane.

Prototype

@BeanProperty(bound = false)
public JRootPane getRootPane() 

Source Link

Document

Returns the JRootPane ancestor for this component.

Usage

From source file:it.unibo.alchemist.boundary.gui.asmc.SimplePlot.java

@Override
public void batchDone(final double[][] values, final double lower, final double upper, final int sampleSize) {
    this.removeAll();
    final YIntervalSeries series = new YIntervalSeries("Probability of condition satisfaction vs. time");
    for (final double[] value : values) {
        series.add(value[0], value[1], value[2], value[TRE]);
    }/*  w  w w  . ja v  a  2  s .  c  om*/
    final YIntervalSeriesCollection data = new YIntervalSeriesCollection();
    data.addSeries(series);
    final JFreeChart chart = ChartFactory.createXYLineChart("", "X", "Y", data, PlotOrientation.VERTICAL, true,
            true, false);
    XYItemRenderer renderer;
    switch (currentRenderer) {
    case 1:
        renderer = new YIntervalRenderer();
        break;
    case 0:
    default:
        renderer = new DeviationRenderer(true, false);
    }
    final XYPlot plot = (XYPlot) chart.getPlot();
    plot.setRenderer(renderer);
    plot.getDomainAxis().setLowerBound(lower);
    plot.getDomainAxis().setUpperBound(upper);
    plot.getRangeAxis().setUpperBound(1.0);
    plot.getRangeAxis().setLowerBound(0.0);

    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(DIMENSION);
    this.setLayout(new BorderLayout());
    this.add(chartPanel, BorderLayout.NORTH);
    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            chartPanel.getRootPane().validate();
        }
    });
}