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);
}
}