jdk/src/share/classes/sun/awt/EmbeddedFrame.java
author erikj
Thu, 07 Jun 2012 18:05:09 -0700
changeset 12813 c10ab96dcf41
parent 11264 54f2f4c6bd30
child 13604 31089af1a447
permissions -rw-r--r--
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI Reviewed-by: ohair, ohrstrom, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7668
d4a77089c587 6962318: Update copyright year
ohair
parents: 6634
diff changeset
     2
 * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2808
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.image.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.peer.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.security.PrivilegedAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.lang.reflect.Constructor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.lang.reflect.InvocationTargetException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.lang.reflect.Modifier;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.lang.reflect.Field;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.beans.PropertyChangeEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.util.Set;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.awt.AWTKeyStroke;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import java.applet.Applet;
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 11264
diff changeset
    43
import javax.tools.annotation.GenerateNativeHeader;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import sun.applet.AppletPanel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * A generic container used for embedding Java components, usually applets.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * An EmbeddedFrame has two related uses:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * . Within a Java-based application, an EmbeddedFrame serves as a sort of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *   firewall, preventing the contained components or applets from using
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *   getParent() to find parent components, such as menubars.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * . Within a C-based application, an EmbeddedFrame contains a window handle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *   which was created by the application, which serves as the top-level
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *   Java window.  EmbeddedFrames created for this purpose are passed-in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *   handle of an existing window created by the application.  The window
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *   handle should be of the appropriate native type for a specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *   platform, as stored in the pData field of the ComponentPeer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * @author      Thomas Ball
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 */
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 11264
diff changeset
    63
/* No native methods here, but the constants are needed in the supporting JNI code */
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 11264
diff changeset
    64
