Java 类javax.swing.event.MenuKeyListener 实例源码

项目:cn1    文件:JMenuItemTest.java   
public void testAddGetRemoveMenuKeyListener() {
    MenuKeyListener listener1 = new ConcreteMenuKeyListener();
    MenuKeyListener listener2 = new ConcreteMenuKeyListener();
    MenuKeyListener listener3 = new ConcreteMenuKeyListener();
    EventListener[] listenersArray = null;
    listenersArray = menuItem.getMenuKeyListeners();
    int initialValue = listenersArray.length;
    menuItem.addMenuKeyListener(listener1);
    menuItem.addMenuKeyListener(listener2);
    menuItem.addMenuKeyListener(listener2);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 3, listenersArray.length);
    menuItem.removeMenuKeyListener(listener1);
    menuItem.addMenuKeyListener(listener3);
    menuItem.addMenuKeyListener(listener3);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 4, listenersArray.length);
    menuItem.removeMenuKeyListener(listener3);
    menuItem.removeMenuKeyListener(listener3);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 2, listenersArray.length);
    menuItem.removeMenuKeyListener(listener2);
    menuItem.removeMenuKeyListener(listener2);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue, listenersArray.length);
}
项目:freeVM    文件:JMenuItemTest.java   
public void testAddGetRemoveMenuKeyListener() {
    MenuKeyListener listener1 = new ConcreteMenuKeyListener();
    MenuKeyListener listener2 = new ConcreteMenuKeyListener();
    MenuKeyListener listener3 = new ConcreteMenuKeyListener();
    EventListener[] listenersArray = null;
    listenersArray = menuItem.getMenuKeyListeners();
    int initialValue = listenersArray.length;
    menuItem.addMenuKeyListener(listener1);
    menuItem.addMenuKeyListener(listener2);
    menuItem.addMenuKeyListener(listener2);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 3, listenersArray.length);
    menuItem.removeMenuKeyListener(listener1);
    menuItem.addMenuKeyListener(listener3);
    menuItem.addMenuKeyListener(listener3);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 4, listenersArray.length);
    menuItem.removeMenuKeyListener(listener3);
    menuItem.removeMenuKeyListener(listener3);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 2, listenersArray.length);
    menuItem.removeMenuKeyListener(listener2);
    menuItem.removeMenuKeyListener(listener2);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue, listenersArray.length);
}
项目:freeVM    文件:JMenuItemTest.java   
public void testAddGetRemoveMenuKeyListener() {
    MenuKeyListener listener1 = new ConcreteMenuKeyListener();
    MenuKeyListener listener2 = new ConcreteMenuKeyListener();
    MenuKeyListener listener3 = new ConcreteMenuKeyListener();
    EventListener[] listenersArray = null;
    listenersArray = menuItem.getMenuKeyListeners();
    int initialValue = listenersArray.length;
    menuItem.addMenuKeyListener(listener1);
    menuItem.addMenuKeyListener(listener2);
    menuItem.addMenuKeyListener(listener2);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 3, listenersArray.length);
    menuItem.removeMenuKeyListener(listener1);
    menuItem.addMenuKeyListener(listener3);
    menuItem.addMenuKeyListener(listener3);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 4, listenersArray.length);
    menuItem.removeMenuKeyListener(listener3);
    menuItem.removeMenuKeyListener(listener3);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue + 2, listenersArray.length);
    menuItem.removeMenuKeyListener(listener2);
    menuItem.removeMenuKeyListener(listener2);
    listenersArray = menuItem.getMenuKeyListeners();
    assertEquals(initialValue, listenersArray.length);
}
项目:openjdk-jdk10    文件:JMenuItemOperator.java   
/**
 * Maps {@code JMenuItem.addMenuKeyListener(MenuKeyListener)} through queue
 */
public void addMenuKeyListener(final MenuKeyListener menuKeyListener) {
    runMapping(new MapVoidAction("addMenuKeyListener") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).addMenuKeyListener(menuKeyListener);
        }
    });
}
项目:openjdk-jdk10    文件:JMenuItemOperator.java   
/**
 * Maps {@code JMenuItem.removeMenuKeyListener(MenuKeyListener)}
 * through queue
 */
public void removeMenuKeyListener(final MenuKeyListener menuKeyListener) {
    runMapping(new MapVoidAction("removeMenuKeyListener") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).removeMenuKeyListener(menuKeyListener);
        }
    });
}
项目:openjdk9    文件:JMenuItemOperator.java   
/**
 * Maps {@code JMenuItem.addMenuKeyListener(MenuKeyListener)} through queue
 */
public void addMenuKeyListener(final MenuKeyListener menuKeyListener) {
    runMapping(new MapVoidAction("addMenuKeyListener") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).addMenuKeyListener(menuKeyListener);
        }
    });
}
项目:openjdk9    文件:JMenuItemOperator.java   
/**
 * Maps {@code JMenuItem.removeMenuKeyListener(MenuKeyListener)}
 * through queue
 */
