jdk/src/share/classes/sun/awt/AWTAccessor.java
author dcherepanov
Tue, 23 Jun 2009 13:35:58 +0400
changeset 3084 67ca55732362
parent 2808 a139a919f645
child 3237 7c6c2d9361d9
permissions -rw-r--r--
6824169: Need to remove some AWT class dependencies Reviewed-by: art, anthony, igor, alexp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     1
/*
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
     2
 * Copyright 2008-2009 Sun Microsystems, Inc.  All Rights Reserved.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     4
 *
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    10
 *
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    15
 * accompanied this code).
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    16
 *
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    20
 *
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    23
 * have any questions.
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    24
 */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    25
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    26
package sun.awt;
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    27
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    28
import java.awt.*;
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    29
import java.awt.geom.Point2D;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    30
import java.awt.image.BufferedImage;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    31
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    32
import sun.misc.Unsafe;
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
    33
import java.awt.peer.ComponentPeer;
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    34
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    35
/**
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    36
 * The AWTAccessor utility class.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    37
 * The main purpose of this class is to enable accessing
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    38
 * private and package-private fields of classes from
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    39
 * different classes/packages. See sun.misc.SharedSecretes
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    40
 * for another example.
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    41
 */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    42
public final class AWTAccessor {
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    43
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    44
    private static final Unsafe unsafe = Unsafe.getUnsafe();
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    45
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    46
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    47
     * We don't need any objects of this class.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    48
     * It's rather a collection of static methods
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    49
     * and interfaces.
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    50
     */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    51
    private AWTAccessor() {
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    52
    }
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    53
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    54
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    55
     * An interface of accessor for the java.awt.Component class.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    56
     */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    57
    public interface ComponentAccessor {
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    58
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    59
         * Sets whether the native background erase for a component
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    60
         * has been disabled via SunToolkit.disableBackgroundErase().
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    61
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    62
        void setBackgroundEraseDisabled(Component comp, boolean disabled);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    63
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    64
         * Indicates whether the native background erase for a
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    65
         * component has been disabled via
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    66
         * SunToolkit.disableBackgroundErase().
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    67
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    68
        boolean getBackgroundEraseDisabled(Component comp);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    69
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    70
         *
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    71
         * Gets the bounds of this component in the form of a
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    72
         * <code>Rectangle</code> object. The bounds specify this
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    73
         * component's width, height, and location relative to
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    74
         * its parent.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    75
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    76
        Rectangle getBounds(Component comp);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    77
        /*
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    78
         * Sets the shape of a lw component to cut out from hw components.
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    79
         *
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
    80
         * See 6797587, 6776743, 6768307, and 6768332 for details
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    81
         */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
    82
        void setMixingCutoutShape(Component comp, Shape shape);
2459
08f3416ff334 6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents: 2453
diff changeset
    83
08f3416ff334 6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents: 2453
diff changeset
    84
        /**
08f3416ff334 6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents: 2453
diff changeset
    85
         * Sets GraphicsConfiguration value for the component.
08f3416ff334 6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents: 2453
diff changeset
    86
         */
08f3416ff334 6804747: Ensure consistent graphicsConfig member across components hierarchy
anthony
parents: 2453
diff changeset
    87
        void setGraphicsConfiguration(Component comp, GraphicsConfiguration gc);
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    88
        /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    89
         * Requests focus to the component.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    90
         */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    91
        boolean requestFocus(Component comp, CausedFocusEvent.Cause cause);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    92
        /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    93
         * Determines if the component can gain focus.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    94
         */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
    95
        boolean canBeFocusOwner(Component comp);
2472
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
    96
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
    97
        /**
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
    98
         * Returns whether the component is visible without invoking
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
    99
         * any client code.
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   100
         */
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   101
        boolean isVisible_NoClientCode(Component comp);
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   102
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   103
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   104
         * Sets the RequestFocusController.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   105
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   106
        void setRequestFocusController(RequestFocusController requestController);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   107
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   108
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   109
         * Returns the appContext of the component.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   110
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   111
        AppContext getAppContext(Component comp);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   112
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   113
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   114
         * Sets the appContext of the component.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   115
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   116
        void setAppContext(Component comp, AppContext appContext);
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   117
    }
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   118
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   119
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   120
     * An interface of accessor for java.awt.Window class.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   121
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   122
    public interface WindowAccessor {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   123
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   124
         * Get opacity level of the given window.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   125
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   126
        float getOpacity(Window window);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   127
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   128
         * Set opacity level to the given window.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   129
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   130
        void setOpacity(Window window, float opacity);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   131
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   132
         * Get a shape assigned to the given window.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   133
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   134
        Shape getShape(Window window);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   135
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   136
         * Set a shape to the given window.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   137
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   138
        void setShape(Window window, Shape shape);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   139
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   140
         * Identify whether the given window is opaque (true)
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   141
         *  or translucent (false).
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   142
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   143
        boolean isOpaque(Window window);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   144
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   145
         * Set the opaque preoperty to the given window.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   146
         */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   147
        void setOpaque(Window window, boolean isOpaque);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   148
        /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   149
         * Update the image of a non-opaque (translucent) window.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   150
         */
2808
a139a919f645 6794764: Translucent windows are completely repainted on every paint event, on Windows
art
parents: 2472
diff changeset
   151
        void updateWindow(Window window);
2472
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   152
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   153
        /** Get the size of the security warning.
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   154
         */
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   155
        Dimension getSecurityWarningSize(Window w);
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   156
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   157
        /**
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   158
         * Set the size of the security warning.
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   159
         */
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   160
        void setSecurityWarningSize(Window w, int width, int height);
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   161
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   162
        /** Set the position of the security warning.
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   163
         */
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   164
        void setSecurityWarningPosition(Window w, Point2D point,
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   165
                float alignmentX, float alignmentY);
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   166
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   167
        /** Request to recalculate the new position of the security warning for
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   168
         * the given window size/location as reported by the native system.
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   169
         */
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   170
        Point2D calculateSecurityWarningPosition(Window window,
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2465
diff changeset
   171
                double x, double y, double w, double h);
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   172
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   173
        /** Sets the synchronous status of focus requests on lightweight
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   174
         * components in the specified window to the specified value.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   175
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   176
        void setLWRequestStatus(Window changed, boolean status);
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   177
    }
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   178
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   179
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   180
     * An accessor for the AWTEvent class.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   181
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   182
    public interface AWTEventAccessor {
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   183
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   184
         * Marks the event as posted.
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   185
         */
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   186
        void setPosted(AWTEvent ev);
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   187
    }
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   188
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   189
    /*
2453
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   190
     * An accessor for the java.awt.Frame class.
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   191
     */
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   192
    public interface FrameAccessor {
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   193
        /*
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   194
         * Sets the state of this frame.
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   195
         */
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   196
        void setExtendedState(Frame frame, int state);
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   197
        /*
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   198
         * Gets the state of this frame.
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   199
         */
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   200
       int getExtendedState(Frame frame);
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   201
    }
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   202
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   203
    /*
2465
1a6452b990cf 6815946: regression: failed to build MToolkit
ant
parents: 2464
diff changeset
   204
     * An interface of accessor for the java.awt.KeyboardFocusManager class.
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   205
     */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   206
    public interface KeyboardFocusManagerAccessor {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   207
        /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   208
         * Indicates whether the native implementation should
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   209
         * proceed with a pending focus request for the heavyweight.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   210
         */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   211
        int shouldNativelyFocusHeavyweight(Component heavyweight,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   212
                                           Component descendant,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   213
                                           boolean temporary,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   214
                                           boolean focusedWindowChangeAllowed,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   215
                                           long time,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   216
                                           CausedFocusEvent.Cause cause);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   217
        /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   218
         * Delivers focus for the lightweight descendant of the heavyweight
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   219
         * synchronously.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   220
         */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   221
        boolean processSynchronousLightweightTransfer(Component heavyweight,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   222
                                                      Component descendant,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   223
                                                      boolean temporary,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   224
                                                      boolean focusedWindowChangeAllowed,
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   225
                                                      long time);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   226
        /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   227
         * Removes the last focus request for the heavyweight from the queue.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   228
         */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   229
        void removeLastFocusRequest(Component heavyweight);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   230
    }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   231
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   232
    /*
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   233
     * An accessor for the MenuComponent class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   234
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   235
    public interface MenuComponentAccessor {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   236
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   237
         * Returns the appContext of the menu component.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   238
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   239
        AppContext getAppContext(MenuComponent menuComp);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   240
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   241
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   242
         * Sets the appContext of the menu component.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   243
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   244
        void setAppContext(MenuComponent menuComp, AppContext appContext);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   245
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   246
        /**
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   247
         * Returns the menu container of the menu component
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   248
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   249
        MenuContainer getParent(MenuComponent menuComp);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   250
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   251
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   252
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   253
     * An accessor for the EventQueue class
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   254
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   255
    public interface EventQueueAccessor {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   256
        /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   257
         * Gets the next event queue.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   258
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   259
        EventQueue getNextQueue(EventQueue eventQueue);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   260
        /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   261
         * Gets the event dispatch thread.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   262
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   263
        Thread getDispatchThread(EventQueue eventQueue);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   264
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   265
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   266
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   267
     * An accessor for the PopupMenu class
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   268
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   269
    public interface PopupMenuAccessor {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   270
        /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   271
         * Returns whether the popup menu is attached to a tray
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   272
         */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   273
        boolean isTrayIconPopup(PopupMenu popupMenu);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   274
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   275
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   276
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   277
    /*
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   278
     * The java.awt.Component class accessor object.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   279
     */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   280
    private static ComponentAccessor componentAccessor;
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   281
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   282
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   283
     * The java.awt.Window class accessor object.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   284
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   285
    private static WindowAccessor windowAccessor;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   286
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   287
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   288
     * The java.awt.AWTEvent class accessor object.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   289
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   290
    private static AWTEventAccessor awtEventAccessor;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   291
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   292
    /*
2453
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   293
     * The java.awt.Frame class accessor object.
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   294
     */
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   295
    private static FrameAccessor frameAccessor;
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   296
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   297
    /*
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   298
     * The java.awt.KeyboardFocusManager class accessor object.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   299
     */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   300
    private static KeyboardFocusManagerAccessor kfmAccessor;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   301
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   302
    /*
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   303
     * The java.awt.MenuComponent class accessor object.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   304
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   305
    private static MenuComponentAccessor menuComponentAccessor;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   306
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   307
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   308
     * The java.awt.EventQueue class accessor object.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   309
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   310
    private static EventQueueAccessor eventQueueAccessor;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   311
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   312
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   313
     * The java.awt.PopupMenu class accessor object.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   314
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   315
    private static PopupMenuAccessor popupMenuAccessor;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   316
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   317
    /*
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   318
     * Set an accessor object for the java.awt.Component class.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   319
     */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   320
    public static void setComponentAccessor(ComponentAccessor ca) {
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   321
        componentAccessor = ca;
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   322
    }
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   323
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   324
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   325
     * Retrieve the accessor object for the java.awt.Window class.
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   326
     */
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   327
    public static ComponentAccessor getComponentAccessor() {
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   328
        if (componentAccessor == null) {
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   329
            unsafe.ensureClassInitialized(Component.class);
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   330
        }
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   331
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   332
        return componentAccessor;
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   333
    }
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   334
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   335
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   336
     * Set an accessor object for the java.awt.Window class.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   337
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   338
    public static void setWindowAccessor(WindowAccessor wa) {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   339
        windowAccessor = wa;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   340
    }
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   341
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   342
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   343
     * Retrieve the accessor object for the java.awt.Window class.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   344
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   345
    public static WindowAccessor getWindowAccessor() {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   346
        if (windowAccessor == null) {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   347
            unsafe.ensureClassInitialized(Window.class);
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   348
        }
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   349
        return windowAccessor;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   350
    }
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   351
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   352
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   353
     * Set an accessor object for the java.awt.AWTEvent class.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   354
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   355
    public static void setAWTEventAccessor(AWTEventAccessor aea) {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   356
        awtEventAccessor = aea;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   357
    }
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   358
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   359
    /*
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   360
     * Retrieve the accessor object for the java.awt.AWTEvent class.
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   361
     */
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   362
    public static AWTEventAccessor getAWTEventAccessor() {
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   363
        if (awtEventAccessor == null) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   364
            unsafe.ensureClassInitialized(AWTEvent.class);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   365
        }
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   366
        return awtEventAccessor;
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1978
diff changeset
   367
    }
