< prev index next >

test/javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java

Print this page


   1 /*
   2  * Copyright (c) 2013, 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.Rectangle;
  25 import java.awt.Robot;
  26 import java.awt.Toolkit;
  27 import java.awt.image.BufferedImage;
  28 
  29 import javax.swing.JFrame;
  30 import javax.swing.SwingUtilities;
  31 
  32 import sun.awt.OSInfo;
  33 import sun.awt.SunToolkit;
  34 
  35 /**
  36  * @test

  37  * @bug 7124513
  38  * @summary We should support NSTexturedBackgroundWindowMask style on OSX.
  39  * @author Sergey Bylokhov
  40  */

  41 public final class NSTexturedJFrame {
  42 
  43     private static final String BRUSH = "apple.awt.brushMetalLook";
  44     private static final String STYLE = "Window.style";
  45     private static final BufferedImage[] images = new BufferedImage[3];
  46     private static Rectangle bounds;
  47     private static volatile int step;
  48     private static JFrame frame;
  49 
  50     public static void main(final String[] args) throws Exception {
  51         if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
  52             System.out.println("This test is for OSX, considered passed.");
  53             return;
  54         }
  55         // Default window appearance
  56         showFrame();
  57         step++;
  58         // apple.awt.brushMetalLook appearance
  59         showFrame();
  60         step++;


   1 /*
   2  * Copyright (c) 2013, 2017, 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.Rectangle;
  25 import java.awt.Robot;
  26 import java.awt.Toolkit;
  27 import java.awt.image.BufferedImage;
  28 
  29 import javax.swing.JFrame;
  30 import javax.swing.SwingUtilities;
  31 
  32 import sun.awt.OSInfo;
  33 import sun.awt.SunToolkit;
  34 
  35 /**
  36  * @test
  37  * @key headful
  38  * @bug 7124513
  39  * @summary We should support NSTexturedBackgroundWindowMask style on OSX.
  40  * @author Sergey Bylokhov
  41  */
  42 
  43 public final class NSTexturedJFrame {
  44 
  45     private static final String BRUSH = "apple.awt.brushMetalLook";
  46     private static final String STYLE = "Window.style";
  47     private static final BufferedImage[] images = new BufferedImage[3];
  48     private static Rectangle bounds;
  49     private static volatile int step;
  50     private static JFrame frame;
  51 
  52     public static void main(final String[] args) throws Exception {
  53         if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
  54             System.out.println("This test is for OSX, considered passed.");
  55             return;
  56         }
  57         // Default window appearance
  58         showFrame();
  59         step++;
  60         // apple.awt.brushMetalLook appearance
  61         showFrame();
  62         step++;


< prev index next >