2362N/A * Copyright (c) 1999, 2007, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A stateless class which responds to native mouse moves, Component resizes, 0N/A * Component moves, showing and hiding of Components, minimizing and 0N/A * maximizing of top level Windows, addition and removal of Components, 0N/A * and calls to setCursor(). 0N/A synchronized (
this) {
0N/A synchronized (
this) {
0N/A * Use a singleton NativeUpdater for better performance. We cannot use 0N/A * a singleton InvocationEvent because we want each event to have a fresh 0N/A * The last time the cursor was updated, in milliseconds. 0N/A * Locking object for synchronizing access to lastUpdateMillis. The VM 0N/A * does not guarantee atomicity of longs. 0N/A * Should be called for any activity at the Java level which may affect 0N/A * the global cursor, except for Java MOUSE_MOVED events. 0N/A * Should be called in response to Java MOUSE_MOVED events. The update 0N/A * will be discarded if the InputEvent is outdated. 0N/A * @param e the InputEvent which triggered the cursor update. 0N/A * Should be called in response to a native mouse enter or native mouse 0N/A * button released message. Should not be called during a mouse drag. 0N/A * Set the global cursor to the specified cursor. The component over 0N/A * which the Cursor current resides is provided as a convenience. Not 0N/A * all platforms may require the Component. 0N/A * Returns the global cursor position, in screen coordinates. 0N/A * Returns the most specific, visible, heavyweight Component 0N/A * under the cursor. This method should return null iff the cursor is 0N/A * not over any Java Window. 0N/A * @param useCache If true, the implementation is free to use caching 0N/A * mechanisms because the Z-order, visibility, and enabled state of the 0N/A * Components has not changed. If false, the implementation should not 0N/A * make these assumptions. 0N/A * Updates the global cursor. We apply a three-step scheme to cursor 0N/A * (1) InputEvent updates which are outdated are discarded by 0N/A * <code>updateCursorImmediately(InputEvent)</code>.<p> 0N/A * (2) If 'useCache' is true, the native code is free to use a cached 0N/A * value to determine the most specific, visible, enabled heavyweight 0N/A * because this update is occuring in response to a mouse move. If 0N/A * 'useCache' is false, the native code must perform a new search given 0N/A * the current mouse coordinates. 0N/A * (3) Once we have determined the most specific, visible, enabled 0N/A * heavyweight, we use findComponentAt to find the most specific, visible, 0N/A * enabled Component. 0N/A // If findComponentAt returns null, then something bad has 0N/A // happened. For example, the heavyweight Component may 0N/A // have been hidden or disabled by another thread. In that 0N/A // case, we'll just use the originial heavyweight. 0N/A // Shouldn't happen, but if it does, abort. 0N/A // Cursor is not over a Java Window. Do nothing...usually 0N/A // But we need to update it in case of grab on X.