2453
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   368
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   369
    /*
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   370
     * Set an accessor object for the java.awt.Frame class.
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   371
     */
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   372
    public static void setFrameAccessor(FrameAccessor fa) {
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   373
        frameAccessor = fa;
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   374
    }
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   375
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   376
    /*
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   377
     * Retrieve the accessor object for the java.awt.Frame class.
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   378
     */
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   379
    public static FrameAccessor getFrameAccessor() {
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   380
        if (frameAccessor == null) {
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   381
            unsafe.ensureClassInitialized(Frame.class);
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   382
        }
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   383
        return frameAccessor;
35e5fab82613 6724890: Deadlock between AWT-EventQueue-1 and AWT-XAWT threads during IDE start
dcherepanov
parents: 2451
diff changeset
   384
    }
2464
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   385
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   386
    /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   387
     * Set an accessor object for the java.awt.KeyboardFocusManager class.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   388
     */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   389
    public static void setKeyboardFocusManagerAccessor(KeyboardFocusManagerAccessor kfma) {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   390
        kfmAccessor = kfma;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   391
    }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   392
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   393
    /*
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   394
     * Retrieve the accessor object for the java.awt.KeyboardFocusManager class.
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   395
     */
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   396
    public static KeyboardFocusManagerAccessor getKeyboardFocusManagerAccessor() {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   397
        if (kfmAccessor == null) {
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   398
            unsafe.ensureClassInitialized(KeyboardFocusManager.class);
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   399
        }
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   400
        return kfmAccessor;
3c6755bdc55f 6806217: implement synthetic focus model for MS Windows
ant
parents: 2459
diff changeset
   401
    }
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   402
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   403
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   404
     * Set an accessor object for the java.awt.MenuComponent class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   405
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   406
    public static void setMenuComponentAccessor(MenuComponentAccessor mca) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   407
        menuComponentAccessor = mca;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   408
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   409
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   410
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   411
     * Retrieve the accessor object for the java.awt.MenuComponent class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   412
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   413
    public static MenuComponentAccessor getMenuComponentAccessor() {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   414
        if (menuComponentAccessor == null) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   415
            unsafe.ensureClassInitialized(MenuComponent.class);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   416
        }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   417
        return menuComponentAccessor;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   418
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   419
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   420
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   421
     * Set an accessor object for the java.awt.EventQueue class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   422
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   423
    public static void setEventQueueAccessor(EventQueueAccessor eqa) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   424
        eventQueueAccessor = eqa;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   425
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   426
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   427
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   428
     * Retrieve the accessor object for the java.awt.EventQueue class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   429
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   430
    public static EventQueueAccessor getEventQueueAccessor() {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   431
        if (eventQueueAccessor == null) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   432
            unsafe.ensureClassInitialized(EventQueue.class);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   433
        }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   434
        return eventQueueAccessor;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   435
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   436
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   437
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   438
     * Set an accessor object for the java.awt.PopupMenu class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   439
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   440
    public static void setPopupMenuAccessor(PopupMenuAccessor pma) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   441
        popupMenuAccessor = pma;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   442
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   443
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   444
    /*
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   445
     * Retrieve the accessor object for the java.awt.PopupMenu class.
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   446
     */
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   447
    public static PopupMenuAccessor getPopupMenuAccessor() {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   448
        if (popupMenuAccessor == null) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   449
            unsafe.ensureClassInitialized(PopupMenu.class);
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   450
        }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   451
        return popupMenuAccessor;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2808
diff changeset
   452
    }
1978
8b981ce05cd0 6797195: Forward-port enhancements for hw/lw mixing from 6u12 to 7
anthony
parents:
diff changeset
   453
}