Posted by asantiago
on December 26, 2008 at 11:13 AM PST
Hi all (and merry christmas)
I want to create a node to show Swing components. Logically I have extended the SGComponent, creating a new subclass, on which I create some JPanel and set as the content.
My problem is: I want every time the node is going to be rendered, the node itself calculates some values and translate itself.
As a first approach I have override the 'paint' method on which I calculate the new coordinates, apply it it through 'g.translate(x,y)' and then call the super.paint().
The problem with that is the node is rendered in the new coordinates but event doesn't respond. The events seems to take efect near the 0,0 coordinates.
As second try, I created some kind of SGFilter or SGTransform node which contains my SGComponent. The problem is a can't override the 'paint' method.
Anybody is in a similar situation? Any help or ideas will be appreciate.