Class SampleXYDatasetThread

java.lang.Object
org.jfree.chart.demo.SampleXYDatasetThread
All Implemented Interfaces:
Runnable

public class SampleXYDatasetThread
extends Object
implements Runnable
Implements the runnable interface and updates the SampleXYDataset. This gives the event notification mechanism in JFreeChart a run to make sure it works. WARNING 1 : There are likely to be problems with accessing datasets from more than one thread, so don't use this code for anything other than the demo!

WARNING 2 : Updating the dataset this way 'animates' the chart - but JFreeChart is not designed for the production of animated charts. For fast animations, you need a chart that draws to a bitmap, in order to optimise the screen updates. But JFreeChart draws to an abstract drawing surface (Graphics2D), which brings many benefits, but also means that we cannot implement any performance tricks when the screen updates because we cannot guarantee which pixels are rendered by the Graphics2D pipeline...

  • Constructor Details

    • SampleXYDatasetThread

      public SampleXYDatasetThread​(SampleXYDataset data)
      Creates a new thread.
      Parameters:
      data - the dataset.
  • Method Details

    • run

      public void run()
      Runs the thread.
      Specified by:
      run in interface Runnable