Request for review: 7124530 What is background color of AWT component? (And foreground, for that matter)

Alexander Potochkin Alexander.Potochkin at oracle.com
Thu Dec 29 10:32:34 PST 2011


Hello Sergey



> Hi Everyone,
> This is a fix for some glitches in the code for 
> background/foreground/font properties.
> 1. SystemColor.window was changed to color which is used by default in 
> swing l&f(Aqua). Changes in AquaImageFactory.java and CSystemColors.m. 
> Now most of the awt components use this color as default.
> 2. set** methods were moved from LWWindowPeer to LWComponentPeer, 
> because there is an issues when these methods has no effect, because 
> repaint of the component does not happen.For example:
>  - call Label.setbackground which set component background property
>  - call Peer.setBackground
>  - call Delegate.setBackgound
>  - compare passed color with color from Label property, which was set 
> in the first step: changes in 
> LWWindowPeer,LWContainerPeer,LWComponentPeer.
could you give more details on that?

the pattern where every peer has its delegate which is responsible for 
storing/repainting for colors and fonts
looks more laconic and consistent to me.

> 3. List default color was changed to SystemColor.text: changes in 
> LWListPeer.java.

LWListPeer set the font and colors to its view component,
with the proposed fix it seems to update the scrollPane instead


> 4. LWWIndow target color initialization was moved from CPlatformIndow 
> to LWWindowPeer, so it can be reused later by CPlatformEmbeddedFrame .
> 5. unnecessary peers set** methods and unnecessary delegate in 
> LWCanvasPeer were removed: changes in LWCanvasPeer.java, 
> LWListPeer.java, LWPanelPeer.java.
>
> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7124530
> Webrev can be found at: 
> http://cr.openjdk.java.net/~serb/7124530/webrev.00/
>

Thanks
alexp


More information about the macosx-port-dev mailing list