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


Java EventQueue.getMostRecentEventTime方法代码示例

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


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

示例1: testMemoryRelease

import java.awt.EventQueue; //导入方法依赖的package包/类
@RandomlyFails
public void testMemoryRelease() throws Exception { // Issue #147984
    org.netbeans.junit.Log.enableInstances(Logger.getLogger("TIMER"), "CodeTemplateInsertHandler", Level.FINEST);

    JEditorPane pane = new JEditorPane();
    NbEditorKit kit = new NbEditorKit();
    pane.setEditorKit(kit);
    Document doc = pane.getDocument();
    assertTrue(doc instanceof BaseDocument);
    CodeTemplateManager mgr = CodeTemplateManager.get(doc);
    String templateText = "Test with parm ";
    CodeTemplate ct = mgr.createTemporary(templateText + " ${a}");
    ct.insert(pane);
    assertEquals(templateText + " a", doc.getText(0, doc.getLength()));

    // Send Enter to stop editing
    KeyEvent enterKeyEvent = new KeyEvent(pane, KeyEvent.KEY_PRESSED,
            EventQueue.getMostRecentEventTime(),
            0, KeyEvent.VK_ENTER, KeyEvent.CHAR_UNDEFINED);

    SwingUtilities.processKeyBindings(enterKeyEvent);
    // CT editing should be finished

    org.netbeans.junit.Log.assertInstances("CodeTemplateInsertHandler instances not GCed");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:CodeTemplatesTest.java

示例2: postToolTip

import java.awt.EventQueue; //导入方法依赖的package包/类
public static void postToolTip(JComponent comp) {
	Action action = comp.getActionMap().get("postTip");
	if (action == null) {
		return;
	}
	ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "postTip", EventQueue.getMostRecentEventTime(),
			0);
	action.actionPerformed(ae);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:ExtendedJSliderToolTips.java

示例3: hideToolTip

import java.awt.EventQueue; //导入方法依赖的package包/类
public static void hideToolTip(JComponent comp) {
	Action action = comp.getActionMap().get("hideTip");
	if (action == null) {
		return;
	}
	ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, "hideTip", EventQueue.getMostRecentEventTime(),
			0);
	action.actionPerformed(ae);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:10,代码来源:ExtendedJSliderToolTips.java

示例4: postToolTip

import java.awt.EventQueue; //导入方法依赖的package包/类
public static void postToolTip(JComponent comp){ 
    Action action = comp.getActionMap().get("postTip"); 
    if(action==null) // no tooltip 
        return; 
    ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, 
                            "postTip", EventQueue.getMostRecentEventTime(), 0); 
    action.actionPerformed(ae); 
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:9,代码来源:SliderToolTips.java

示例5: hideToolTip

import java.awt.EventQueue; //导入方法依赖的package包/类
public static void hideToolTip(JComponent comp){ 
    Action action = comp.getActionMap().get("hideTip"); 
    if(action==null) // no tooltip 
        return; 
    ActionEvent ae = new ActionEvent(comp, ActionEvent.ACTION_PERFORMED, 
                            "hideTip", EventQueue.getMostRecentEventTime(), 0); 
    action.actionPerformed(ae); 
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:9,代码来源:SliderToolTips.java

示例6: readObject

import java.awt.EventQueue; //导入方法依赖的package包/类
/**
 * Initializes the <code>when</code> field if it is not present in the
 * object input stream. In that case, the field will be initialized by
 * invoking {@link java.awt.EventQueue#getMostRecentEventTime()}.
 */
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
    s.defaultReadObject();
    if (when == 0) {
        // Can't use getMostRecentEventTimeForSource because source is always null during deserialization
        when = EventQueue.getMostRecentEventTime();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:InputMethodEvent.java

示例7: fireActionPerformed

import java.awt.EventQueue; //导入方法依赖的package包/类
/**
 * Notifies all listeners that have registered interest for
 * notification on this event type. The event instance
 * is lazily created using the <code>command</code> parameter.
 *
 * @see EventListenerList
 */
protected void fireActionPerformed(String command) {
    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();
    long mostRecentEventTime = EventQueue.getMostRecentEventTime();
    int modifiers = 0;
    AWTEvent currentEvent = EventQueue.getCurrentEvent();
    if (currentEvent instanceof InputEvent) {
        modifiers = ((InputEvent)currentEvent).getModifiers();
    } else if (currentEvent instanceof ActionEvent) {
        modifiers = ((ActionEvent)currentEvent).getModifiers();
    }
    ActionEvent e = null;
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==ActionListener.class) {
            // Lazily create the event:
            if (e == null) {
                e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
                                    command, mostRecentEventTime,
                                    modifiers);
            }
            ((ActionListener)listeners[i+1]).actionPerformed(e);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:JFileChooser.java

示例8: readObject

import java.awt.EventQueue; //导入方法依赖的package包/类
/**
 * Initializes the {@code when} field if it is not present in the
 * object input stream. In that case, the field will be initialized by
 * invoking {@link java.awt.EventQueue#getMostRecentEventTime()}.
 */
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException {
    s.defaultReadObject();
    if (when == 0) {
        // Can't use getMostRecentEventTimeForSource because source is always null during deserialization
        when = EventQueue.getMostRecentEventTime();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:InputMethodEvent.java

示例9: fireActionPerformed

import java.awt.EventQueue; //导入方法依赖的package包/类
/**
 * Notifies all listeners that have registered interest for
 * notification on this event type. The event instance
 * is lazily created using the <code>command</code> parameter.
 *
 * @param command a string that may specify a command associated with
 *                the event
 * @see EventListenerList
 */
@SuppressWarnings("deprecation")
protected void fireActionPerformed(String command) {
    // Guaranteed to return a non-null array
    Object[] listeners = listenerList.getListenerList();
    long mostRecentEventTime = EventQueue.getMostRecentEventTime();
    int modifiers = 0;
    AWTEvent currentEvent = EventQueue.getCurrentEvent();
    if (currentEvent instanceof InputEvent) {
        modifiers = ((InputEvent)currentEvent).getModifiers();
    } else if (currentEvent instanceof ActionEvent) {
        modifiers = ((ActionEvent)currentEvent).getModifiers();
    }
    ActionEvent e = null;
    // Process the listeners last to first, notifying
    // those that are interested in this event
    for (int i = listeners.length-2; i>=0; i-=2) {
        if (listeners[i]==ActionListener.class) {
            // Lazily create the event:
            if (e == null) {
                e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED,
                                    command, mostRecentEventTime,
                                    modifiers);
            }
            ((ActionListener)listeners[i+1]).actionPerformed(e);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:JFileChooser.java


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