<Swing Dev> JViewport fixlet

Alexander Potochkin Alexander.Potochkin at Sun.COM
Fri Oct 12 14:09:46 UTC 2007


Hello Roman

> Ping! Any opinion on this?

Sorry for delay

This code is obsolete
I absolutely agree with you

I particularly like the comment
from this metod:

* do the song and dance to avoid allocating
* a Rectangle object

This kind of optimization is gone

We should fix it to make our code better

could you remove the comments for this code as well ?

Thanks
alexp


> 
> /Roman
> 
> Am Montag, den 24.09.2007, 12:47 +0200 schrieb Roman Kennke:
>> I just stumbled over this code in JViewport.setViewPosition():
>>
>>        if (view instanceof JComponent) {
>>            JComponent c = (JComponent)view;
>>            oldX = c.getX();
>>            oldY = c.getY();
>>        }
>>        else {
>>            Rectangle r = view.getBounds();
>>            oldX = r.x;
>>            oldY = r.y;
>>        }
>>
>> I think this special casing is not necessary anymore since JDK1.2.
>> Attached is a patch to correct this.
>>
>> Cheers, Roman
>>




More information about the swing-dev mailing list