com.jrefinery.chart.demo
Class SampleXYDatasetThread
java.lang.Object
|
+--com.jrefinery.chart.demo.SampleXYDatasetThread
- All Implemented Interfaces:
- java.lang.Runnable
- public class SampleXYDatasetThread
- extends java.lang.Object
- implements java.lang.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...
- Author:
- DG
Method Summary |
void |
run()
Runs the thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SampleXYDatasetThread
public SampleXYDatasetThread(SampleXYDataset data)
- Creates a new thread.
- Parameters:
data
- the dataset.
run
public void run()
- Runs the thread.
- Specified by:
run
in interface java.lang.Runnable