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


Java MenuDragMouseListener类代码示例

本文整理汇总了Java中javax.swing.event.MenuDragMouseListener的典型用法代码示例。如果您正苦于以下问题:Java MenuDragMouseListener类的具体用法?Java MenuDragMouseListener怎么用?Java MenuDragMouseListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: testAddGetRemoveMenuDragMouseListener

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
public void testAddGetRemoveMenuDragMouseListener() {
    MenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    MenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    MenuDragMouseListener listener3 = new ConcreteMenuDragMouseListener();
    EventListener[] listenersArray = null;
    listenersArray = menuItem.getMenuDragMouseListeners();
    int initialValue = listenersArray.length;
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.addMenuDragMouseListener(listener2);
    listenersArray = menuItem.getMenuDragMouseListeners();
    assertEquals(initialValue + 3, listenersArray.length);
    menuItem.removeMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener3);
    menuItem.addMenuDragMouseListener(listener3);
    listenersArray = menuItem.getMenuDragMouseListeners();
    assertEquals(initialValue + 4, listenersArray.length);
    menuItem.removeMenuDragMouseListener(listener3);
    menuItem.removeMenuDragMouseListener(listener3);
    listenersArray = menuItem.getMenuDragMouseListeners();
    assertEquals(initialValue + 2, listenersArray.length);
    menuItem.removeMenuDragMouseListener(listener2);
    menuItem.removeMenuDragMouseListener(listener2);
    listenersArray = menuItem.getMenuDragMouseListeners();
    assertEquals(initialValue, listenersArray.length);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:27,代码来源:JMenuItemTest.java

示例2: addMenuDragMouseListener

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
/**
 * Maps
 * {@code JMenuItem.addMenuDragMouseListener(MenuDragMouseListener)}
 * through queue
 */
public void addMenuDragMouseListener(final MenuDragMouseListener menuDragMouseListener) {
    runMapping(new MapVoidAction("addMenuDragMouseListener") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).addMenuDragMouseListener(menuDragMouseListener);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JMenuItemOperator.java

示例3: removeMenuDragMouseListener

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
/**
 * Maps
 * {@code JMenuItem.removeMenuDragMouseListener(MenuDragMouseListener)}
 * through queue
 */
public void removeMenuDragMouseListener(final MenuDragMouseListener menuDragMouseListener) {
    runMapping(new MapVoidAction("removeMenuDragMouseListener") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).removeMenuDragMouseListener(menuDragMouseListener);
        }
    });
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JMenuItemOperator.java

示例4: fireMenuDragMouseEntered

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
/**
 * Fires MenuDragMouseEvent to all of the menuItem's MouseInputListeners.
 *
 * @param event The event signifying that mouse entered menuItem while it was dragged
 */
protected void fireMenuDragMouseEntered(MenuDragMouseEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuDragMouseListener) ll[i]).menuDragMouseEntered(event);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:JMenuItem.java

示例5: fireMenuDragMouseExited

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
/**
 * Fires MenuDragMouseEvent to all of the menuItem's MouseInputListeners.
 *
 * @param event The event signifying that mouse has exited menu item, while it was dragged
 */
protected void fireMenuDragMouseExited(MenuDragMouseEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuDragMouseListener) ll[i]).menuDragMouseExited(event);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:JMenuItem.java

示例6: fireMenuDragMouseDragged

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
/**
 * Fires MenuDragMouseEvent to all of the menuItem's MouseInputListeners.
 *
 * @param event The event signifying that mouse is being dragged over the menuItem
 */
protected void fireMenuDragMouseDragged(MenuDragMouseEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuDragMouseListener) ll[i]).menuDragMouseDragged(event);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:JMenuItem.java

示例7: fireMenuDragMouseReleased

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
/**
 * This method fires a MenuDragMouseEvent to all the MenuItem's MouseInputListeners.
 *
 * @param event The event signifying that mouse was released while it was dragged over the menuItem
 */
protected void fireMenuDragMouseReleased(MenuDragMouseEvent event)
{
  EventListener[] ll = listenerList.getListeners(MenuDragMouseListener.class);

  for (int i = 0; i < ll.length; i++)
    ((MenuDragMouseListener) ll[i]).menuDragMouseReleased(event);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:JMenuItem.java

示例8: addMenuDragMouseListener

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
public void addMenuDragMouseListener(MenuDragMouseListener l) {
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:3,代码来源:JMenuItem.java

示例9: removeMenuDragMouseListener

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
public void removeMenuDragMouseListener(MenuDragMouseListener l) {
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:3,代码来源:JMenuItem.java

示例10: getMenuDragMouseListeners

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
public MenuDragMouseListener[] getMenuDragMouseListeners() {
	return list.getListeners(MenuDragMouseListener.class);
}
 
开发者ID:javalovercn,项目名称:j2se_for_android,代码行数:4,代码来源:JMenuItem.java

示例11: createMenuDragMouseListener

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
protected MenuDragMouseListener createMenuDragMouseListener(JComponent c){
  return new MyMenuDragMouseHandler();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:BegMenuItemUI.java

示例12: fireMenuDragMouseEntered

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
protected void fireMenuDragMouseEntered(final MenuDragMouseEvent event) {
    final MenuDragMouseListener[] listeners = getMenuDragMouseListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuDragMouseEntered(event);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:JMenuItem.java

示例13: fireMenuDragMouseExited

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
protected void fireMenuDragMouseExited(final MenuDragMouseEvent event) {
    final MenuDragMouseListener[] listeners = getMenuDragMouseListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuDragMouseExited(event);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:JMenuItem.java

示例14: fireMenuDragMouseDragged

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
protected void fireMenuDragMouseDragged(final MenuDragMouseEvent event) {
    final MenuDragMouseListener[] listeners = getMenuDragMouseListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuDragMouseDragged(event);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:JMenuItem.java

示例15: fireMenuDragMouseReleased

import javax.swing.event.MenuDragMouseListener; //导入依赖的package包/类
protected void fireMenuDragMouseReleased(final MenuDragMouseEvent event) {
    final MenuDragMouseListener[] listeners = getMenuDragMouseListeners();
    for (int i = 0; i < listeners.length; i++) {
        listeners[i].menuDragMouseReleased(event);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:7,代码来源:JMenuItem.java


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