当前位置: 首页>>代码示例>>Java>>正文


Java AWTAutoShutdown.getInstance方法代码示例

本文整理汇总了Java中sun.awt.AWTAutoShutdown.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java AWTAutoShutdown.getInstance方法的具体用法?Java AWTAutoShutdown.getInstance怎么用?Java AWTAutoShutdown.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.AWTAutoShutdown的用法示例。


在下文中一共展示了AWTAutoShutdown.getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: postEventPrivate

import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
/**
 * Posts a 1.1-style event to the <code>EventQueue</code>.
 * If there is an existing event on the queue with the same ID
 * and event source, the source <code>Component</code>'s
 * <code>coalesceEvents</code> method will be called.
 *
 * @param theEvent an instance of <code>java.awt.AWTEvent</code>,
 * 		or a subclass of it
 */
final void postEventPrivate(AWTEvent theEvent) {
    theEvent.isPosted = true;
    synchronized(this) {
        if (dispatchThread == null && nextQueue == null) {
            if (theEvent.getSource() == AWTAutoShutdown.getInstance()) {
                return;
            } else {
                initDispatchThread();
            }
        }
        if (nextQueue != null) {
            // Forward event to top of EventQueue stack.
            nextQueue.postEventPrivate(theEvent);
            return;
        }
        postEvent(theEvent, getPriority(theEvent));
    }
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:28,代码来源:EventQueue.java

示例2: postEventPrivate

import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
/**
 * Posts a 1.1-style event to the <code>EventQueue</code>.
 * If there is an existing event on the queue with the same ID
 * and event source, the source <code>Component</code>'s
 * <code>coalesceEvents</code> method will be called.
 *
 * @param theEvent an instance of <code>java.awt.AWTEvent</code>,
 *          or a subclass of it
 */
private final void postEventPrivate(AWTEvent theEvent) {
    theEvent.isPosted = true;
    pushPopLock.lock();
    try {
        if (nextQueue != null) {
            // Forward the event to the top of EventQueue stack
            nextQueue.postEventPrivate(theEvent);
            return;
        }
        if (dispatchThread == null) {
            if (theEvent.getSource() == AWTAutoShutdown.getInstance()) {
                return;
            } else {
                initDispatchThread();
            }
        }
        postEvent(theEvent, getPriority(theEvent));
    } finally {
        pushPopLock.unlock();
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:31,代码来源:EventQueue.java

示例3: postEvent

import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
/**
    * Posts the event to the internal Queue of specified priority,
    * coalescing as appropriate.
    *
    * @param theEvent an instance of <code>java.awt.AWTEvent</code>,
    * 		or a subclass of it
    * @param priority  the desired priority of the event
    */
   private void postEvent(AWTEvent theEvent, int priority) {
       Object source = theEvent.getSource();

       if (coalesceEvent(theEvent, priority)) {
           return;
       }

       EventQueueItem newItem = new EventQueueItem(theEvent);

       cacheEQItem(newItem);

       boolean notifyID = (theEvent.getID() == this.waitForID);

       if (queues[priority].head == null) {
           boolean shouldNotify = noEvents();
    queues[priority].head = queues[priority].tail = newItem;

    if (shouldNotify) {
               if (theEvent.getSource() != AWTAutoShutdown.getInstance()) {
                   AWTAutoShutdown.getInstance().notifyThreadBusy(dispatchThread);
               }
        notifyAll();
    } else if (notifyID) {
               notifyAll();
           }
} else {
           // The event was not coalesced or has non-Component source.
           // Insert it at the end of the appropriate Queue.
    queues[priority].tail.next = newItem;
    queues[priority].tail = newItem;
           if (notifyID) {
               notifyAll();
           }
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:44,代码来源:EventQueue.java

示例4: postEvent

import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
/**
 * Posts the event to the internal Queue of specified priority,
 * coalescing as appropriate.
 *
 * @param theEvent an instance of <code>java.awt.AWTEvent</code>,
 *          or a subclass of it
 * @param priority  the desired priority of the event
 */
private void postEvent(AWTEvent theEvent, int priority) {
    if (coalesceEvent(theEvent, priority)) {
        return;
    }

    EventQueueItem newItem = new EventQueueItem(theEvent);

    cacheEQItem(newItem);

    boolean notifyID = (theEvent.getID() == this.waitForID);

    if (queues[priority].head == null) {
        boolean shouldNotify = noEvents();
        queues[priority].head = queues[priority].tail = newItem;

        if (shouldNotify) {
            if (theEvent.getSource() != AWTAutoShutdown.getInstance()) {
                AWTAutoShutdown.getInstance().notifyThreadBusy(dispatchThread);
            }
            pushPopCond.signalAll();
        } else if (notifyID) {
            pushPopCond.signalAll();
        }
    } else {
        // The event was not coalesced or has non-Component source.
        // Insert it at the end of the appropriate Queue.
        queues[priority].tail.next = newItem;
        queues[priority].tail = newItem;
        if (notifyID) {
            pushPopCond.signalAll();
        }
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:42,代码来源:EventQueue.java


注:本文中的sun.awt.AWTAutoShutdown.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。