@GenerateNativeHeader
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
public abstract class EmbeddedFrame extends Frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                          implements KeyEventDispatcher, PropertyChangeListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    private boolean isCursorAllowed = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    private static Field fieldPeer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    private static Field currentCycleRoot;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    private boolean supportsXEmbed = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    private KeyboardFocusManager appletKFM;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    // JDK 1.1 compatibility
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    private static final long serialVersionUID = 2967042741780317130L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
6634
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
    76
    /*
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
    77
     * The constants define focus traversal directions.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
    78
     * Use them in {@code traverseIn}, {@code traverseOut} methods.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
    79
     */
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    protected static final boolean FORWARD = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    protected static final boolean BACKWARD = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public boolean supportsXEmbed() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        return supportsXEmbed && SunToolkit.needsXEmbed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    protected EmbeddedFrame(boolean supportsXEmbed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
        this((long)0, supportsXEmbed);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    protected EmbeddedFrame() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        this((long)0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * @deprecated This constructor will be removed in 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    protected EmbeddedFrame(int handle) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        this((long)handle);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    protected EmbeddedFrame(long handle) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        this(handle, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    protected EmbeddedFrame(long handle, boolean supportsXEmbed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        this.supportsXEmbed = supportsXEmbed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        registerListeners();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Block introspection of a parent window by this child.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    public Container getParent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * Needed to track which KeyboardFocusManager is current. We want to avoid memory
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * leaks, so when KFM stops being current, we remove ourselves as listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public void propertyChange(PropertyChangeEvent evt) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        // We don't handle any other properties. Skip it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        if (!evt.getPropertyName().equals("managingFocus")) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        // We only do it if it stops being current. Technically, we should
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        // never get an event about KFM starting being current.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        if (evt.getNewValue() == Boolean.TRUE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        // should be the same as appletKFM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        removeTraversingOutListeners((KeyboardFocusManager)evt.getSource());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        appletKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        if (isVisible()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            addTraversingOutListeners(appletKFM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * Register us as KeyEventDispatcher and property "managingFocus" listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    private void addTraversingOutListeners(KeyboardFocusManager kfm) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        kfm.addKeyEventDispatcher(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        kfm.addPropertyChangeListener("managingFocus", this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * Deregister us as KeyEventDispatcher and property "managingFocus" listeners.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    private void removeTraversingOutListeners(KeyboardFocusManager kfm) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        kfm.removeKeyEventDispatcher(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        kfm.removePropertyChangeListener("managingFocus", this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * Because there may be many AppContexts, and we can't be sure where this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * EmbeddedFrame is first created or shown, we can't automatically determine
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * the correct KeyboardFocusManager to attach to as KeyEventDispatcher.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * Those who want to use the functionality of traversing out of the EmbeddedFrame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * must call this method on the Applet's AppContext. After that, all the changes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * can be handled automatically, including possible replacement of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * KeyboardFocusManager.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    public void registerListeners() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        if (appletKFM != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            removeTraversingOutListeners(appletKFM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        appletKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        if (isVisible()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            addTraversingOutListeners(appletKFM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * Needed to avoid memory leak: we register this EmbeddedFrame as a listener with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * KeyboardFocusManager of applet's AppContext. We don't want the KFM to keep
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * reference to our EmbeddedFrame forever if the Frame is no longer in use, so we
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * add listeners in show() and remove them in hide().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     */
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   186
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    public void show() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        if (appletKFM != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            addTraversingOutListeners(appletKFM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        super.show();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * Needed to avoid memory leak: we register this EmbeddedFrame as a listener with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * KeyboardFocusManager of applet's AppContext. We don't want the KFM to keep
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * reference to our EmbeddedFrame forever if the Frame is no longer in use, so we
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * add listeners in show() and remove them in hide().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     */
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   200
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public void hide() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        if (appletKFM != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            removeTraversingOutListeners(appletKFM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        super.hide();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * Need this method to detect when the focus may have chance to leave the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * focus cycle root which is EmbeddedFrame. Mostly, the code here is copied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * from DefaultKeyboardFocusManager.processKeyEvent with some minor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * modifications.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    public boolean dispatchKeyEvent(KeyEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
        // We can't guarantee that this is called on the same AppContext as EmbeddedFrame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        // belongs to. That's why we can't use public methods to find current focus cycle
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        // root. Instead, we access KFM's private field directly.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        if (currentCycleRoot == null) {
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   220
            currentCycleRoot = AccessController.doPrivileged(new PrivilegedAction<Field>() {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   221
                public Field run() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                    try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                        Field unaccessibleRoot = KeyboardFocusManager.class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                                                     getDeclaredField("currentFocusCycleRoot");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                        if (unaccessibleRoot != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                            unaccessibleRoot.setAccessible(true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                        return unaccessibleRoot;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                    } catch (NoSuchFieldException e1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                        assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                    } catch (SecurityException e2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                        assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                    return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        Container currentRoot = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        if (currentCycleRoot != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
                // The field is static, so we can pass null to Field.get() as the argument.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                currentRoot = (Container)currentCycleRoot.get(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
            } catch (IllegalAccessException e3) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                // This is impossible: currentCycleRoot would be null if setAccessible failed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        // if we are not in EmbeddedFrame's cycle, we should not try to leave.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        if (this != currentRoot) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        // KEY_TYPED events cannot be focus traversal keys
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        if (e.getID() == KeyEvent.KEY_TYPED) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        if (!getFocusTraversalKeysEnabled() || e.isConsumed()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
        AWTKeyStroke stroke = AWTKeyStroke.getAWTKeyStrokeForEvent(e);
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   265
        Set<AWTKeyStroke> toTest;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
        Component currentFocused = e.getComponent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        toTest = getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
1179
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   269
        if (toTest.contains(stroke)) {
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   270
            // 6581899: performance improvement for SortingFocusTraversalPolicy
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   271
            Component last = getFocusTraversalPolicy().getLastComponent(this);
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   272
            if (currentFocused == last || last == null) {
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   273
                if (traverseOut(FORWARD)) {
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   274
                    e.consume();
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   275
                    return true;
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   276
                }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        toTest = getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS);
1179
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   281
        if (toTest.contains(stroke)) {
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   282
            // 6581899: performance improvement for SortingFocusTraversalPolicy
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   283
            Component first = getFocusTraversalPolicy().getFirstComponent(this);
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   284
            if (currentFocused == first || first == null) {
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   285
                if (traverseOut(BACKWARD)) {
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   286
                    e.consume();
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   287
                    return true;
b0d106998757 6581899: JTextField & JTextArea - Poor performance with JRE 1.5.0_08
dcherepanov
parents: 2
diff changeset
   288
                }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    /**
6634
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   295
     * This method is called by the embedder when we should receive focus as element
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   296
     * of the traversal chain.  The method requests focus on:
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   297
     * 1. the first Component of this EmbeddedFrame if user moves focus forward
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   298
     *    in the focus traversal cycle.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   299
     * 2. the last Component of this EmbeddedFrame if user moves focus backward
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   300
     *    in the focus traversal cycle.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   301
     *
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   302
     * The direction parameter specifies which of the two mentioned cases is
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   303
     * happening. Use FORWARD and BACKWARD constants defined in the EmbeddedFrame class
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   304
     * to avoid confusing boolean values.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   305
     *
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   306
     * A concrete implementation of this method is defined in the platform-dependent
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   307
     * subclasses.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   308
     *
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   309
     * @param direction FORWARD or BACKWARD
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   310
     * @return true, if the EmbeddedFrame wants to get focus, false otherwise.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   311
     */
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   312
    public boolean traverseIn(boolean direction) {
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   313
        Component comp = null;
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   314
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   315
        if (direction == FORWARD) {
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   316
            comp = getFocusTraversalPolicy().getFirstComponent(this);
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   317
        } else {
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   318
            comp = getFocusTraversalPolicy().getLastComponent(this);
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   319
        }
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   320
        if (comp != null) {
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   321
            // comp.requestFocus(); - Leads to a hung.
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   322
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   323
            AWTAccessor.getKeyboardFocusManagerAccessor().setMostRecentFocusOwner(this, comp);
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   324
            synthesizeWindowActivation(true);
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   325
        }
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   326
        return (null != comp);
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   327
    }
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   328
439221465ac5 6505819: Provide traverseIn method for sun.awt.EmbeddedFrame
ant
parents: 5506
diff changeset
   329
    /**
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * This method is called from dispatchKeyEvent in the following two cases:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * 1. The focus is on the first Component of this EmbeddedFrame and we are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *    about to transfer the focus backward.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * 2. The focus in on the last Component of this EmbeddedFrame and we are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     *    about to transfer the focus forward.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * This is needed to give the opportuity for keyboard focus to leave the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     * EmbeddedFrame. Override this method, initiate focus transfer in it and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
     * return true if you want the focus to leave EmbeddedFrame's cycle.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * The direction parameter specifies which of the two mentioned cases is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
     * happening. Use FORWARD and BACKWARD constants defined in EmbeddedFrame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
     * to avoid confusing boolean values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * @param direction FORWARD or BACKWARD
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     * @return true, if EmbeddedFrame wants the focus to leave it,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     *         false otherwise.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    protected boolean traverseOut(boolean direction) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
     * Block modifying any frame attributes, since they aren't applicable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     * for EmbeddedFrames.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    public void setTitle(String title) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    public void setIconImage(Image image) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    public void setIconImages(java.util.List<? extends Image> icons) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    public void setMenuBar(MenuBar mb) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    public void setResizable(boolean resizable) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    public void remove(MenuComponent m) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    public boolean isResizable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   365
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    public void addNotify() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        synchronized (getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
            if (getPeer() == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
                setPeer(new NullEmbeddedFramePeer());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
            super.addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
    // These three functions consitute RFE 4100710. Do not remove.
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   376
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    public void setCursorAllowed(boolean isCursorAllowed) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
        this.isCursorAllowed = isCursorAllowed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        getPeer().updateCursorImmediately();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
    public boolean isCursorAllowed() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        return isCursorAllowed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
    public Cursor getCursor() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        return (isCursorAllowed)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
            ? super.getCursor()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
            : Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   390
    @SuppressWarnings("deprecation")
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   391
    protected void setPeer(final ComponentPeer p){
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        if (fieldPeer == null) {
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   393
            fieldPeer = AccessController.doPrivileged(new PrivilegedAction<Field>() {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   394
                public Field run() {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   395
                    try {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   396
                        Field lnkPeer = Component.class.getDeclaredField("peer");
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   397
                        if (lnkPeer != null) {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   398
                            lnkPeer.setAccessible(true);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
                        }
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   400
                        return lnkPeer;
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   401
                    } catch (NoSuchFieldException e) {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   402
                        assert false;
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   403
                    } catch (SecurityException e) {
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   404
                        assert false;
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   405
                    }
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   406
                    return null;
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   407
                }//run
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   408
            });
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        try{
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   411
            if (fieldPeer != null){
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
                fieldPeer.set(EmbeddedFrame.this, p);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
        } catch (IllegalAccessException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
            assert false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    };  //setPeer method ends
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Synthesize native message to activate or deactivate EmbeddedFrame window
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * depending on the value of parameter <code>b</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     * Peers should override this method if they are to implement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * this functionality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     * @param doActivate  if <code>true</code>, activates the window;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * otherwise, deactivates the window
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    public void synthesizeWindowActivation(boolean doActivate) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * Moves this embedded frame to a new location. The top-left corner of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * the new location is specified by the <code>x</code> and <code>y</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     * parameters relative to the native parent component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * setLocation() and setBounds() for EmbeddedFrame really don't move it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * within the native parent. These methods always put embedded frame to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     * (0, 0) for backward compatibility. To allow moving embedded frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * setLocationPrivate() and setBoundsPrivate() were introduced, and they
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * work just the same way as setLocation() and setBounds() for usual,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * non-embedded components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * Using usual get/setLocation() and get/setBounds() together with new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * For example, calling getBoundsPrivate() after setLocation() works fine,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * but getBounds() after setBoundsPrivate() may return unpredictable value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * @param x the new <i>x</i>-coordinate relative to the parent component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * @param y the new <i>y</i>-coordinate relative to the parent component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * @see java.awt.Component#setLocation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * @see #getLocationPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     * @see #setBoundsPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * @see #getBoundsPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    protected void setLocationPrivate(int x, int y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        Dimension size = getSize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
        setBoundsPrivate(x, y, size.width, size.height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * Gets the location of this embedded frame as a point specifying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     * top-left corner relative to parent component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * setLocation() and setBounds() for EmbeddedFrame really don't move it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * within the native parent. These methods always put embedded frame to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * (0, 0) for backward compatibility. To allow getting location and size
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
     * of embedded frame getLocationPrivate() and getBoundsPrivate() were
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     * introduced, and they work just the same way as getLocation() and getBounds()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
     * for ususal, non-embedded components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * Using usual get/setLocation() and get/setBounds() together with new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * For example, calling getBoundsPrivate() after setLocation() works fine,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * but getBounds() after setBoundsPrivate() may return unpredictable value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @return a point indicating this embedded frame's top-left corner
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     * @see java.awt.Component#getLocation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
     * @see #setLocationPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
     * @see #setBoundsPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
     * @see #getBoundsPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
    protected Point getLocationPrivate() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
        Rectangle bounds = getBoundsPrivate();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
        return new Point(bounds.x, bounds.y);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
     * Moves and resizes this embedded frame. The new location of the top-left
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * corner is specified by <code>x</code> and <code>y</code> parameters
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * relative to the native parent component. The new size is specified by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * <code>width</code> and <code>height</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * setLocation() and setBounds() for EmbeddedFrame really don't move it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * within the native parent. These methods always put embedded frame to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     * (0, 0) for backward compatibility. To allow moving embedded frames
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * setLocationPrivate() and setBoundsPrivate() were introduced, and they
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * work just the same way as setLocation() and setBounds() for usual,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * non-embedded components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     * Using usual get/setLocation() and get/setBounds() together with new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
     * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
     * For example, calling getBoundsPrivate() after setLocation() works fine,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * but getBounds() after setBoundsPrivate() may return unpredictable value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     * @param x the new <i>x</i>-coordinate relative to the parent component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @param y the new <i>y</i>-coordinate relative to the parent component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @param width the new <code>width</code> of this embedded frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * @param height the new <code>height</code> of this embedded frame
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @see java.awt.Component#setBounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     * @see #setLocationPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
     * @see #getLocationPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
     * @see #getBoundsPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     */
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   518
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
    protected void setBoundsPrivate(int x, int y, int width, int height) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
        final FramePeer peer = (FramePeer)getPeer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
        if (peer != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
            peer.setBoundsPrivate(x, y, width, height);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   524
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   527
     * Gets the bounds of this embedded frame as a rectangle specifying the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     * width, height and location relative to the native parent component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
     * setLocation() and setBounds() for EmbeddedFrame really don't move it
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
     * within the native parent. These methods always put embedded frame to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * (0, 0) for backward compatibility. To allow getting location and size
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * of embedded frames getLocationPrivate() and getBoundsPrivate() were
90ce3da70b43 Initial load
duke
parents:
diff changeset
   534
     * introduced, and they work just the same way as getLocation() and getBounds()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   535
     * for ususal, non-embedded components.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   538
     * Using usual get/setLocation() and get/setBounds() together with new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     * get/setLocationPrivate() and get/setBoundsPrivate() is not recommended.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     * For example, calling getBoundsPrivate() after setLocation() works fine,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   541
     * but getBounds() after setBoundsPrivate() may return unpredictable value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     * </p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
     * @return a rectangle indicating this embedded frame's bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
     * @see java.awt.Component#getBounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
     * @see #setLocationPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * @see #getLocationPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     * @see #setBoundsPrivate
90ce3da70b43 Initial load
duke
parents:
diff changeset
   548
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   549
     */
11264
54f2f4c6bd30 7117008: Warnings cleanup day: reduce number of javac warnings in the sun.awt package
art
parents: 7668
diff changeset
   550
    @SuppressWarnings("deprecation")
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   551
    protected Rectangle getBoundsPrivate() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
        final FramePeer peer = (FramePeer)getPeer();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
        if (peer != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
            return peer.getBoundsPrivate();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
        else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
            return getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
    public void toFront() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
    public void toBack() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
90ce3da70b43 Initial load
duke
parents:
diff changeset
   564
    public abstract void registerAccelerator(AWTKeyStroke stroke);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   565
    public abstract void unregisterAccelerator(AWTKeyStroke stroke);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
90ce3da70b43 Initial load
duke
parents:
diff changeset
   567
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * Checks if the component is in an EmbeddedFrame. If so,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * returns the applet found in the hierarchy or null if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     * not found.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   571
     * @return the parent applet or {@ null}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
    public static Applet getAppletIfAncestorOf(Component comp) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
        Container parent = comp.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
        Applet applet = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
        while (parent != null && !(parent instanceof EmbeddedFrame)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
            if (parent instanceof Applet) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
                applet = (Applet)parent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
            parent = parent.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
        return parent == null ? null : applet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * This method should be overriden in subclasses. It is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * called when window this frame is within should be blocked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * by some modal dialog.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
    public void notifyModalBlocked(Dialog blocker, boolean blocked) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
    private static class NullEmbeddedFramePeer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
        extends NullComponentPeer implements FramePeer {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
        public void setTitle(String title) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
        public void setIconImage(Image im) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
        public void updateIconImages() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
        public void setMenuBar(MenuBar mb) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
        public void setResizable(boolean resizeable) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
        public void setState(int state) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
        public int getState() { return Frame.NORMAL; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
        public void setMaximizedBounds(Rectangle b) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
        public void toFront() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   605
        public void toBack() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
        public void updateFocusableWindowState() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   607
        public void updateAlwaysOnTop() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
        public void setAlwaysOnTop(boolean alwaysOnTop) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
        public Component getGlobalHeavyweightFocusOwner() { return null; }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
        public void setBoundsPrivate(int x, int y, int width, int height) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
            setBounds(x, y, width, height, SET_BOUNDS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
        public Rectangle getBoundsPrivate() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
            return getBounds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
        public void setModalBlocked(Dialog blocker, boolean blocked) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   619
         * @see java.awt.peer.ContainerPeer#restack
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
        public void restack() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
            throw new UnsupportedOperationException();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
         * @see java.awt.peer.ContainerPeer#isRestackSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
        public boolean isRestackSupported() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
        public boolean requestWindowFocus() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
            return false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
        public void updateMinimumSize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
        }
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   636
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   637
        public void setOpacity(float opacity) {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   638
        }
2648
aa45a227fce3 6802853: API: shaped & translucent windows
anthony
parents: 2472
diff changeset
   639
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   640
        public void setOpaque(boolean isOpaque) {
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   641
        }
2648
aa45a227fce3 6802853: API: shaped & translucent windows
anthony
parents: 2472
diff changeset
   642
2808
a139a919f645 6794764: Translucent windows are completely repainted on every paint event, on Windows
art
parents: 2648
diff changeset
   643
        public void updateWindow() {
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   644
        }
2808
a139a919f645 6794764: Translucent windows are completely repainted on every paint event, on Windows
art
parents: 2648
diff changeset
   645
2472
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   646
        public void repositionSecurityWarning() {
b7aba00cabb6 6693253: Security Warning appearance requires enhancements
anthony
parents: 2451
diff changeset
   647
        }
2451
597df8e1d786 6633275: Need to support shaped/translucent windows
art
parents: 1179
diff changeset
   648
     }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   649
} // class EmbeddedFrame