--- old/make/common/Modules.gmk 2017-01-27 10:19:44.582540183 -0800 +++ new/make/common/Modules.gmk 2017-01-27 10:19:44.518540183 -0800 @@ -105,7 +105,6 @@ jdk.charsets \ jdk.crypto.ec \ jdk.crypto.cryptoki \ - jdk.desktop \ jdk.dynalink \ jdk.jsobject \ jdk.localedata \ --- old/jdk/src/java.desktop/share/classes/java/awt/Component.java 2017-01-27 10:19:44.962540181 -0800 +++ new/jdk/src/java.desktop/share/classes/java/awt/Component.java 2017-01-27 10:19:44.802540182 -0800 @@ -10379,7 +10379,11 @@ } /** - * Sets a 'mixing-cutout' shape for the given component. + * Sets a 'mixing-cutout' shape for this lightweight component. + * + * This method is used exclusively for the purposes of the + * Heavyweight/Lightweight Components Mixing feature and will + * have no effect if applied to a heavyweight component. * * By default a lightweight component is treated as an opaque rectangle for * the purposes of the Heavyweight/Lightweight Components Mixing feature. @@ -10392,7 +10396,7 @@ *
  • {@code null} - reverts the default cutout shape (the rectangle equal * to the component's {@code getBounds()}) *
  • empty-shape - does not cut out anything from heavyweight - * components. This makes the given lightweight component effectively + * components. This makes this lightweight component effectively * transparent. Note that descendants of the lightweight component still * affect the shapes of heavyweight components. An example of an * empty-shape is {@code new Rectangle()}. @@ -10406,16 +10410,11 @@ * for the given glass pane component. If a developer needs some other * 'mixing-cutout' shape for the glass pane (which is rare), this must be * changed manually after installing the glass pane to the root pane. - *

    - * Note that the 'mixing-cutout' shape neither affects painting, nor the - * mouse events handling for the given component. It is used exclusively - * for the purposes of the Heavyweight/Lightweight Components Mixing - * feature. * * @param shape the new 'mixing-cutout' shape * @since 9 */ - void setMixingCutoutShape(Shape shape) { + public void setMixingCutoutShape(Shape shape) { Region region = shape == null ? null : Region.getInstance(shape, null); synchronized (getTreeLock()) { --- old/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java 2017-01-27 10:19:45.326540180 -0800 +++ new/jdk/src/java.desktop/share/classes/javax/swing/JLayer.java 2017-01-27 10:19:45.210540180 -0800 @@ -286,8 +286,7 @@ super.remove(oldGlassPane); } if (glassPane != null) { - AWTAccessor.getComponentAccessor().setMixingCutoutShape(glassPane, - new Rectangle()); + glassPane.setMixingCutoutShape(new Rectangle()); glassPane.setVisible(isGlassPaneVisible); super.addImpl(glassPane, null, 0); } --- old/jdk/src/java.desktop/share/classes/javax/swing/JRootPane.java 2017-01-27 10:19:45.698540179 -0800 +++ new/jdk/src/java.desktop/share/classes/javax/swing/JRootPane.java 2017-01-27 10:19:45.570540179 -0800 @@ -663,8 +663,7 @@ throw new NullPointerException("glassPane cannot be set to null."); } - AWTAccessor.getComponentAccessor().setMixingCutoutShape(glass, - new Rectangle()); + glass.setMixingCutoutShape(new Rectangle()); boolean visible = false; if (glassPane != null && glassPane.getParent() == this) { --- old/jdk/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java 2017-01-27 10:19:46.090540177 -0800 +++ new/jdk/src/java.desktop/share/classes/com/sun/awt/AWTUtilities.java 2017-01-27 10:19:45.938540178 -0800 @@ -456,8 +456,7 @@ "The component argument should not be null."); } - AWTAccessor.getComponentAccessor().setMixingCutoutShape(component, - shape); + component.setMixingCutoutShape(shape); } } --- old/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java 2017-01-27 10:19:46.430540176 -0800 +++ new/jdk/src/java.desktop/share/classes/sun/awt/AWTAccessor.java 2017-01-27 10:19:46.286540176 -0800 @@ -93,12 +93,6 @@ * its parent. */ Rectangle getBounds(Component comp); - /* - * Sets the shape of a lw component to cut out from hw components. - * - * See 6797587, 6776743, 6768307, and 6768332 for details - */ - void setMixingCutoutShape(Component comp, Shape shape); /** * Sets GraphicsConfiguration value for the component. --- old/jdk/src/java.desktop/share/classes/module-info.java 2017-01-27 10:19:46.790540175 -0800 +++ new/jdk/src/java.desktop/share/classes/module-info.java 2017-01-27 10:19:46.638540175 -0800 @@ -88,9 +88,6 @@ exports sun.awt to jdk.accessibility; - exports com.sun.awt to - jdk.desktop; - opens javax.swing.plaf.basic to jdk.jconsole; opens com.sun.java.swing.plaf.windows to --- old/jdk/src/jdk.desktop/share/classes/jdk/awt/AWTUtils.java 2017-01-27 10:19:47.178540173 -0800 +++ /dev/null 2016-11-01 09:38:44.965684815 -0700 @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package jdk.awt; - -import java.awt.Component; -import java.awt.Shape; - -import com.sun.awt.AWTUtilities; - -/** - * A class to allow access to JDK-specific utility methods. - * Methods in this class are always deprecated since a caller - * should be aware they may be removed and replaced in the future. - * Access using reflection is highly recommended. - * @since 9 - */ -public final class AWTUtils { - - /** - * No-one should be creating instances of this class. - */ - private AWTUtils() { - } - - /** - * Sets a 'mixing-cutout' shape for the given component. - * - * By default a lightweight component is treated as an opaque rectangle for - * the purposes of the Heavyweight/Lightweight Components Mixing feature. - * This method enables developers to set an arbitrary shape to be cut out - * from heavyweight components positioned underneath the lightweight - * component in the z-order. - *

    - * The {@code shape} argument may have the following values: - *

    - *

    - * The most common example when the 'mixing-cutout' shape is needed is a - * glass pane component. The {@link JRootPane#setGlassPane()} method - * automatically sets the empty-shape as the 'mixing-cutout' shape - * for the given glass pane component. If a developer needs some other - * 'mixing-cutout' shape for the glass pane (which is rare), this must be - * changed manually after installing the glass pane to the root pane. - *

    - * Note that the 'mixing-cutout' shape neither affects painting, nor the - * mouse events handling for the given component. It is used exclusively - * for the purposes of the Heavyweight/Lightweight Components Mixing - * feature. - * - * @param component the component that needs non-default - * 'mixing-cutout' shape - * @param shape the new 'mixing-cutout' shape - * @throws NullPointerException if the component argument is {@code null} - * @deprecated This API may be removed or replaced. - */ - @Deprecated - @SuppressWarnings("deprecation") - public static void setComponentMixingCutoutShape(Component component, - Shape shape) { - - AWTUtilities.setComponentMixingCutoutShape(component, shape); - } -} --- old/jdk/src/jdk.desktop/share/classes/module-info.java 2017-01-27 10:19:47.426540172 -0800 +++ /dev/null 2016-11-01 09:38:44.965684815 -0700 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * Provides non-SE desktop APIs. - */ - -module jdk.desktop { - requires transitive java.desktop; - - exports jdk.awt; -} --- old/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java 2017-01-27 10:19:47.666540171 -0800 +++ new/jdk/test/java/awt/Mixing/AWT_Mixing/OpaqueOverlapping.java 2017-01-27 10:19:47.542540172 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,6 @@ */ -import com.sun.awt.AWTUtilities; import java.awt.Frame; import java.awt.Panel; import java.awt.Point; @@ -44,11 +43,10 @@ /* * @test * @key headful - * @bug 6776743 + * @bug 6776743 8173409 * @summary Opaque overlapping test for each AWT component * @library /java/awt/patchlib ../../regtesthelpers - * @modules java.desktop/com.sun.awt - * java.desktop/java.awt.peer + * @modules java.desktop/java.awt.peer * java.desktop/sun.awt * @build java.desktop/java.awt.Helper * @build Util @@ -134,12 +132,10 @@ // flag value. for (int i = 0; i < 9; ++i) { if (i == 3) { - AWTUtilities.setComponentMixingCutoutShape(light, - new Rectangle()); + light.setMixingCutoutShape(new Rectangle()); } if (i == 6) { - AWTUtilities.setComponentMixingCutoutShape(light, - null); + light.setMixingCutoutShape(null); } robot.mousePress(InputEvent.BUTTON1_MASK); --- old/jdk/test/java/awt/Mixing/OpaqueTest.java 2017-01-27 10:19:48.022540170 -0800 +++ new/jdk/test/java/awt/Mixing/OpaqueTest.java 2017-01-27 10:19:47.870540171 -0800 @@ -24,11 +24,10 @@ /* @test @key headful - @bug 4811096 + @bug 4811096 8173409 @summary Tests whether opaque and non-opaque components mix correctly @author anthony.petrov@...: area=awt.mixing @library ../regtesthelpers - @modules java.desktop/com.sun.awt @build Util @run main OpaqueTest */ @@ -44,7 +43,6 @@ import java.awt.event.*; import javax.swing.*; import test.java.awt.regtesthelpers.Util; -import com.sun.awt.AWTUtilities; @@ -125,12 +123,10 @@ // flag value. for (int i = 0; i < 9; ++i) { if (i == 3) { - AWTUtilities.setComponentMixingCutoutShape(light, - new Rectangle()); + light.setMixingCutoutShape(new Rectangle()); } if (i == 6) { - AWTUtilities.setComponentMixingCutoutShape(light, - null); + light.setMixingCutoutShape(null); } robot.mousePress(InputEvent.BUTTON1_MASK); --- old/jdk/test/java/awt/jdk/TestJDKAWTUtils.java 2017-01-27 10:19:48.374540169 -0800 +++ /dev/null 2016-11-01 09:38:44.965684815 -0700 @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8167126 - */ -import java.awt.BorderLayout; -import java.awt.Font; -import java.awt.Rectangle; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; - -public class TestJDKAWTUtils { - - static JFrame f; - public static void main(String[] args) throws Exception { - - SwingUtilities.invokeAndWait(() -> { - f = new JFrame("test"); - JPanel p = new JPanel(); - JButton b = new JButton("Hello"); - b.setFont(new Font(Font.DIALOG, Font.PLAIN, 80)); - p.setLayout(new BorderLayout()); - p.add("Center", b); - f.getContentPane().add(p); - f.pack(); - f.setVisible(true); - Rectangle r = new Rectangle(0, 0, 50, 50); - jdk.awt.AWTUtils.setComponentMixingCutoutShape(b, r); - }); - Thread.sleep(2000); - SwingUtilities.invokeAndWait(() -> f.dispose()); - } -}