Example usage for org.jfree.chart.event ChartProgressEvent DRAWING_FINISHED

List of usage examples for org.jfree.chart.event ChartProgressEvent DRAWING_FINISHED

Introduction

In this page you can find the example usage for org.jfree.chart.event ChartProgressEvent DRAWING_FINISHED.

Prototype

int DRAWING_FINISHED

To view the source code for org.jfree.chart.event ChartProgressEvent DRAWING_FINISHED.

Click Source Link

Document

Indicates drawing has finished.

Usage

From source file:org.fhcrc.cpl.toolbox.gui.chart.CrosshairChangeListener.java

public void chartProgress(ChartProgressEvent event) {
    if (event.getType() != ChartProgressEvent.DRAWING_FINISHED)
        return;//from  ww  w  .  j  a va 2s. c  o  m
    double newDomainValue = event.getChart().getXYPlot().getDomainCrosshairValue();
    double newRangeValue = event.getChart().getXYPlot().getRangeCrosshairValue();

    if (domainValue != newDomainValue || rangeValue != newRangeValue) {
        domainValue = newDomainValue;
        rangeValue = newRangeValue;
        crosshairValueChanged(event);
    }
}

From source file:gchisto.jfreechart.extensions.ChartLocker.java

public void chartProgress(ChartProgressEvent event) {
    switch (event.getType()) {
    case ChartProgressEvent.DRAWING_STARTED:
        lock();/*from  ww w. ja v  a 2s .c  o  m*/
        break;
    case ChartProgressEvent.DRAWING_FINISHED:
        unlock();
        break;
    }
}

From source file:cgpanalyser.gui.chart.XYChartPanel.java

@Override
public void chartProgress(ChartProgressEvent event) {
    if (event.getType() != ChartProgressEvent.DRAWING_FINISHED)
        return;/* w  w  w. j ava  2s  .co m*/

    JFreeChart jfreechart = this.getChart();
    if (jfreechart != null) {
        int currentDomainCrosshairValue = getDomainCrosshairValue(jfreechart);
        if (domainCrosshairValue != currentDomainCrosshairValue) {
            domainCrosshairValue = currentDomainCrosshairValue;
            System.out.println("domainCrosshairValue:" + currentDomainCrosshairValue);
            panelMain.drawChromosomesOnCrosshairEvent(domainCrosshairValue);
        }
    }
}

From source file:msi.gama.outputs.layers.charts.ChartJFreeChartOutput.java

@Override
public void chartProgress(final ChartProgressEvent event) {
    ready = event.getType() == ChartProgressEvent.DRAWING_FINISHED;
}

From source file:tw.edu.sju.ee.eea.module.iepe.file.IepeVoltageElement.java

private JFreeChart createChart() {

    SampledChart sampledChart = new SampledChart("Voltage Oscillogram");
    sampledChart.addData(0, SampledChart.createSampledSeriesCollection("Ch_0", info.getInputStream(), index,
            info.getSamplerate(), length));
    sampledChart.addMarker(cursor);/*from w  w  w.ja va  2s. co  m*/
    sampledChart.addProgressListener(new ChartProgressListener() {

        @Override
        public void chartProgress(ChartProgressEvent event) {
            if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {
                if (chartMouseClicked) {
                    info.getCursor().setTime((int) event.getChart().getXYPlot().getDomainCrosshairValue());
                    chartMouseClicked = false;
                }
            }
        }
    });
    return sampledChart;
}

From source file:com.orange.atk.graphAnalyser.LectureJATKResult.java

/**
 * Handles a chart progress event.//from  ww w . ja  va  2s.  c  om
 *
 * @param event
 *            the event.
 */
