2362N/A * Copyright (c) 1999, 2010, 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 * Popups are used to display a <code>Component</code> to the user, typically 0N/A * on top of all the other <code>Component</code>s in a particular containment 0N/A * hierarchy. <code>Popup</code>s have a very small life cycle. Once you 0N/A * have obtained a <code>Popup</code>, and hidden it (invoked the 0N/A * <code>hide</code> method), you should no longer 0N/A * invoke any methods on it. This allows the <code>PopupFactory</code> to cache 0N/A * <code>Popup</code>s for later use. 0N/A * The general contract is that if you need to change the size of the 0N/A * <code>Component</code>, or location of the <code>Popup</code>, you should 0N/A * obtain a new <code>Popup</code>. 0N/A * <code>Popup</code> does not descend from <code>Component</code>, rather 0N/A * implementations of <code>Popup</code> are responsible for creating 0N/A * and maintaining their own <code>Component</code>s to render the 0N/A * requested <code>Component</code> to the user. 0N/A * You typically do not explicitly create an instance of <code>Popup</code>, 0N/A * instead obtain one from a <code>PopupFactory</code>. 0N/A * The Component representing the Popup. 0N/A * Creates a <code>Popup</code> for the Component <code>owner</code> 0N/A * containing the Component <code>contents</code>. <code>owner</code> 0N/A * is used to determine which <code>Window</code> the new 0N/A * <code>Popup</code> will parent the <code>Component</code> the 0N/A * <code>Popup</code> creates to. 0N/A * A null <code>owner</code> implies there is no valid parent. 0N/A * <code>x</code> and 0N/A * <code>y</code> specify the preferred initial location to place 0N/A * the <code>Popup</code> at. Based on screen size, or other paramaters, 0N/A * the <code>Popup</code> may not display at <code>x</code> and 0N/A * @param owner Component mouse coordinates are relative to, may be null 0N/A * @param contents Contents of the Popup 0N/A * @param x Initial x screen coordinate 0N/A * @param y Initial y screen coordinate 0N/A * @exception IllegalArgumentException if contents is null 0N/A * Creates a <code>Popup</code>. This is provided for subclasses. 0N/A * Makes the <code>Popup</code> visible. If the <code>Popup</code> is 0N/A * currently visible, this has no effect. 0N/A * Hides and disposes of the <code>Popup</code>. Once a <code>Popup</code> 0N/A * has been disposed you should no longer invoke methods on it. A 0N/A * <code>dispose</code>d <code>Popup</code> may be reclaimed and later used 0N/A * based on the <code>PopupFactory</code>. As such, if you invoke methods 0N/A * on a <code>disposed</code> <code>Popup</code>, indeterminate 0N/A * behavior will result. 0N/A * Frees any resources the <code>Popup</code> may be holding onto. 0N/A // If our parent is a DefaultFrame, we need to dispose it, too. 0N/A * Resets the <code>Popup</code> to an initial state. 0N/A // Do not call pack() if window is not visible to 0N/A // avoid early native peer creation 0N/A * Causes the <code>Popup</code> to be sized to fit the preferred size 0N/A * of the <code>Component</code> it contains. 0N/A * Returns the <code>Window</code> to use as the parent of the 0N/A * <code>Window</code> created for the <code>Popup</code>. This creates 0N/A * a new <code>DefaultFrame</code>, if necessary. 0N/A * Creates the Component to use as the parent of the <code>Popup</code>. 0N/A * The default implementation creates a <code>Window</code>, subclasses 0N/A // Generally not useful, bail. 0N/A * Returns the <code>Component</code> returned from 0N/A * <code>createComponent</code> that will hold the <code>Popup</code>. 0N/A * Component used to house window. 0N/A // Popups are typically transient and most likely won't benefit 5559N/A // from true double buffering. Turn it off here. 0N/A // Try to set "always-on-top" for the popup window. 0N/A // Applets usually don't have sufficient permissions to do it. 0N/A // In this case simply ignore the exception. 0N/A // setAlwaysOnTop is restricted, 0N/A // the exception is ignored 0N/A * Used if no valid Window ancestor of the supplied owner is found. 0N/A * PopupFactory uses this as a way to know when the Popup shouldn't 0N/A * be cached based on the Window.