Actually widgets extends TransformGroup, which is a bad thing, because a widget isn’t a sort of TransformGroup. Instead it uses a TransformGroup to be displayed.
So instead of :
WidgetBase extends TransformGroup
we should have :
WidgetBase {
TransformGroup tg
public void addChild(Node node) {
//...
Which would permit us to add an invisible yet rendered plane (TransparencyAttributes, alpha test function = NEVER) used only for stencil test (stencil function = ALWAYS) and when adding child to a component, setting the stencil function of all children to EQUALS.
I’m afraid I am not clear at all but I think it would permit to clip widgets so they display only in their allocated zone.
(See the StencilTest to see what I’m talking about).
If there’s no objection I’m gonna implement that. But I didn’t used Stencil Buffer before and maybe some of you can point out possible issues with this technique, or simpler methods to do clipping.