EventDispatchThread.java revision 4632
1051N/A * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. 1051N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1051N/A * This code is free software; you can redistribute it and/or modify it 1051N/A * under the terms of the GNU General Public License version 2 only, as 1051N/A * published by the Free Software Foundation. Oracle designates this 1051N/A * particular file as subject to the "Classpath" exception as provided 1051N/A * by Oracle in the LICENSE file that accompanied this code. 1051N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1051N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1051N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1051N/A * version 2 for more details (a copy is included in the LICENSE file that 1051N/A * You should have received a copy of the GNU General Public License version 1051N/A * 2 along with this work; if not, write to the Free Software Foundation, 1051N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1051N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1051N/A * or visit www.oracle.com if you need additional information or have any * EventDispatchThread is a package-private AWT class which takes * events off the EventQueue and dispatches them to the appropriate * The Thread starts a "permanent" event pump with a call to * pumpEvents(Conditional) in its run() method. Event handlers can choose to * block this event pump at any time, but should start a new pump (<b>not</b> * a new EventDispatchThread) by again calling pumpEvents(Conditional). This * secondary event pump will exit automatically as soon as the Condtional * evaluate()s to false and an additional Event is pumped and dispatched. * @author David Mendenhall * Must be called on EDT only, that's why no synchronization // This was added because this class (and java.awt.Conditional) are package private. // There are certain instances where classes in other packages need to block the // AWTEventQueue while still allowing it to process events. This uses reflection // to call back into the caller in order to remove dependencies. // NOTE: This uses reflection in its implementation, so it is not for performance critical code. // cond is an instance of sun.lwawt.macosx.EventDispatchAccess // EventQueue may change during the dispatching return false;
// AppContext.dispose() interrupts all // Threads in the AppContext * filter out MouseEvent and ActionEvent that's outside * the modalComponent hierarchy. * KeyEvent is handled by using enqueueKeyEvent * Modal internal frames are handled separately. If event is * for some component from another heavyweight than modalComp, * it is accepted. If heavyweight is the same - we still accept * event and perform further filtering in LightweightDispatcher // Exclude this object from modality and // continue to pump it's events. // Exclude this window and all its children from // modality and continue to pump it's events.