Java Code Examples for java.awt.event.InputEvent.getWhen()

The following are Jave code examples for showing how to use getWhen() of the java.awt.event.InputEvent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: OpenJSharp   File: GlobalCursorManager.java   View Source Code Vote up 5 votes
/**
 * Should be called in response to Java MOUSE_MOVED events. The update
 * will be discarded if the InputEvent is outdated.
 *
 * @param   e the InputEvent which triggered the cursor update.
 */
public void updateCursorImmediately(InputEvent e) {
    boolean shouldUpdate;
    synchronized (lastUpdateLock) {
        shouldUpdate = (e.getWhen() >= lastUpdateMillis);
    }
    if (shouldUpdate) {
        _updateCursor(true);
    }
}
 
Example 2
Project: jdk8u-jdk   File: GlobalCursorManager.java   View Source Code Vote up 5 votes
/**
 * Should be called in response to Java MOUSE_MOVED events. The update
 * will be discarded if the InputEvent is outdated.
 *
 * @param   e the InputEvent which triggered the cursor update.
 */
public void updateCursorImmediately(InputEvent e) {
    boolean shouldUpdate;
    synchronized (lastUpdateLock) {
        shouldUpdate = (e.getWhen() >= lastUpdateMillis);
    }
    if (shouldUpdate) {
        _updateCursor(true);
    }
}
 
Example 3
Project: openjdk-jdk10   File: GlobalCursorManager.java   View Source Code Vote up 5 votes
/**
 * Should be called in response to Java MOUSE_MOVED events. The update
 * will be discarded if the InputEvent is outdated.
 *
 * @param   e the InputEvent which triggered the cursor update.
 */
public void updateCursorImmediately(InputEvent e) {
    boolean shouldUpdate;
    synchronized (lastUpdateLock) {
        shouldUpdate = (e.getWhen() >= lastUpdateMillis);
    }
    if (shouldUpdate) {
        _updateCursor(true);
    }
}