use of sun.awt.PeerEvent in project jdk8u_jdk by JetBrains.
the class LightweightDispatcher method stopLWModal.
private void stopLWModal() {
synchronized (getTreeLock()) {
if (modalAppContext != null) {
Container nativeContainer = getHeavyweightContainer();
if (nativeContainer != null) {
if (this.modalComp != null) {
nativeContainer.modalComp = this.modalComp;
this.modalComp = null;
return;
} else {
nativeContainer.modalComp = null;
}
}
// Wake up event dispatch thread on which the dialog was
// initially shown
SunToolkit.postEvent(modalAppContext, new PeerEvent(this, new WakingRunnable(), PeerEvent.PRIORITY_EVENT));
}
EventQueue.invokeLater(new WakingRunnable());
getTreeLock().notifyAll();
}
}
use of sun.awt.PeerEvent in project jdk8u_jdk by JetBrains.
the class SunClipboard method checkChange.
/**
* Checks change of the <code>DataFlavor</code>s and, if necessary,
* posts notifications on <code>FlavorEvent</code>s to the
* AppContexts' EDTs.
* The parameter <code>formats</code> is null iff we have just
* failed to get formats available on the clipboard.
*
* @param formats data formats that have just been retrieved from
* this clipboard
*/
protected final void checkChange(final long[] formats) {
if (Arrays.equals(formats, currentFormats)) {
// don't notify
return;
}
currentFormats = formats;
class SunFlavorChangeNotifier implements Runnable {
private final FlavorListener flavorListener;
SunFlavorChangeNotifier(FlavorListener flavorListener) {
this.flavorListener = flavorListener;
}
public void run() {
if (flavorListener != null) {
flavorListener.flavorsChanged(new FlavorEvent(SunClipboard.this));
}
}
}
;
for (Iterator it = AppContext.getAppContexts().iterator(); it.hasNext(); ) {
AppContext appContext = (AppContext) it.next();
if (appContext == null || appContext.isDisposed()) {
continue;
}
EventListenerAggregate flavorListeners = (EventListenerAggregate) appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY);
if (flavorListeners != null) {
FlavorListener[] flavorListenerArray = (FlavorListener[]) flavorListeners.getListenersInternal();
for (int i = 0; i < flavorListenerArray.length; i++) {
SunToolkit.postEvent(appContext, new PeerEvent(this, new SunFlavorChangeNotifier(flavorListenerArray[i]), PeerEvent.PRIORITY_EVENT));
}
}
}
}
Aggregations