4632N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 4632N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4632N/A * This code is free software; you can redistribute it and/or modify it 4632N/A * under the terms of the GNU General Public License version 2 only, as 4632N/A * published by the Free Software Foundation. Oracle designates this 4632N/A * particular file as subject to the "Classpath" exception as provided 4632N/A * by Oracle in the LICENSE file that accompanied this code. 4632N/A * This code is distributed in the hope that it will be useful, but WITHOUT 4632N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 4632N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 4632N/A * version 2 for more details (a copy is included in the LICENSE file that 4632N/A * You should have received a copy of the GNU General Public License version 4632N/A * 2 along with this work; if not, write to the Free Software Foundation, 4632N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 4632N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4632N/A * or visit www.oracle.com if you need additional information or have any 4632N/A // This chunk of code is copied from sun.awt.CustomCursor 4632N/A // Make sure image is fully loaded. 4632N/A // Fix for bug 4212593 The Toolkit.createCustomCursor does not 4632N/A // check absence of the image of cursor 4632N/A // If the image is invalid, the cursor will be hidden (made completely 4929N/A // Scale image to nearest supported size 4632N/A // NOTE: this was removed for 3169146, but in 1.5 the JCK tests for an exception and fails if one isn't thrown. 4632N/A // Verify that the hotspot is within cursor bounds. 4632N/A // Must normalize the hotspot 4632N/A // With Panther, cursors have no limit on their size. So give the client their 4632N/A // preferred size, but no larger than half the dimensions of the main screen 4632N/A // This will allow large cursors, but not cursors so large that they cover the 4632N/A // screen. Since solaris nor windows allow cursors this big, this shouldn't be 4632N/A // JCK triggers an overflow in the int -- if we get a bizarre value normalize it. 4632N/A // Called from native when the cursor is set 4929N/A // Something unexpected happened: CCustomCursor constructor 4929N/A // takes care of invalid cursor images, yet createFromImage() 4929N/A // failed to do its job. Return null to keep the cursor unchanged.