本文整理汇总了Java中sun.awt.SunToolkit.invokeLaterOnAppContext方法的典型用法代码示例。如果您正苦于以下问题:Java SunToolkit.invokeLaterOnAppContext方法的具体用法?Java SunToolkit.invokeLaterOnAppContext怎么用?Java SunToolkit.invokeLaterOnAppContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.awt.SunToolkit
的用法示例。
在下文中一共展示了SunToolkit.invokeLaterOnAppContext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postDragSourceDragEvent
import sun.awt.SunToolkit; //导入方法依赖的package包/类
protected final void postDragSourceDragEvent(final int targetAction,
final int modifiers,
final int x, final int y,
final int dispatchType) {
final int dropAction =
SunDragSourceContextPeer.convertModifiersToDropAction(modifiers,
sourceActions);
DragSourceDragEvent event =
new DragSourceDragEvent(getDragSourceContext(),
dropAction,
targetAction & sourceActions,
modifiers, x, y);
EventDispatcher dispatcher = new EventDispatcher(dispatchType, event);
SunToolkit.invokeLaterOnAppContext(
SunToolkit.targetToAppContext(getComponent()), dispatcher);
startSecondaryEventLoop();
}
示例2: dragDropFinished
import sun.awt.SunToolkit; //导入方法依赖的package包/类
/**
* upcall from native code via implemented class (do)
*/
protected final void dragDropFinished(final boolean success,
final int operations,
final int x, final int y) {
DragSourceEvent event =
new DragSourceDropEvent(getDragSourceContext(),
operations & sourceActions,
success, x, y);
EventDispatcher dispatcher =
new EventDispatcher(DISPATCH_FINISH, event);
SunToolkit.invokeLaterOnAppContext(
SunToolkit.targetToAppContext(getComponent()), dispatcher);
startSecondaryEventLoop();
setNativeContext(0);
dragImage = null;
dragImageOffset = null;
}
示例3: dispatch
import sun.awt.SunToolkit; //导入方法依赖的package包/类
void dispatch(final _NativeEvent event, final Object... args) {
// grab a local ref to the listeners and its contexts as an array of the map's entries
final ArrayList<Map.Entry<L, AppContext>> localEntries;
synchronized (this) {
if (listenerToAppContext.size() == 0) {
return;
}
localEntries = new ArrayList<Map.Entry<L, AppContext>>(listenerToAppContext.size());
localEntries.addAll(listenerToAppContext.entrySet());
}
for (final Map.Entry<L, AppContext> e : localEntries) {
final L listener = e.getKey();
final AppContext listenerContext = e.getValue();
SunToolkit.invokeLaterOnAppContext(listenerContext, new Runnable() {
public void run() {
performOnListener(listener, event);
}
});
}
}
示例4: dragExit
import sun.awt.SunToolkit; //导入方法依赖的package包/类
/**
* upcall from native code
*/
protected final void dragExit(final int x, final int y) {
DragSourceEvent event =
new DragSourceEvent(getDragSourceContext(), x, y);
EventDispatcher dispatcher =
new EventDispatcher(DISPATCH_EXIT, event);
SunToolkit.invokeLaterOnAppContext(
SunToolkit.targetToAppContext(getComponent()), dispatcher);
startSecondaryEventLoop();
}
示例5: invokeOnEachAppContext
import sun.awt.SunToolkit; //导入方法依赖的package包/类
private void invokeOnEachAppContext(Runnable runnable) {
for (AppContext appContext : AppContext.getAppContexts()) {
SunToolkit.invokeLaterOnAppContext(appContext, runnable);
}
}