<AWT Dev> Please review changes in regression test /java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java
Pavel Tisnovsky
ptisnovs at redhat.com
Tue Jan 26 03:48:25 PST 2010
Hi Artem,
yes, I'm focusing to OpenJDK6, where isn't mentioned second point in
JavaDoc ("if the component is not null, but it is not showing...").
Could you please create bug# for this patch?
Thanks
Pavel
Artem Ananiev wrote:
> Hi, Pavel,
>
> the test seems to be correct - at least, in JDK7. It conforms to JavaSE
> 7 specification (Window.setLocationRelativeTo() method), which is
> slightly different than in JavaSE 6:
>
> * <li>If the component is {@code null}, or the {@code
> * GraphicsConfiguration} associated with this component is
> * {@code null}, the window is placed in the center of the
> * screen. The center point can be obtained with the {@link
> * GraphicsEnvironment#getCenterPoint
> * GraphicsEnvironment.getCenterPoint} method.
> *
> * <li>If the component is not {@code null}, but it is not
> * currently showing, the window is placed in the center of
> * the target screen defined by the {@code
> * GraphicsConfiguration} associated with this component.
> *
> * <li>If the component is not {@code null} and is shown on
> * the screen, then the window is located in such a way that
> * the center of the window coincides with the center of the
> * component.
>
> Is your change targeted to OpenJDK6? If yes, it looks fine.
>
> Thanks,
>
> Artem
>
> On 1/25/2010 7:54 PM, Pavel Tisnovsky wrote:
>> Hi,
>>
>> please review changes made in regression test
>> /java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java
>>
>> Webrev is available at
>> http://cr.openjdk.java.net/~ptisnovs/LocationRelativeToTest/
>>
>> I changed only minor part of test code utilized to check, if frame is
>> placed at the center of the screen. The test should (IMHO, of course)
>> use Point returned by GraphicsEnvironment.getCenterPoint() in this case,
>> not coordinates computed from selected GraphicsConfiguration's bound.
>>
>> According to JavaSE 6 documentation:
>> "If the component is not currently showing (*** our case ***), or c is
>> null, the window is placed at the center of the screen. The center point
>> can be determined with GraphicsEnvironment.getCenterPoint"
>>
>> Tested on:
>> Fedora 10 with multi-screen configuration (laptop screen+external LCD)
>> RHEL 5 x86_64 with virtual framebuffer
>> (this tests fails on these machines before being patched)
>>
>> Thanks in advance
>> Pavel Tisnovsky
>> Red Hat QA
>>
More information about the awt-dev
mailing list