<AWT Dev> [PATCH] Cleanup AWT peer interfaces

Roman Kennke roman.kennke at aicas.com
Thu Sep 18 03:59:14 PDT 2008


Hi Andrei,

> Just built a fresh local repo with these changes and tried a bunch of 
> Container, Component and Window-related reg-tests. They are just fine.
> 
> 1) Just curious if the concrete peer code are supposed to be changed? 
> Looking on XTextFieldPeer we may notice something like that:
> 
>      /**
>       * DEPRECATED
>       * @see java.awt.peer.TextFieldPeer
>       */
>      public Dimension preferredSize(int cols) {
>          return getPreferredSize(cols);
>      }
> 
>      public Dimension getPreferredSize() {
>          return xtext.getPreferredSize();
>      }
> 
> With this patch applied we aren't obliged anymore to support that stuff, 
> right?

Yeah sure. I reviewed all the existing implementations and they should
not break, but a lot of stuff could be removed.

>  Along with your new toolkit it's probably doesn't matter but does 
> it look reasonable to cover that issue by some other CR? Or just add 
> into the current patch if you are real hot?

No, I'm not really hot with this :-)

>  Predict that there are a lot 
> of the code are supposed to be affected: 
> src/windows/classes/sun/awt/windows/WxyzPeer.java, etc.
> So the total number of files would be doubled. So be aware. :)

Yeah. Especially Windows, which I have no way to test.

> 2)I don't take Motif toolkit into account. You are fixing that as well, 
> - src/solaris/classes/sun/awt/motif/MComponentPeer.java.

This specific case needed to be fixed, because it was casting to
WindowPeer, only to be able to call the requestWindowFocus() method
which is not used by AWT, but only internally in the Motif toolkit. I
removed this method from WindowPeer, so we need to cast to MWindowPeer
instead, that's all.

> You'll probably be suggested by the system to ignore that patch on the 
> push stage. So be prepared.

If I ignore it, we can't build MComponentPeer anymore. Be prepared :-)

> Anyway, I'm fine with that patch. Approved.

Cheers, Roman

-- 
Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-48
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt




More information about the awt-dev mailing list