< prev index next >

test/java/awt/Window/ShapedAndTranslucentWindows/ShapedTranslucentWindowClick.java

Print this page
rev 14836 : 8159690: [TESTBUG] Mark headful tests with @key headful.
   1 /*
   2  * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.*;
  25 import java.awt.event.*;
  26 import java.awt.geom.Area;
  27 import java.awt.geom.GeneralPath;
  28 import java.awt.geom.Rectangle2D;
  29 import java.util.BitSet;
  30 
  31 /*
  32  * @test

  33  * @summary Check if a translucent shaped window trigger events correctly.
  34  *
  35  * Test Description: Check if TRANSLUCENT and PERPIXEL_TRANSPARENT traslucency
  36  *      types are supported on the current platform. Proceed if both are
  37  *      supported. Create a window with some components in it and a shape
  38  *      applied. Apply the shape such that some components are partially
  39  *      clipped. Set an opacity value less than 1. Check if the components
  40  *      behave correctly on mouse and key events. Do this test for awt Window.
  41  * Expected Result: Mouse and key events must work correctly. Only that portion
  42  *      of a component within the shape should trigger events. Key events
  43  *      should be tested for focus events and TextField/TextArea.
  44  *
  45  * @author mrkam
  46  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  47  * @library ../../../../lib/testlibrary
  48  * @build Common ExtendedRobot
  49  * @run main ShapedTranslucentWindowClick
  50  */
  51 
  52 public class ShapedTranslucentWindowClick extends Common {


   1 /*
   2  * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 import java.awt.*;
  25 import java.awt.event.*;
  26 import java.awt.geom.Area;
  27 import java.awt.geom.GeneralPath;
  28 import java.awt.geom.Rectangle2D;
  29 import java.util.BitSet;
  30 
  31 /*
  32  * @test
  33  * @key headful
  34  * @summary Check if a translucent shaped window trigger events correctly.
  35  *
  36  * Test Description: Check if TRANSLUCENT and PERPIXEL_TRANSPARENT traslucency
  37  *      types are supported on the current platform. Proceed if both are
  38  *      supported. Create a window with some components in it and a shape
  39  *      applied. Apply the shape such that some components are partially
  40  *      clipped. Set an opacity value less than 1. Check if the components
  41  *      behave correctly on mouse and key events. Do this test for awt Window.
  42  * Expected Result: Mouse and key events must work correctly. Only that portion
  43  *      of a component within the shape should trigger events. Key events
  44  *      should be tested for focus events and TextField/TextArea.
  45  *
  46  * @author mrkam
  47  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  48  * @library ../../../../lib/testlibrary
  49  * @build Common ExtendedRobot
  50  * @run main ShapedTranslucentWindowClick
  51  */
  52 
  53 public class ShapedTranslucentWindowClick extends Common {


< prev index next >