Java Magazine, May/June 2018
ORACLE COM JAVAMAGAZINE MAY JUNE 2018 49 design patterns This solution continues to scale up in a predictable manner Adding another order of magnitude I am able to plot 1 million points without locking the rendering thread or having a rendering exception thrown The consumer thread on my machine tended to process points almost as fast as the producer thread could add them to the ConcurrentLinkedQueue creating a natural pattern of rendering batches as shown in Figure 2 According to the console output which was taken from the NetBeans IDE typically 1 million points could be processed and rendered in about 30 ms on my machine This means about 30 frames of animation per second which is faster than any human can discern Excellent Conclusion I have shown patterns for processing and visualizing a large number of data points using JavaFX including the JavaFX Canvas class and the Platform runLater interface However what I have really done is extend the producer consumer design pattern through a threaded implementation that also takes into account the details of a JavaFX visualization Although it was specialized for high performance this example was reduced for the sake of rapid understanding However you can use this JavaFX design pattern as a kernel around which to build better visual interfaces article Sean M Phillips @ seanmiphillips is a recently elected Java Champion and a consulting software engineer with NASA and a i solutions an aerospace industry leader that provides solutions to the USAF His specialties are data analysis and visualization using Java and JavaFX He created the Deep Space Trajectory Explorer software which won a Dukes Choice Award in 2017 and is used for trajectory design to deep space targets Figure 2 Sample output from second approach
You must have JavaScript enabled to view digital editions.