< prev index next >

test/jdk/java/awt/Window/ShapedAndTranslucentWindows/FocusAWTTest.java

Print this page




  33 /*
  34  * @test
  35  * @key headful
  36  * @bug 8013450
  37  * @summary Check if the window events (Focus and Activation) are triggered correctly
  38  *          when clicked on visible and clipped areas.
  39  *
  40  * Test Description: Check if PERPIXEL_TRANSPARENT Translucency type is supported
  41  *      by the current platform. Proceed if it is supported. Apply different
  42  *      types of shapes on a Window. Make it appear with a known background.
  43  *      Check if mouse events which result in window-activated events are
  44  *      triggered only within the window's shape and not outside. Repeat this
  45  *      for Window, Dialog and Frame.
  46  * Expected Result: If PERPIXEL_TRANSPARENT Translucency type is supported, window should
  47  *      gain focus and should trigger activated events only when it is clicked on the
  48  *      visible areas. Events should be delivered to the background window if clicked
  49  *      on the clipped areas.
  50  *
  51  * @author mrkam
  52  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  53  * @library ../../../../lib/testlibrary
  54  * @build Common ExtendedRobot
  55  * @run main FocusAWTTest
  56  */
  57 
  58 public class FocusAWTTest extends Common {
  59 
  60     ExtendedRobot robot;
  61     int dx;
  62     int dy;
  63     static final int x = 20;
  64     static final int y = 400;
  65 
  66     static volatile HashMap<String, Boolean> flags = new HashMap<String, Boolean>();
  67     static {
  68         flags.put("backgroundWindowActivated", false);
  69         flags.put("backgroundWindowDeactivated", false);
  70         flags.put("backgroundWindowGotFocus", false);
  71         flags.put("backgroundWindowLostFocus", false);
  72         flags.put("foregroundWindowGotFocus", false);
  73         flags.put("foregroundWindowLostFocus", false);




  33 /*
  34  * @test
  35  * @key headful
  36  * @bug 8013450
  37  * @summary Check if the window events (Focus and Activation) are triggered correctly
  38  *          when clicked on visible and clipped areas.
  39  *
  40  * Test Description: Check if PERPIXEL_TRANSPARENT Translucency type is supported
  41  *      by the current platform. Proceed if it is supported. Apply different
  42  *      types of shapes on a Window. Make it appear with a known background.
  43  *      Check if mouse events which result in window-activated events are
  44  *      triggered only within the window's shape and not outside. Repeat this
  45  *      for Window, Dialog and Frame.
  46  * Expected Result: If PERPIXEL_TRANSPARENT Translucency type is supported, window should
  47  *      gain focus and should trigger activated events only when it is clicked on the
  48  *      visible areas. Events should be delivered to the background window if clicked
  49  *      on the clipped areas.
  50  *
  51  * @author mrkam
  52  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  53  * @library ../../../../lib/client
  54  * @build Common ExtendedRobot
  55  * @run main FocusAWTTest
  56  */
  57 
  58 public class FocusAWTTest extends Common {
  59 
  60     ExtendedRobot robot;
  61     int dx;
  62     int dy;
  63     static final int x = 20;
  64     static final int y = 400;
  65 
  66     static volatile HashMap<String, Boolean> flags = new HashMap<String, Boolean>();
  67     static {
  68         flags.put("backgroundWindowActivated", false);
  69         flags.put("backgroundWindowDeactivated", false);
  70         flags.put("backgroundWindowGotFocus", false);
  71         flags.put("backgroundWindowLostFocus", false);
  72         flags.put("foregroundWindowGotFocus", false);
  73         flags.put("foregroundWindowLostFocus", false);


< prev index next >