public void removeMenuKeyListener(final MenuKeyListener menuKeyListener) {
    runMapping(new MapVoidAction("removeMenuKeyListener") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).removeMenuKeyListener(menuKeyListener);
        }
    });
}
项目:j2se_for_android    文件:JPopupMenu.java   
private void fireMenuKeyPressed(MenuKeyEvent event) {
    Object[] listeners = list.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == MenuKeyListener.class) {
            ((MenuKeyListener) listeners[i + 1]).menuKeyPressed(event);
        }
    }
}
项目:j2se_for_android    文件:JPopupMenu.java   
private void fireMenuKeyReleased(MenuKeyEvent event) {
    Object[] listeners = list.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == MenuKeyListener.class) {
            ((MenuKeyListener) listeners[i + 1]).menuKeyReleased(event);
        }
    }
}
项目:j2se_for_android    文件:JPopupMenu.java   
private void fireMenuKeyTyped(MenuKeyEvent event) {
    Object[] listeners = list.getListenerList();
    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == MenuKeyListener.class) {
            ((MenuKeyListener) listeners[i + 1]).menuKeyTyped(event);
        }
    }
}
项目:javify    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was pressed
 */
protected void fireMenuKeyPressed(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyPressed(event);
}
项目:javify    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was released
 */
protected void fireMenuKeyReleased(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:javify    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was typed.
 *        The key is typed when it was pressed and then released
 */
protected void fireMenuKeyTyped(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was pressed
 */
protected void fireMenuKeyPressed(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyPressed(event);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was released
 */
protected void fireMenuKeyReleased(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was typed.
 *        The key is typed when it was pressed and then released
 */
protected void fireMenuKeyTyped(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:JamVM-PH    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was pressed
 */
protected void fireMenuKeyPressed(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyPressed(event);
}
项目:JamVM-PH    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was released
 */
protected void fireMenuKeyReleased(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:JamVM-PH    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was typed.
 *        The key is typed when it was pressed and then released
 */
protected void fireMenuKeyTyped(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:classpath    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was pressed
 */
protected void fireMenuKeyPressed(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyPressed(event);
}
项目:classpath    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was released
 */
protected void fireMenuKeyReleased(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:classpath    文件:JMenuItem.java   
/**
 * This method fires a MenuKeyEvent to all the MenuItem's MenuKeyListeners.
 *
 * @param event The event signifying that key associated with this menu was typed.
 *        The key is typed when it was pressed and then released
 */
protected void fireMenuKeyTyped(MenuKeyEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuKeyListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuKeyListener) ll[i]).menuKeyTyped(event);
}
项目:freecol    文件:FreeColAction.java   
public MenuKeyListener getMenuKeyListener() {
    return new InnerMenuKeyListener();
}
项目:FreeCol    文件:FreeColAction.java   
public MenuKeyListener getMenuKeyListener() {
    return new InnerMenuKeyListener();
}
项目:j2se_for_android    文件:JMenuItem.java   
public void addMenuKeyListener(MenuKeyListener l) {
}
项目:j2se_for_android    文件:JMenuItem.java   
public void removeMenuKeyListener(MenuKeyListener l) {
}
项目:j2se_for_android    文件:JMenuItem.java   
public MenuKeyListener[] getMenuKeyListeners() {
    return list.getListeners(MenuKeyListener.class);
}
项目:j2se_for_android    文件:JPopupMenu.java   
public void addMenuKeyListener(MenuKeyListener l) {
    list.add(MenuKeyListener.class, l);
}
项目:j2se_for_android    文件:JPopupMenu.java   
public void removeMenuKeyListener(MenuKeyListener l) {
    list.remove(MenuKeyListener.class, l);
}
项目:j2se_for_android    文件:JPopupMenu.java   
public MenuKeyListener[] getMenuKeyListeners() {
    return list.getListeners(MenuKeyListener.class);
}
项目:japura-gui    文件:AbstractComboBox.java   
public Popup() {
  for (MenuKeyListener l : getMenuKeyListeners()) {
    removeMenuKeyListener(l);
  }
}
项目:cn1    文件:JMenuItem.java   
protected void fireMenuKeyPressed(final MenuKeyEvent event) {
    final MenuKeyListener[] listeners = getMenuKeyListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuKeyPressed(event);
    }
}
项目:cn1    文件:JMenuItem.java   
protected void fireMenuKeyReleased(final MenuKeyEvent event) {
    final MenuKeyListener[] listeners = getMenuKeyListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuKeyReleased(event);
    }
}
项目:cn1    文件:JMenuItem.java   
protected void fireMenuKeyTyped(final MenuKeyEvent event) {
    final MenuKeyListener[] listeners = getMenuKeyListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuKeyTyped(event);
    }
}
项目:cn1    文件:JMenuItem.java   
public void addMenuKeyListener(final MenuKeyListener listener) {
    listenerList.add(MenuKeyListener.class, listener);
}
项目:cn1    文件:JMenuItem.java   
public void removeMenuKeyListener(final MenuKeyListener listener) {
    listenerList.remove(MenuKeyListener.class, listener);
}
项目:cn1    文件:JMenuItem.java   
public MenuKeyListener[] getMenuKeyListeners() {
    return (MenuKeyListener[])getListeners(MenuKeyListener.class);
}
项目:cn1    文件:BasicMenuItemUI.java   
protected MenuKeyListener createMenuKeyListener(final JComponent c) {
    return null;
}
项目:tools-idea    文件:IdeaMenuUI.java   
protected MenuKeyListener createMenuKeyListener(JComponent c){
  if (Patches.SUN_BUG_ID_4738042) {
    return new SUN_BUG_ID_4738042_Patch();
  }
  return super.createMenuKeyListener(c);
}
项目:freeVM    文件:JMenuItem.java   
protected void fireMenuKeyPressed(final MenuKeyEvent event) {
    final MenuKeyListener[] listeners = getMenuKeyListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuKeyPressed(event);
    }
}