Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
The HW/LW Mixing feature depends on having the whole component hierarchy valid. However Swing's revalidate() methods stops validation on the nearest validateRoot which may easily leave the toplevel window invalid. That in turn leads to the mixing feature to work incorrectly - we do not recalculate shapes for invalid containers since their children may have invalid bounds. One could suggest the user application to call the validate() on the top-level, but this is not the best solution as well. See the following justification: ******************************************************************************* > You aren't the only one. The hw/lw mixing is a new feature, and it also > brings some new requirements to work correctly. The main requirement is that > the whole component hierarchy must be valid. Otherwise the mixing may not > correctly do its job. So I suggest you to replace the panel.revalidate() > call with the <the-toplevel-window>.validate() call instead. This will fix > the issue. Wouldn't it be better if revalidate was validating the full hierarchy when a sub component is heavyweight? It could do its normal job and post a runnable to validate the window ancestor in such a case. Otherwise every time one does a revalidate, they have to know what they embed to perform the right validation. This is not very possible when you don't know what you embed (library integration for example). As a matter of fact, I don't know myself if the component hierarchy I am adding contains a native component: my program shows native stuff and some non native stuff depending on the selection on the tree that is located on the left side of the split pane. ******************************************************************************* Since the AWT code always knows whether we do mixing or not, the Swing's revalidate() method may have the following logic: 1. If the mixing is taking place, it can find the toplevel ancestor of the container and call its validate() method. 2. Otherwise it must fall back to the current mechanism involving the validateRoots. To identify if the mixing is active, one could introduce the sun.awt.AWTAccessor.ComponentAccessor.isMixingNeeded() method that would call the corresponding private method in the java.awt.Component class.
|