< prev index next >

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

Print this page




  24 import java.awt.*;
  25 
  26 /*
  27  * @test
  28  * @key headful
  29  * @summary Check if translucent window is dragged and resized
  30  *          correctly.
  31  *
  32  * Test Description: Check if TRANSLUCENT translucency type is supported
  33  *      on the current platform. Proceed if they are supported. Create
  34  *      a window and apply opacity of 0.3. Drag and resize the window
  35  *      using AWT Robot and verify that translucency is not affected.
  36  *      Make the window appear on top of a known background. Repeat this
  37  *      for Window, Dialog, Frame.
  38  * Expected Result: If TRANSLUCENT translucency type is supported, the
  39  *      window should show the background. Dragging and resizing
  40  *      shouldn't affect the translucency.
  41  *
  42  * @author mrkam
  43  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  44  * @library ../../../../lib/testlibrary
  45  * @build Common ExtendedRobot
  46  * @run main Translucent
  47  */
  48 public class Translucent extends Common {
  49 
  50     public static void main(String[] args) throws Exception {
  51         if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.TRANSLUCENT))
  52             for (Class<Window> windowClass: WINDOWS_TO_TEST){
  53                 new Translucent(windowClass).doTest();
  54             }
  55     }
  56 
  57     public Translucent(Class windowClass) throws Exception{
  58         super(windowClass, 0.3f);
  59     }
  60 
  61     @Override
  62     public void applyShape(){ }
  63 
  64     @Override




  24 import java.awt.*;
  25 
  26 /*
  27  * @test
  28  * @key headful
  29  * @summary Check if translucent window is dragged and resized
  30  *          correctly.
  31  *
  32  * Test Description: Check if TRANSLUCENT translucency type is supported
  33  *      on the current platform. Proceed if they are supported. Create
  34  *      a window and apply opacity of 0.3. Drag and resize the window
  35  *      using AWT Robot and verify that translucency is not affected.
  36  *      Make the window appear on top of a known background. Repeat this
  37  *      for Window, Dialog, Frame.
  38  * Expected Result: If TRANSLUCENT translucency type is supported, the
  39  *      window should show the background. Dragging and resizing
  40  *      shouldn't affect the translucency.
  41  *
  42  * @author mrkam
  43  * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com)
  44  * @library ../../../../lib/client
  45  * @build Common ExtendedRobot
  46  * @run main Translucent
  47  */
  48 public class Translucent extends Common {
  49 
  50     public static void main(String[] args) throws Exception {
  51         if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.TRANSLUCENT))
  52             for (Class<Window> windowClass: WINDOWS_TO_TEST){
  53                 new Translucent(windowClass).doTest();
  54             }
  55     }
  56 
  57     public Translucent(Class windowClass) throws Exception{
  58         super(windowClass, 0.3f);
  59     }
  60 
  61     @Override
  62     public void applyShape(){ }
  63 
  64     @Override


< prev index next >