jdk/test/java/awt/Mixing/OpaqueTest.java
changeset 43724 a272f9475e44
parent 39056 d99e63b6d962
equal deleted inserted replaced
43723:f7a55f9b9bf5 43724:a272f9475e44
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25   @test
    25   @test
    26   @key headful
    26   @key headful
    27   @bug 4811096
    27   @bug 4811096 8173409
    28   @summary Tests whether opaque and non-opaque components mix correctly
    28   @summary Tests whether opaque and non-opaque components mix correctly
    29   @author anthony.petrov@...: area=awt.mixing
    29   @author anthony.petrov@...: area=awt.mixing
    30   @library ../regtesthelpers
    30   @library ../regtesthelpers
    31   @modules java.desktop/com.sun.awt
       
    32   @build Util
    31   @build Util
    33   @run main OpaqueTest
    32   @run main OpaqueTest
    34 */
    33 */
    35 
    34 
    36 
    35 
    42 
    41 
    43 import java.awt.*;
    42 import java.awt.*;
    44 import java.awt.event.*;
    43 import java.awt.event.*;
    45 import javax.swing.*;
    44 import javax.swing.*;
    46 import test.java.awt.regtesthelpers.Util;
    45 import test.java.awt.regtesthelpers.Util;
    47 import com.sun.awt.AWTUtilities;
       
    48 
    46 
    49 
    47 
    50 
    48 
    51 public class OpaqueTest
    49 public class OpaqueTest
    52 {
    50 {
   123         // Now perform the click at this point for 9 times
   121         // Now perform the click at this point for 9 times
   124         // In the middle of the process toggle the opaque
   122         // In the middle of the process toggle the opaque
   125         // flag value.
   123         // flag value.
   126         for (int i = 0; i < 9; ++i) {
   124         for (int i = 0; i < 9; ++i) {
   127             if (i == 3) {
   125             if (i == 3) {
   128                 AWTUtilities.setComponentMixingCutoutShape(light,
   126                 light.setMixingCutoutShape(new Rectangle());
   129                         new Rectangle());
       
   130             }
   127             }
   131             if (i == 6) {
   128             if (i == 6) {
   132                 AWTUtilities.setComponentMixingCutoutShape(light,
   129                 light.setMixingCutoutShape(null);
   133                         null);
       
   134             }
   130             }
   135 
   131 
   136             robot.mousePress(InputEvent.BUTTON1_MASK);
   132             robot.mousePress(InputEvent.BUTTON1_MASK);
   137             robot.mouseRelease(InputEvent.BUTTON1_MASK);
   133             robot.mouseRelease(InputEvent.BUTTON1_MASK);
   138             Util.waitForIdle(robot);
   134             Util.waitForIdle(robot);