Smooth image refresh

I have an app that displays a chart using JFreeChartWrapper. I have a background thread that collects data from a remote system and generates a rolling chart similar to JConsole. For now, I use the ProgressIndicator to trigger the client refresh.

My problem is that the chart image refresh is very obvious. The rest of the window contains tables that refresh transparently.

Is there a way I can do a smoother refresh? I was looking for a way to use two images as a double buffer and css to toggle between them. Is there a GWT widget that does something like this?

Would it help to create your custom component with a fixed pixel size, then first put the progressbar in the custom component with setSizeFull and replace that with the generated image?

Hi!

I’m not sure about your requirements and environment, but unless you are working with a very good network and fast servers the JFreeChartWrapper is not the way to go for you (if you want it to be real smooth).

You’ll need a custom component using Canvas, SVG or Flash that updates the graphic state on client side and transfers just the latest data over network.

cheers,
matti

Matt,

Thanks for the reply! I realized that JFreeChartWrapper wasn’t suited for a dynamic chart.

I wrote a simple chart wrapper of my own with a refresh method that rebuilds the chart, updates the imageresource filename and does a requestRepaint. I call the refresh periodically (2 to 5 seconds), and I get a nice, smooth, rolling chart similar to jconsole. I’m happy.

Allen

There is also a lazy loading widget wrapper in TPT package. See
http://vaadin.com/forum/-/message_boards/message/96056
for more info and a demo.