<Swing Dev>  Review Request: 8201552 Ellipsis in "Classical" label in SwingSet2 demo with Windows L&F at Hidpi
Sergey.Bylokhov at oracle.com
Sat Jun 16 06:31:37 UTC 2018
Please review the fix for jdk11.
This fix enhance implementation of JDK-8178025 for most of our Swing
components. The main rule which I tried to follow:
"If layout of the component depends from the font then it should depend
on the current graphics configuration as well, because FontMetrics
depends on graphics configuration".
The fix for JDK-8178025 added a special property "graphicsConfiguration"
which: fired when the graphicsConfiguration is changed from one non-null
value to another non-null value.
Those fix also updated some of the components(to refresh/re-validate its
states when the "graphicsConfiguration" or "ancestor" were changed).
The usage of "ancestor" was not obvious, so I modify the code to fire
"graphicsConfiguration" every time, this cover a situation when the
"GC=null" is changed to "GC=non-null"(previously it was covered by
"ancestor" property). So after this fix our components will listen only
"font" and "graphicsConfiguration".
In implementation of JDK-8178025 the "graphicsConfiguration" is fired
immediately after GC is changed, it caused the issues in some containers
like JTree. When the container get such notification it usually tries to
get some information from children, but in this moment children had
previous graphic config, so the result calculated(and usually cached) in
the container was wrong. In this fix I changed implementation of this
property. Now it will fired only when the container and all its children
Note that the new test StalePreferredSize.java has a TODO block. Because
JSpinner does not work properly even after the current fix. The reason
is that during validation it is unexpectedly change the font from normal
to bold(I'll fix this in a separate bug)
Best regards, Sergey.
More information about the swing-dev