When writing UI objects I love layers. I use them all the time. They make drawing so much more efficient while preserving the beauty of vectorized graphic (they start to pixelate only at really high zoom ratios) However there's one thing I just cannot do with layers that bothers me, and that is clipping the graphic context. For instance, the look of Max 6 is all about rounded corners all over the place, right? Well, in a complex UI object an obvious strategy would be to do all the drawing in a layer and then clip the layer itself to those nice and smooth rounded corners, but with JGraphics that doesn't seem to be possible. Sure, I could draw into a jsurface and then clip that but then I would lose all the benefits of vector graphics because surfaces are like bitmap images and as soon as zoomed they will pixelate.
So, to summarize I would like to achieve the following:
1 - For efficiency, use layers' validation/invalidation scheme to allow graphics to be redrawn only when its content changes.
2 - Keep the nice properties of antialiased vector graphics which will allow the graphics to be zoomed in and out without incurring in pixelation artifacts.
3 - Be able to clip layers or graphic context to a shape other than rectangular.
In Max 6 with the JGraphics API is it possible to achieve all of the above?