Java Code Examples for org.jfree.chart.event.ChartProgressEvent#getType()

The following examples show how to use org.jfree.chart.event.ChartProgressEvent#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TICPlot.java    From mzmine2 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void chartProgress(final ChartProgressEvent event) {

  super.chartProgress(event);

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

    if (visualizer instanceof TICVisualizerWindow) {

      ((TICVisualizerWindow) visualizer).updateTitle();
    }

    if (showSpectrumRequest) {

      showSpectrumRequest = false;
      visualizer.actionPerformed(
          new ActionEvent(event.getSource(), ActionEvent.ACTION_PERFORMED, "SHOW_SPECTRUM"));
    }
  }
}
 
Example 2
Source File: ProductIonFilterPlot.java    From mzmine2 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 */
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"));
    }
  }

}
 
Example 3
Source File: NeutralLossPlot.java    From mzmine2 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 */
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"));
    }
  }

}
 
Example 4
Source File: GrammarvizChartPanel.java    From grammarviz2_src with GNU General Public License v2.0 6 votes vote down vote up
public void chartProgress(ChartProgressEvent chartprogressevent) {

    if (chartprogressevent.getType() != 2)
      return;

    XYPlot xyplot = (XYPlot) chart.getPlot();

    double pos = xyplot.getDomainCrosshairValue();

    // this is needed because the call of highlightPatternInChart triggers a ChartProgessEvent
    if (previousClickPosition == pos) {
      return;
    }

    // SAXString sax = new SAXString(this.session.chartData.getFreqData(), " ");
    // String rule = sax.getRuleFromPosition(this.session.chartData, (int) pos);
    // if (rule != null) {
    // firePropertyChange(SequiturMessage.MAIN_CHART_CLICKED_MESSAGE, "", rule);
    // System.out.println("Clicked Property Change fired with rule: " + rule);
    // }

    previousClickPosition = pos;
  }
 
Example 5
Source File: ScatterPlotChart.java    From mzmine3 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 */
// @Override
public void chartProgress(ChartProgressEvent 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);
  }
}
 
Example 6
Source File: ScatterPlotChart.java    From mzmine2 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @see org.jfree.chart.event.ChartProgressListener#chartProgress(org.jfree.chart.event.ChartProgressEvent)
 */
@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);
  }
}
 
Example 7
Source File: ChartJFreeChartOutput.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void chartProgress(final ChartProgressEvent event) {
	ready = event.getType() == ChartProgressEvent.DRAWING_FINISHED;
}