getting paint notifications for offscreen components
posted 7 years ago
I'm creating a scrollpane that displays it's view using OpenGL, for ultra-smooth scrolling. To do that, it paints a large area of it's view onto an image and displays the portion that it needs. When you scroll close to the edge it paints some more, asynchronously. The scrollpane's paint() method paints to an image, and there is a separate thread that renders this image to the screen using OpenGL.
It is working beautifully, except for a few small problems.
#1: If a component that is NOT in the visible area of the scrollpane calls repaint(), then the RepaintManager thinks it's invisible and doesn't call paint() in the scrollpane. I'd like paint() to be called for ALL child component repaints, then I can determine whether they are in the cached area or not.
#2: If a component calls paintImmediately(), the scrollpane's paint does not get called. Is there an easy way to force paintImmediately to do this? If not, no worries.
#1 is the thing that's really bugging me though. Any ideas?