Initialization : I had a complete
WidgetP.addChild(WidgetC) structure, and added a default
WidgetP. I override the
isHitAt method of
WidgetP such that it will return true if any of its
children.isHitAt returns true.
Problem : I tried to drag
WidgetP, but it won’t move. Hmm there must be something wrong with my code, so I switch back to Netbeans but it seems that there’s nothing wrong. So I switch back to my app and
WidgetC has been moved. Ghost. I move it again, it stands still. I zoom the
Scene out, it moves.
I tried to listen the event and put a SceneListener on my TopComponent. Indeed, no event is fired while I drag the widget.
The thing is, if I drag
WidgetC far enough to trigger the scrollbar to appear, it is rendered correctly under my cursor.
WidgetP extends LayerWidget.
Solution : Changing the declaration of superclass from
Widget solves the problem.
Lesson learned :
LayerWidget.isRepaintRequiredForRevalidating always returns false. Next time, I will remind myself not to type
extends LayerWidget and use