Small enhancement request for ChartPanel

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tdk
Posts: 19
Joined: Mon Aug 29, 2005 3:17 pm
Location: Germany
Contact:

Small enhancement request for ChartPanel

Post by tdk » Tue Feb 13, 2007 8:53 am

Folks'es,

I would like to suggest a small enhancement for the ChartPanel class:

drawing a lot of points in a chart can take some considerable time to finish (at least on my system [Sun ULTRA 25, Solaris 10]). in order to let the user know that something is happening, i want to change my cursor to a WAIT_CURSOR. and of course, when the drawing is done, i want to change it back.

thus i would like to suggest, that
- either ChartPanel.paintComponent does the above (on request)
- or that paintComponent fires some event before it returns.

as an example, how i solved it:

Code: Select all

public class MonitorGraph extends JDialog {
    :
      ChartPanel chart = new ChartPanel(initChart(), true) {
          public void paintComponent(Graphics g) {
                super.paintComponent(g)
                setTheCursor(Cursor.getDefaultCursor()); }
      };
    :
    public void show(...) {
        setTheCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
        :
    }
    :
    private void setTheCursor(Cursor aCursor) {
        firePropertyChange("cursor", null, aCursor);
        setCursor(aCursor);
    }
}
thomas

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Feb 14, 2007 12:11 pm

This sounds reasonable. I'd welcome comments from others on the best way to implement this. In the meantime, I've added a Feature Request in the database at SourceForge, so I don't forget about it:

http://sourceforge.net/tracker/index.ph ... tid=365494
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked