Hi all,
I'm experimenting with Java 2D and Swing, trying to figure out if and
how I can use their rich feature set in some applets. I've noticed some
strange things, so here goes; I hope someone can help answer these
questions:
(1) Why is there no "Circle" or "Oval" class implementing "Shape" ?
(2) I want to draw things on top of an image. My usual way of doing this
is to draw the image just once and then redraw it only when, say, my
window re-appears from underneath some other window. I can then draw in
XOR mode or buffer cropped regions from the original picture, to restore
it after image manipulations. For some reason, this approach does not
work when I'm coding a JComponent-derived lightweight component; the
background is cleared all the time. I've been reading about and
experimenting with setOpaque() and such, but have yet to figure out
exactly what happens. Also, when I redraw the "background image" *each
time* I want to change some tiny part of it, performance is still
reasonable (Pentium II-400); no flickering whatsoever ! Why ?
(3) I've often noticed that background AWT/2D image manipulations, e.g.
filtering, take some time and can easily be "overtaken" by newer
requests for additional drawing operations. So, the screen is not
updated the way it should, especially when repaint() requests are
flooding in as a result of rapid mouse moves. Are there any workarounds,
other then maintaining a private queue or stack of redraw operations ?
[OFF TOPIC BUT RELATED]
(4) How do you folks deal with rapid mouse clicks, moves and drags ? A
short, rapid mouseclick seems to be "overwritten" by mouse move events,
especially when the click happens while the mouse is (slightly) moving.
As a result, I find myself working with "mousePressed" - which is
confusing since "pressed" may also lead to a "drag" operation. Is there
an alternative approach ?
Hints much appreciated,
Sandor
--
ir A.G.L. Spruit - Utrecht University - mathematics & computer science
information science group
===========================================================================
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".