Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RepaintManager V. UI Delegate

 
Landon Blake
Ranch Hand
Posts: 121
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a little confused about the role of the repaint manager and UI delegate in painting Swing Components. It seems like they might do some of the same tasks. Which one handles a call that results in the painting or repainting of a Swing component? Does the UI dlegate recieve the call initially and pass the look and feel information to the repaint manager, or is it the other way around. I looked at the API's and read the article "Painting in AWT and Swing" but I'm still a little confused.
Thanks for any help,
Landon
[ March 05, 2004: Message edited by: Landon Blake ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RepaintManager handles the overall mechanics of repainting... how often it should be done, keeping track of "dirty" areas, etc. UI Delegates specify the look and feel of the specific component.
 
Jose Botella
Ranch Hand
Posts: 2120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

RepaintManager exists for two purposes: to provide efficient revalidation and repainting. It intercepts all repaint() and revalidate() requests. This class also handles all double-buffering in Swing and maintains a single Image used for this purpose. This Image�s maximum size is, by default, the size of the screen. However, we can set its size manually using RepaintManager�s setDoubleBufferMaximumSize() method.

This is from the excellent book Swing by Robinson and Vorobiev. Read more here
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic