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 // Use the awt popup trigger code since this only runs on our OS! 4632N/A // round off and put back edges in a new Graphics 4632N/A // if any subsequent drawing occurs over these corners, the window is square again 4632N/A // setup the graphics context to blast alpha for every primitive we draw 4632N/A // draw the 3px round-rect line around the outer bounds of the window, 4632N/A // this gives the appearance of rounded corners 4632N/A if (!(
invoker instanceof JMenu))
return;
// only point corners originating from menu items 4632N/A // only get location on screen when necessary 4632N/A // invoker is "behind" the popup, no corners should be pointed 4632N/A // blast opaque background over the corners we want to "put back" 4632N/A // popup is far right of invoker 4632N/A // point upper left corner, most common case 4632N/A // popup is far left of invoker 4632N/A // point upper right corner 4632N/A // point lower right corner 4632N/A // popup is neither "far right" or "far left" of it's invoker 4632N/A // popup is "middle" below it's invoker, 4632N/A // this is probably the "connected" case where both upper corners should touch 4632N/A // if none of these cases match...don't make any corners pointed