src/jdk.unsupported.desktop/share/classes/jdk/swing/interop/LightweightFrameWrapper.java
author mdoerr
Tue, 12 Nov 2019 16:13:16 +0100
changeset 59032 ad05ed6f2a77
parent 50656 362e45aeb983
permissions -rw-r--r--
8233820: Test crashed with assert(phi->operand_count() != 1 || phi->subst() != phi) failed: missed trivial simplification Summary: Verification code needs to skip illegal phi functions. Reviewed-by: thartmann, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50656
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     1
/*
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     4
 *
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    10
 *
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    15
 * accompanied this code).
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    16
 *
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    20
 *
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    23
 * questions.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    24
 */
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    25
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    26
package jdk.swing.interop;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    27
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    28
import java.awt.AWTEvent;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    29
import java.awt.Container;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    30
import java.awt.Component;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    31
import java.awt.event.WindowFocusListener;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    32
import java.awt.event.MouseEvent;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    33
import java.awt.event.MouseWheelEvent;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    34
import java.awt.event.KeyEvent;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    35
import sun.awt.LightweightFrame;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    36
import sun.awt.UngrabEvent;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    37
import sun.awt.AWTAccessor;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    38
import sun.swing.JLightweightFrame;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    39
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    40
/**
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    41
 * This class wraps sun.swing.JLightweightFrame and implements
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    42
 * APIs to be used by FX swing interop to access and use JLightweightFrame APIs.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    43
 *
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    44
 * @since 11
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    45
 */
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    46
public class LightweightFrameWrapper {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    47
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    48
    JLightweightFrame lwFrame;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    49
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    50
    public LightweightFrameWrapper() {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    51
        lwFrame = new JLightweightFrame();
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    52
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    53
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    54
    private JLightweightFrame getLightweightFrame() {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    55
        return lwFrame;
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    56
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    57
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    58
    public void notifyDisplayChanged(final int scaleFactor) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    59
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    60
            lwFrame.notifyDisplayChanged(scaleFactor, scaleFactor);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    61
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    62
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    63
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    64
    /**
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    65
     * {@code overrideNativeWindowHandle()} is package private but
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    66
     * part of the interface of this class. It supports providing a
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    67
     * foreign native window handle (i.e. an FX window handle) to AWT,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    68
     * and as such is intended to be called via JNI code,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    69
     * not by Java code, so it is not public.
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    70
     */
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    71
    void overrideNativeWindowHandle(long handle, Runnable closeWindow) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    72
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    73
            lwFrame.overrideNativeWindowHandle(handle, closeWindow);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    74
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    75
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    76
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    77
    public void setHostBounds(int x, int y, int w, int h) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    78
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    79
            lwFrame.setHostBounds(x, y, w, h);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    80
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    81
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    82
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    83
    public void dispose() {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    84
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    85
            lwFrame.dispose();
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    86
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    87
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    88
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    89
    public void addWindowFocusListener(WindowFocusListener listener) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    90
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    91
            lwFrame.addWindowFocusListener(listener);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    92
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    93
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    94
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    95
    public void setVisible(boolean visible) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    96
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    97
            lwFrame.setVisible(visible);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    98
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
    99
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   100
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   101
    public void setBounds(int x, int y, int w, int h) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   102
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   103
            lwFrame.setBounds(x, y, w, h);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   104
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   105
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   106
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   107
    public void setContent(final LightweightContentWrapper lwCntWrapper) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   108
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   109
            lwFrame.setContent(lwCntWrapper.getContent());
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   110
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   111
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   112
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   113
    public void emulateActivation(boolean activate) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   114
        if (lwFrame != null) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   115
            lwFrame.emulateActivation(activate);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   116
        }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   117
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   118
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   119
    public MouseEvent createMouseEvent(LightweightFrameWrapper lwFrame,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   120
                            int swingID, long swingWhen, int swingModifiers,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   121
                            int relX, int relY, int absX, int absY,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   122
                            int clickCount, boolean swingPopupTrigger,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   123
                            int swingButton) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   124
        return new java.awt.event.MouseEvent(lwFrame.getLightweightFrame(),
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   125
                                             swingID, swingWhen,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   126
                                             swingModifiers,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   127
                                             relX, relY, absX, absY, clickCount,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   128
                                             swingPopupTrigger, swingButton);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   129
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   130
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   131
    public MouseWheelEvent createMouseWheelEvent(LightweightFrameWrapper lwFrame,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   132
                            int swingModifiers, int x, int y, int wheelRotation) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   133
        return  new MouseWheelEvent(lwFrame.getLightweightFrame(),
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   134
                                    java.awt.event.MouseEvent.MOUSE_WHEEL,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   135
                                    System.currentTimeMillis(),
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   136
                                    swingModifiers, x, y, 0, 0, 0, false,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   137
                                    MouseWheelEvent.WHEEL_UNIT_SCROLL, 1,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   138
                                    wheelRotation);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   139
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   140
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   141
    public KeyEvent createKeyEvent(LightweightFrameWrapper lwFrame,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   142
                                   int swingID, long swingWhen,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   143
                                   int swingModifiers,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   144
                                   int swingKeyCode, char swingChar) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   145
        return new java.awt.event.KeyEvent(lwFrame.getLightweightFrame(),
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   146
                       swingID, swingWhen, swingModifiers, swingKeyCode,
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   147
                       swingChar);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   148
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   149
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   150
    public AWTEvent createUngrabEvent(LightweightFrameWrapper lwFrame) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   151
        return new UngrabEvent(lwFrame.getLightweightFrame());
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   152
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   153
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   154
    public Component findComponentAt(LightweightFrameWrapper cont, int x, int y, boolean ignoreEnabled) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   155
        Container lwframe = cont.getLightweightFrame();
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   156
        return AWTAccessor.getContainerAccessor().findComponentAt(lwframe, x, y, ignoreEnabled);
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   157
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   158
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   159
    public boolean isCompEqual(Component c, LightweightFrameWrapper lwFrame) {
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   160
        return c != lwFrame.getLightweightFrame();
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   161
    }
362e45aeb983 8202199: Provide public, unsupported JDK API for JavaFX/Swing interop
psadhukhan
parents:
diff changeset
   162
}