[8] Review request for 7124213 and 7160627 (original) (raw)

Anthony Petrov anthony.petrov at oracle.com
Wed Sep 12 05:50:18 PDT 2012


Hi Sergey,

src/macosx/classes/sun/lwawt/LWComponentPeer.java

880 * empty. In the XPeers or WPeers we use some magic constants, but here we 881 * try to use something more useful,

Why can't we use "some magic constants" here, and the constant 1 in particular? This choice may be relevant to components that display some text, but e.g. for a container component using text-based metrics doesn't look right. Also, I see that "w" was used previously, and you're changing this to "0". Perhaps "W" might work best?

src/macosx/classes/sun/lwawt/LWContainerPeer.java

43 abstract class LWContainerPeer<T extends Container, D extends JComponent> 44 extends LWCanvasPeer<T, D>

A Canvas peer implementation may be "heavier" since it can pull some graphics-related code which is unnecessary for simple containers. Do we really have to inherit from LWCanvasPeer here? Could we extract common code in a separate class and make container and canvas peers extend it instead?

-- best regards, Anthony

On 9/11/2012 9:38 PM, Sergey Bylokhov wrote:

Hi Everyone, Please review the fix for: 7124213 [macosx] pack() does ignore size of a component; doesn't on the other platforms. 7160627 [macosx] TextArea has wrong initial size

Description of main changes: All our components were split into 3 groups: - Uses getPreferedSize()/getMinimumSise from swing delegetes. - Uses its own size as a preferedSize/minimumSize. - Uses its own implementation. Notes: LWContainerPeer is subclass of LWCanvasPeer now. We can share buffers methods in LWCanvasPeer and LWWindowPeer. All magic/system constants were removed. Now we relies on default look and feel as much as possible. Bugs: http://bugs.sun.com/bugdatabase/viewbug.do?bugid=7160627 http://bugs.sun.com/bugdatabase/viewbug.do?bugid=7124213 ** Webrev can be found at: http://cr.openjdk.java.net/~serb/71242137160627/webrev.00/ -- Best regards, Sergey.



More information about the awt-dev mailing list