shoot427x502.png{.imagelink}

Try the demo

I eventually managed to get my custom RepaintManager to work (see first post about this). It acts as a proxy above the system’s repaint manager, and external objects may register hooks into it. These hooks define methods such as “bool hookAddDirtyRegion(…)”, that return true if the hook consumed the notification or false if it did nothing.

I made it to be shared by all the reflective containers that wish it (it receives paint requests from all the components, so it is important not to slow down everything by adding an extra proxy for each reflective container).

I updated the demo, in which you can now play movies thanks to an embedded quicktime player (as Apple provides a regular JComponent version of the movie player, and as I hook cleanly all the paint events and discard them to prevent quicktime to do direct rendering, it just… works !!!). You will need to have iTunes installed on your machine for this to work (and let’s hope that QTJava.zip is in your CLASSPATH environment variable as it should be…).

Edit [10:45]: actually not that rock solid, as I committed the development version that tries (an fails) to reuse the buffered image used to draw the intermediate image… As I did not manage to find a way to clear an image yet (using AlphaComposite.Clear and fill a solid background does not help so far), there are ugly artifacts everywhere :-S Should be fixed soon.

Edit [20:31]: it now works well, at least under MacOS X… and the video framerate it really a lot better than before : iPod-sized movies play without a glitch ! I added a slider to control the size of the reflection : when it reaches zero, the video is drawn directly by the quicktime component (same for the fake login components). Click and double-click on the video to pause / resume it.