/*
* Some portions of this file have been modified by Robert Hanson hansonr.at.stolaf.edu 2012-2017
* for use in SwingJS via transpilation into JavaScript using Java2Script.
*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jsjava.awt;
//import jsjava.awt.event.ComponentEvent;
//import jsjava.awt.event.HierarchyEvent;
import java.awt.HeadlessException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import jsjava.awt.event.ComponentEvent;
import jsjava.awt.event.HierarchyEvent;
import jsjava.awt.event.WindowEvent;
import jsjava.awt.peer.ComponentPeer;
import jsjava.awt.peer.DialogPeer;
import jssun.awt.AppContext;
import jssun.awt.PeerEvent;
//import jssun.awt.AppContext;
/**
* A Dialog is a top-level window with a title and a border
* that is typically used to take some form of input from the user.
*
* The size of the dialog includes any area designated for the
* border. The dimensions of the border area can be obtained
* using the getInsets method, however, since
* these dimensions are platform-dependent, a valid insets
* value cannot be obtained until the dialog is made displayable
* by either calling pack or show.
* Since the border area is included in the overall size of the
* dialog, the border effectively obscures a portion of the dialog,
* constraining the area available for rendering and/or displaying
* subcomponents to the rectangle which has an upper-left corner
* location of (insets.left, insets.top), and has a size of
* width - (insets.left + insets.right) by
* height - (insets.top + insets.bottom).
*
* The default layout for a dialog is BorderLayout.
*
* A dialog may have its native decorations (i.e. Frame & Titlebar) turned off
* with setUndecorated. This can only be done while the dialog
* is not {@link Component#isDisplayable() displayable}.
*
* A dialog may have another window as its owner when it's constructed. When
* the owner window of a visible dialog is minimized, the dialog will
* automatically be hidden from the user. When the owner window is subsequently
* restored, the dialog is made visible to the user again.
*
* In a multi-screen environment, you can create a Dialog
* on a different screen device than its owner. See {@link java.awt.Frame} for
* more information.
*
* A dialog can be either modeless (the default) or modal. A modal
* dialog is one which blocks input to some other top-level windows
* in the application, except for any windows created with the dialog
* as their owner. See AWT Modality
* specification for details.
*
* Dialogs are capable of generating the following
* WindowEvents:
* WindowOpened, WindowClosing,
* WindowClosed, WindowActivated,
* WindowDeactivated, WindowGainedFocus,
* WindowLostFocus.
*
* @see WindowEvent
* @see Window#addWindowListener
*
* @author Sami Shaio
* @author Arthur van Hoff
* @since JDK1.0
*/
public class Dialog extends Window {
transient static ArrayList