java.awt.event.InputEvent#getWhen()源码实例Demo

下面列出了java.awt.event.InputEvent#getWhen() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: dragonwell8_jdk   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码2 项目: TencentKona-8   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码3 项目: jdk8u60   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码4 项目: openjdk-jdk8u   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
/**
 * 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);
    }
}
 
源代码6 项目: Bytecoder   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码7 项目: openjdk-jdk9   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码8 项目: IntelliJ-Key-Promoter-X   文件: KeyPromoter.java
@Override
public void beforeActionPerformed(@NotNull AnAction action, @NotNull DataContext dataContext, AnActionEvent event) {
  final InputEvent input = event.getInputEvent();
  if (input instanceof MouseEvent) {
    // The following is a hack to work around an issue with IDEA, where certain events arrive
    // twice. See https://youtrack.jetbrains.com/issue/IDEA-219133
    if (input.getWhen() != 0 && lastEventTime == input.getWhen()) {
      return;
    }
    lastEventTime = input.getWhen();

    final String place = event.getPlace();
    KeyPromoterAction kpAction;
    if ("MainMenu".equals(place)) {
      if (keyPromoterSettings.isMenusEnabled()) {
        kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.MENU_ENTRY);
        showTip(kpAction);
      }
    } else if ("MainToolbar".equals(place)) {
      if (keyPromoterSettings.isToolbarButtonsEnabled()) {
        kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.MAIN_TOOLBAR);
        showTip(kpAction);
      }
    } else if (place.matches(".*Popup")) {
      if (keyPromoterSettings.isEditorPopupEnabled()) {
        kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.POPUP);
        showTip(kpAction);
      }
    } else if (keyPromoterSettings.isAllButtonsEnabled()) {
      kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.OTHER);
      showTip(kpAction);
    }
  }
}
 
源代码9 项目: jdk8u-jdk   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码10 项目: hottub   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码11 项目: openjdk-8-source   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码12 项目: visualvm   文件: HTMLView.java
private void invokeDefaultAction(URL url, InputEvent e) {
    HeapViewerNode node = nodeForURL(url, context);
    if (node == null) return;

    HeapViewerNodeAction.Actions nodeActions = HeapViewerNodeAction.Actions.forNode(node, actionProviders, context, actions);
    ActionEvent ae = e == null ? new ActionEvent(htmlComponent, ActionEvent.ACTION_PERFORMED, "link"): // NO18N
                                 new ActionEvent(e.getSource(), e.getID(), "link", e.getWhen(), e.getModifiers()); // NO18N
    nodeActions.performDefaultAction(ae);
}
 
源代码13 项目: visualvm   文件: HTMLView.java
private void invokeMiddleButtonAction(URL url, InputEvent e) {
    HeapViewerNode node = nodeForURL(url, context);
    if (node == null) return;

    HeapViewerNodeAction.Actions nodeActions = HeapViewerNodeAction.Actions.forNode(node, actionProviders, context, actions);
    ActionEvent ae = new ActionEvent(e.getSource(), e.getID(), "middle button", e.getWhen(), e.getModifiers()); // NO18N
    nodeActions.performMiddleButtonAction(ae);
}
 
源代码14 项目: openjdk-8   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码15 项目: jdk8u_jdk   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码16 项目: jdk8u-jdk   文件: GlobalCursorManager.java
/**
 * 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);
    }
}
 
源代码17 项目: jdk8u-dev-jdk   文件: GlobalCursorManager.java
/**
 * 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);
    }
}