[CHANGE] easier painting in Figure [message #52922] |
Wed, 08 January 2003 21:59 |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
Figure.paintFigure(Graphics graphics) used to have the potential to screw up
the following calls to paintChildren(), and paintBorder().
It is now safe to do anything in paintFigure and leave the graphics in
whatever state you want (just make sure you don't leave pushed states on it,
see graphics.pushState/popState()). children will only inherit the changes
done in paint(), which by default is only BG, FG color, and Font.
requirements for paintClientArea() and paintChildren() have been changed.
The changes result in fewer calls to push and pop state on the Graphics.
It is UNLIKELY that you should be overriding these methods, but if you do,
both have been changed:
GOOD: you can call graphics.restoreState() whenever you want
within those methods to restore the graphics to its original state.
BAD: paintClientArea() must leave the Graphics in its original state. This
can be done simply by calling restoreState(). this is not done for you by
the caller (paint()) because the majority of figures are leaf figures with
no children, and calling restoreState() for them is a waste of time.
|
|
|
Powered by
FUDForum. Page generated in 0.03299 seconds