< prev index next >

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

Print this page




  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 javax.swing.*;
  26 import java.awt.image.BufferedImage;
  27 
  28 /*
  29  * @test
  30  * @key headful
  31  * @summary Check if a per-pixel translucent window shows up with correct translucency
  32  * @author mrkam
  33  * @library ../../../../lib/testlibrary
  34  * @build Common ExtendedRobot
  35  * @run main PerPixelTranslucentCanvas
  36  * @run main/othervm -Dsun.java2d.uiScale=1.5 PerPixelTranslucentCanvas
  37  */
  38 
  39 public class PerPixelTranslucentCanvas extends Common {
  40 
  41     JPanel center;
  42     static Color OVAL_COLOR = Color.BLUE;
  43 
  44     public static void main(String[] ignored) throws Exception {
  45         FG_COLOR = new Color(200, 0, 0, 100);
  46         BG_COLOR = Color.GREEN;
  47         for (Class<Window> windowClass: WINDOWS_TO_TEST)
  48             new PerPixelTranslucentCanvas(windowClass).doTest();
  49     }
  50 
  51     public PerPixelTranslucentCanvas(Class windowClass) throws Exception {
  52         super(windowClass);
  53     }




  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 javax.swing.*;
  26 import java.awt.image.BufferedImage;
  27 
  28 /*
  29  * @test
  30  * @key headful
  31  * @summary Check if a per-pixel translucent window shows up with correct translucency
  32  * @author mrkam
  33  * @library ../../../../lib/client
  34  * @build Common ExtendedRobot
  35  * @run main PerPixelTranslucentCanvas
  36  * @run main/othervm -Dsun.java2d.uiScale=1.5 PerPixelTranslucentCanvas
  37  */
  38 
  39 public class PerPixelTranslucentCanvas extends Common {
  40 
  41     JPanel center;
  42     static Color OVAL_COLOR = Color.BLUE;
  43 
  44     public static void main(String[] ignored) throws Exception {
  45         FG_COLOR = new Color(200, 0, 0, 100);
  46         BG_COLOR = Color.GREEN;
  47         for (Class<Window> windowClass: WINDOWS_TO_TEST)
  48             new PerPixelTranslucentCanvas(windowClass).doTest();
  49     }
  50 
  51     public PerPixelTranslucentCanvas(Class windowClass) throws Exception {
  52         super(windowClass);
  53     }


< prev index next >