You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Alexey A. Ivanov (JIRA)" <ji...@apache.org> on 2006/11/17 14:03:39 UTC

[jira] Updated: (HARMONY-1801) [classlib][swing] JComponent.setBounds() should not cause revalidation

     [ http://issues.apache.org/jira/browse/HARMONY-1801?page=all ]

Alexey A. Ivanov updated HARMONY-1801:
--------------------------------------

    Attachment: H1801-tests.patch

Mikhail,
Try the new regression tests. It is explicitly checked that revalidate() is not called. I've also added a test case to JInternalFrameTest, since JInternalFrame code is modified.

Both tests fail without fix and pass successfully with the fix. (The tests pass when run against RI.)

The problem with original test, as I see it, is that re-layout might be in progress when comp.getSize is called, thus comp still has the size unchanged.

> [classlib][swing] JComponent.setBounds() should not cause revalidation
> ----------------------------------------------------------------------
>
>                 Key: HARMONY-1801
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1801
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Dmitry A. Durnev
>         Assigned To: Mikhail Loenko
>            Priority: Minor
>         Attachments: H1801-BasicTabbedPaneUI.patch, H1801-fix.patch, H1801-tests.patch, H1801-tests.patch
>
>
> Validation process should not be initiated by component reshaping to avoid too
> many re-validations while doing layout (layout usually causes reshape).
> Therefore JComponent.setBounds() should not call revalidate. 
> Compile & run the following test:
> import java.awt.EventQueue;
> import java.lang.reflect.InvocationTargetException;
> import javax.swing.JButton;
> import javax.swing.JFrame;
> public class SetBoundsTest {
>     
>     public static void main(String[] args) throws InterruptedException, InvocationTargetException {
>         final JFrame jf = new JFrame("test");
>         final JButton jb = new JButton("1");        
>         jf.getContentPane().add(jb);
>         jf.setSize(200, 200);
>         EventQueue.invokeAndWait(new Runnable(){
>             public void run() {
>                 jf.show();                
>             }
>             
>         });
>         EventQueue.invokeAndWait(new Runnable(){
>             public void run() {
>                 jb.setSize(150, 500);                
>             }
>             
>         });
>         
>         EventQueue.invokeAndWait(new Runnable(){
>             public void run() {
>                 System.out.println(jb.getSize());
>                 jf.dispose();           
>             }
>             
>         });
>         
>     }
> }
> On RI button size set by user(150, 500) is printed. On Harmony some other size (set by layout) is printed.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira