[EMAIL PROTECTED] (Michael R3 Reutter) writes:
> I'm using ptplot5.1p2 and want to create images for my servlets (using > tomcat 3.3.1 and a png- or jpegEncoderclass) ! > > the problem: > the image should show the title, the named axes and the graph, but > sometimes, parts are missing (sometimes the title is missing, > sometimes the graph ...)! If I put something like a waiting loop > > try { > Thread.sleep(5000); > }catch (Exception e){} > > after the repaint(), the results are MUCH better (this behaviour does > more often occur on a faster machine!!!) > > what's happening - is there a method to check, whether the image is > ready or not??? > > any ideas??? > any help VERY appreciated!!! > thanks michi > > Here the code I use for testing in my servlet: > > [...] > Plot p = new Plot(); > p.clear(true); > p.setTitle("T I T L E : " + counter); > p.setXLabel("XLabel"); > p.setYLabel("YLabel"); > p.setButtons(true); > p.addLegend(0, "Legend1"); > boolean first = true; > for (int a = -1 ; a <= counter; a++){ > p.addPoint(0, a, a*a, !first); > first = false; > } > p.validate(); > p.repaint(); > java.awt.image.BufferedImage image = p.exportImage(); You could try pulling the classes out of the Ptolemy II 2.0-beta release tree and using those, but I'm not sure if there is a change that particularly addresses the issue you are having. Below are the changes: --start-- The changes between ptplot5.1p3 and ptplot5.2 * David French: added removeLegend() * John Olmstead, Edward A. Lee: rotate Y axis label * Christopher Hylands: Use .plt and .xml as default extensions when opening or saving as, use plot.xml as a default name * Roger Schwenke, Christopher Hylands: Add better documentation about how to use Log axes. * Alberto Gobbi, Christopher Hylands: Fix for <dataset name= ... connected=...> to PlotMLParser.java The changes between ptplot5.1p2 and ptplot5.1p3 * Ross Beyer: Problems with Solaris installation. * Laurent Etur: Scale the printout to fit the page --end-- We don't have a servlet set up locally, so I can't directly test your set up. Alberto Gobbi contributed some servlet code, which we have not tested, but you can find at http://ptolemy.eecs.berkeley.edu/java/ptplot/ptolemy-plot-servlet.tar.gz [EMAIL PROTECTED] (Michael R3 Reutter) writes: > Because of the problems I have with ptplot (see my other posting): > Does anyone of you know another 2D-plot-java-package??? I don't know of anything else out there for servlets, but I'm sure that there must be something. -Christopher Christopher Hylands [EMAIL PROTECTED] University of California Ptolemy/Gigascale Silicon Research Center US Mail: 558 Cory Hall #1770 ph: (510)643-9841 fax:(510)642-2739 Berkeley, CA 94720-1770 home: (510)526-4010, (707)665-0131 (office: 400A Cory) ---------------------------------------------------------------------------- Posted to the ptolemy-hackers mailing list. Please send administrative mail for this list to: [EMAIL PROTECTED]