Posted by s_barlow
on February 9, 2009 at 6:57 AM PST
I tried to use the ZoomUI, but unfortunately encountered some serious problems concerning the (re)painting. At a first glance, everything seems to work properly and the components are zoomed dynamically according to the ZoomPort's size. But as soon as the component-structure changes (the order of the component can be changed by the user) the GUI gets totally messed up - the wrong regions of the GUI are repainted and the components (or rather parts of them) are painted at the wrong locations (After a repaint of the whole GUI the rearranged components are painted properly again, but... there is also a clock which, surprise, updates regularly - at the wrong location (in fact, the clock itself does not get updated any longer, but you can see the region where the clock tries to paint instead)). So one would think that the affine transform used by the UI got corrupted somehow - but that can't be true as there are some buttons which have a different cursor which appears at the right location. And even if the button is not visible due to the repainting-problems, the cursor still appears and the button can even be clicked - so the (inverse) transform obviously still works...
By the way: the situation even gets worse, if I use an additional glasspane above the JXLayer - that causes the strange effects to appear right from the beginning...
So... what the hell is going wrong there? Any idea?
To come to the MagnifierUI (no strange effects here, only a rather general question): I tried to implement the event-redispatching to redirect the (mouse)events to the components shown in the magnifier (as done in the ZoomUI) - but to my surprise I ended up in infinite loops as - in contradiction to the ZoomUI-example - the redirected events came back to my LayerUI again?! At the moment, I circumvent this problem by checking if the event had already been redispatched - but (as I couldn't find such a trick in the ZoomUI) is there an explanation for that?