draw method revisited

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jcamp
Posts: 36
Joined: Thu Apr 01, 2004 4:20 pm

draw method revisited

Post by jcamp » Mon Mar 14, 2005 3:46 pm

could someone tell me WHEN and HOW the draw method of the JFreeChart class is called?

i'll go from there.

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 » Mon Mar 14, 2005 7:35 pm

It depends on the context:
  • the paintComponent() method in the ChartPanel class calls the draw() method to draw the chart on a panel;
  • the print() method in the ChartPanel class calls the draw() method to "draw" the chart on a printer;
  • the createBufferedImage() method in the JFreeChart class calls the draw() method to draw the chart on an image;
You can do the same for any output target that can supply a Graphics2D implementation (e.g. the PDFGraphics2D class from the iText library).
David Gilbert
JFreeChart Project Leader

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

Locked