There is no concept of layers in Java2D; our library is an immediate mode API.
It seems like one way to address your needs (of not redrawing all of these costly objects when only one changes) is to draw each one into its own BufferedImage (probably a BITMASK transparent one). Then composite them all in the window during drawing. When one changes, you only need to re-render that one object; the rest can simply be copied from their BufferedImage objects when repainting the window.
Chet.
kaiwen wrote:
Hi,
I just started reading on java2d and glf (Graphics Layered Framework).
I am very keen on learning glf, I hope to achieve layered graphics like those in Photoshop drawing. What I wanted is to draw each Shape in seperate Layer, and modify a particular Layer and redraw that modified Layer WITHOUT redrawing the whole canvas. Can I do this with glf?
I tried a few example from sun.com, I cannot find a method Layer.remove(Layer). Or there is another way doing this?
I used to keep all Shape drawn in a Vector and later search for the Shape I want to modify, modify it and draw the whole Vector on Canvas again. Yes, it is very slow.
What is a better way of doing this? Please advice.
Best ragards, Calvin Kuan =========================================================================== 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".