public void chartProgress(ChartProgressEvent event) {
    if (event.getType() != ChartProgressEvent.DRAWING_FINISHED) {
        return;
    }
    if (this.chartPanel != null) {
        JFreeChart c = this.chartPanel.getChart();
        if (c != null) {
            XYPlot plot = c.getXYPlot();
            double xx = plot.getDomainCrosshairValue();
            if (xx != 0 && mapPerfGraph != null) {

                Set<String> cles = mapPerfGraph.keySet();
                Iterator<String> it = cles.iterator();
                int index = 0;
                while (it.hasNext()) {
                    String cle = (String) it.next();
                    PerformanceGraph graph = (PerformanceGraph) mapPerfGraph.get(cle);

                    String Name = graph.getSerieName();
                    graph.getY(xx);

                    double Yvalue = graph.getYvalue();
                    double Yvaluenext = graph.getNextyvalue();
                    double Yvalueprev = graph.getPrevousyValue();
                    Name = Name.replace("Series ", "");
                    this.modeltable.setValueAt(Name, index, 0);
                    this.modeltable.setValueAt(new Double(Yvalue), index, 1);
                    this.modeltable.setValueAt(new Double(Yvaluenext), index, 2);
                    this.modeltable.setValueAt(new Double(Yvalueprev), index, 3);
                    index++;
                }
                // update the table...
            }
        }
    }
}

From source file:net.sf.mzmine.modules.visualization.scatterplot.scatterplotchart.ScatterPlotChart.java

/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 *//*from  ww  w  .  ja  v a2  s  . c o  m*/
@Override
public void chartProgress(ChartProgressEvent event) {
    super.chartProgress(event);

    // Whenever chart is repainted (e.g. after crosshair position changed),
    // we update the selected item name
    if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {
        double valueX = plot.getDomainCrosshairValue();
        double valueY = plot.getRangeCrosshairValue();
        PeakListRow selectedRow = mainDataSet.getRow(valueX, valueY);
        topPanel.updateItemNameText(selectedRow);
    }
}

From source file:net.sf.mzmine.modules.visualization.neutralloss.NeutralLossPlot.java

/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 *///w  w  w. ja  va2s. c o  m
public void chartProgress(ChartProgressEvent event) {

    super.chartProgress(event);

    if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {

        visualizer.updateTitle();

        if (showSpectrumRequest) {
            showSpectrumRequest = false;
            visualizer.actionPerformed(
                    new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
        }
    }

}

From source file:gov.llnl.lc.infiniband.opensm.plugin.gui.chart.AdvancedXY_PlotPanel.java

@Override
public void chartProgress(ChartProgressEvent event) {
    if (event.getType() != ChartProgressEvent.DRAWING_FINISHED) {
        return;//from  w w w .  ja  v  a 2  s  .c o  m
    }

    // update the table model

    if (this.chartPanel != null) {
        JFreeChart c = this.getChart();
        if (c != null) {
            XYPlot plot = (XYPlot) c.getPlot();

            int ndex = this.getCrossHairDomainIndex();

            // update the table from the value at the crosshair

            for (int pnum = 0; pnum < NumDataSets; pnum++) {
                XYDataset dataset = plot.getDataset(pnum);
                String seriesName = "Unknown";
                if ((dataset != null) && (dataset.getSeriesKey(0) != null)) {
                    int ds_size = dataset.getItemCount(0);
                    if (dataset.getSeriesKey(0) instanceof String)
                        seriesName = (String) dataset.getSeriesKey(0);

                    // the name
                    this.model.setValueAt(seriesName, pnum, 0);

                    // the deltas are one smaller than the counters, so make sure the
                    // crosshair index is valid
                    if (ndex < ds_size) {
                        // the time
                        this.model.setValueAt(dataset.getXValue(0, ndex), pnum, 1);

                        // the value
                        this.model.setValueAt(dataset.getYValue(0, ndex), pnum, 2);
                    }

                    // the units (key off the series name)
                    PortCounterAxisLabel label = PortCounterAxisLabel.getByName(seriesName);
                    if (label != null)
                        this.model.setValueAt(label.getUnits(), pnum, 3);
                    else
                        this.model.setValueAt(PortCounterAxisLabel.DELTA.getUnits(), pnum, 3);
                }
            }
        } else
            System.err.println("Its NULL, Jim!");
    }
}

From source file:net.sf.mzmine.modules.visualization.tic.TICPlot.java

@Override
public void chartProgress(final ChartProgressEvent event) {

    super.chartProgress(event);

    if (event.getType() == ChartProgressEvent.DRAWING_FINISHED) {

        if (visualizer instanceof TICVisualizerWindow) {

            ((TICVisualizerWindow) visualizer).updateTitle();
        }/*from  w w  w. j a  v a 2 s . c o  m*/

        if (showSpectrumRequest) {

            showSpectrumRequest = false;
            visualizer.actionPerformed(
                    new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
        }
    }
}