3261N/A * Copyright (c) 2000, 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 * A mechanism for ensuring that a series of AWTEvents are executed in a 0N/A * precise order, even across multiple AppContexts. The nested events will be 0N/A * dispatched in the order in which their wrapping SequencedEvents were 0N/A * constructed. The only exception to this rule is if the peer of the target of 0N/A * the nested event was destroyed (with a call to Component.removeNotify) 0N/A * before the wrapping SequencedEvent was able to be dispatched. In this case, 0N/A * the nested event is never dispatched. 0N/A * @author David Mendenhall 0N/A private static final int ID =
0N/A * Constructs a new SequencedEvent which will dispatch the specified 0N/A * @param nested the AWTEvent which this SequencedEvent's dispatch() 0N/A * method will dispatch 2860N/A // All AWTEvents that are wrapped in SequencedEvents are (at 2860N/A // least currently) implicitly generated by the system 0N/A * Dispatches the nested event after all previous nested events have been 0N/A * dispatched or disposed. If this method is invoked before all previous nested events 0N/A * have been dispatched, then this method blocks until such a point is 0N/A * While waiting disposes nested events to disposed AppContext 0N/A * NOTE: Locking protocol. Since dispose() can get EventQueue lock, 0N/A * dispatch() shall never call dispose() while holding the lock on the list, 0N/A * as EventQueue lock is held during dispatching. The locks should be acquired 0N/A * in the same order. 0N/A * true only if event exists and nested source appContext is disposed. 0N/A * Sequenced events are dispatched in order, so we cannot dispatch 0N/A * until we are the first sequenced event in the queue (i.e. it's our 0N/A * turn). But while we wait for our turn to dispatch, the event 0N/A * could have been disposed for a number of reasons. 0N/A // getFirstWithContext can dispose this 0N/A /* Disposes all events from disposed AppContext 0N/A * return first valid event 0N/A * Disposes of this instance. This method is invoked once the nested event 0N/A * has been dispatched and handled, or when the peer of the target of the 0N/A * nested event has been disposed with a call to Component.removeNotify. 0N/A * NOTE: Locking protocol. Since SunToolkit.postEvent can get EventQueue lock, 0N/A * it shall never be called while holding the lock on the list, 0N/A * as EventQueue lock is held during dispatching and dispatch() will get 0N/A * lock on the list. The locks should be acquired in the same order. 0N/A // Wake up waiting threads