< prev index next >

test/jdk/javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java

Print this page




  21  * questions.
  22  */
  23 
  24 import javax.swing.*;
  25 import java.awt.*;
  26 
  27 /*
  28  * @test
  29  * @bug 8164811
  30  * @key headful
  31  * @summary Check if a per-pixel translucent window shows only the area having
  32  *          opaque pixels
  33  * Test Description: Check if PERPIXEL_TRANSLUCENT Translucency type is supported
  34  *      on the current platform. Proceed if it is supported. Create a swing window
  35  *      with some swing components in it and a transparent background (alpha 0.0).
  36  *      Bring this window on top of a known background. Do this test for JFrame,
  37  *      JWindow and JDialog
  38  * Expected Result: Only the components present in the window must be shown. Other
  39  *      areas of the window must be transparent so that the background shows
  40  * @author mrkam
  41  * @library ../../../../lib/testlibrary
  42  * @build Common ExtendedRobot
  43  * @run main PerPixelTranslucentSwing
  44  * @run main/othervm -Dsun.java2d.uiScale=1.5 PerPixelTranslucentSwing
  45  */
  46 
  47 public class PerPixelTranslucentSwing extends Common {
  48 
  49     JButton north;
  50 
  51     public static void main(String[] ignored) throws Exception {
  52         FG_COLOR = new Color(200, 0, 0, 0);
  53         if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSLUCENT))
  54             for (Class<Window> windowClass: WINDOWS_TO_TEST)
  55                 new PerPixelTranslucentSwing(windowClass).doTest();
  56     }
  57 
  58     public PerPixelTranslucentSwing(Class windowClass) throws Exception {
  59         super(windowClass);
  60     }
  61 




  21  * questions.
  22  */
  23 
  24 import javax.swing.*;
  25 import java.awt.*;
  26 
  27 /*
  28  * @test
  29  * @bug 8164811
  30  * @key headful
  31  * @summary Check if a per-pixel translucent window shows only the area having
  32  *          opaque pixels
  33  * Test Description: Check if PERPIXEL_TRANSLUCENT Translucency type is supported
  34  *      on the current platform. Proceed if it is supported. Create a swing window
  35  *      with some swing components in it and a transparent background (alpha 0.0).
  36  *      Bring this window on top of a known background. Do this test for JFrame,
  37  *      JWindow and JDialog
  38  * Expected Result: Only the components present in the window must be shown. Other
  39  *      areas of the window must be transparent so that the background shows
  40  * @author mrkam
  41  * @library ../../../../lib/client
  42  * @build Common ExtendedRobot
  43  * @run main PerPixelTranslucentSwing
  44  * @run main/othervm -Dsun.java2d.uiScale=1.5 PerPixelTranslucentSwing
  45  */
  46 
  47 public class PerPixelTranslucentSwing extends Common {
  48 
  49     JButton north;
  50 
  51     public static void main(String[] ignored) throws Exception {
  52         FG_COLOR = new Color(200, 0, 0, 0);
  53         if (checkTranslucencyMode(GraphicsDevice.WindowTranslucency.PERPIXEL_TRANSLUCENT))
  54             for (Class<Window> windowClass: WINDOWS_TO_TEST)
  55                 new PerPixelTranslucentSwing(windowClass).doTest();
  56     }
  57 
  58     public PerPixelTranslucentSwing(Class windowClass) throws Exception {
  59         super(windowClass);
  60     }
  61 


< prev index next >