I have a similar application doing layout drawing for
an integrated circuit.  One thing you may consider is
trying out different JDK's.  The Sun JDK really isn't
always the best for drawing speed. I have a benchmark
test designed to "stress-test" the drawing speed.
The times I get per JDK can vary significantly.  One
test for example showed these results:

Sun 1.4.2               173 seconds
Blackdown 1.4.2 119
IBM 1.4.2               95
Sun 1.5.0               90

These are all Linux JDK's.  The benchmark draws a
series of circles with anti-aliasing, a semitransparent
fill pattern, and stroke set to 3 pixels.

The Sun 1.5 JDK seems the obvious choice, but I
found to my dismay that the mouse events are
being handled differently. If I press the mouse
button, drag, then release, the 1.4 JDK's all
register mouse press, move, and release events.
The Sun 1.5 JDK adds an extra mouse click to those
events.  Very annoying.  I don't have the time
to fool with it yet, so I haven't gone to
the Sun 1.5 JDK yet.

The IBM JDK would seem like the next choice, but
I found that I eventually get thread deadlock when I draw
to an offscreen buffer and blit it to the screen.
Don't know why.  So I've gone back to the slow
Sun JDK for now.

My suggestion is that you make a benchmark tuned
to your kind of drawing, then try these different
JVM's and see how it works for you.

Dan


-----Original Message-----
From: Discussion list for Java 2D API [mailto:[EMAIL PROTECTED]
On Behalf Of David Kavanagh
Sent: Tuesday, February 01, 2005 8:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [JAVA2D] Sluggish window refreshes since 1.4ish

In general terms, I'd say this;
- Draw in to an offscreen buffer
- your paint() method should simply blit the buffer to the screen
- issue repaint() after each draw you do and let awt handle the updating of
the
screen. It will collapse multipe repaint requests if they are too frequent.
(from what I remember)

hope this helps.

David

Quoting James Carroll <[EMAIL PROTECTED]>:

> Hello,
>
>
>
> I'm doing lots of drawing in my java app.  I respond to mouse events and
> draw polygons, and I'm doing the drawing over an image, so I have some
> off-screen double-buffering going on.
>
>
>
> My drawing used to be really snappy, but with recent versions of the
> java VM, I'm lucky if it responds to about four mousemoves a second.
>
>
>
> At one point my guess is that I was sending too many Refresh (redraw)
> messages, and the AWT was waiting for the steam of redraws to stop for a
> second before it responded to the last one, so I would pace my redraw
> commands so that I would only request about 10 per second, and for a
> while that seemed to help.  Now in Java 1.5, I'm down to about two
> refreshes per second.
>
>
>
> How can I control this mechanism that's combining redraw events and
> adding these pauses?
>
>
>
> Thanks!
>
> -Jim
>
>
>
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA2D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to