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

项目:jdk8u-jdk    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:openjdk-jdk10    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:openjdk9    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:jdk8u_jdk    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:sdk    文件:ConnectionStraight.java   
private MouseEvent convertEvent(MouseEvent e) {
    MouseEvent me = null;
    //workaround for swing utilities removing mouse button when converting events.
    if (e instanceof MouseWheelEvent || e instanceof MenuDragMouseEvent) {
        SwingUtilities.convertMouseEvent(this, e, getDiagram());
    } else {
        Point p = SwingUtilities.convertPoint(this, new Point(e.getX(),
                e.getY()),
                getDiagram());

        me = new MouseEvent(getDiagram(),
                e.getID(),
                e.getWhen(),
                e.getModifiers()
                | e.getModifiersEx(),
                p.x, p.y,
                e.getXOnScreen(),
                e.getYOnScreen(),
                e.getClickCount(),
                e.isPopupTrigger(),
                e.getButton());
    }
    return me;
}
项目:sdk    文件:ConnectionCurve.java   
private MouseEvent convertEvent(MouseEvent e) {
    MouseEvent me = null;
    //workaround for swing utilities removing mouse button when converting events.
    if (e instanceof MouseWheelEvent || e instanceof MenuDragMouseEvent) {
        SwingUtilities.convertMouseEvent(this, e, getDiagram());
    } else {
        Point p = SwingUtilities.convertPoint(this, new Point(e.getX(),
                e.getY()),
                getDiagram());

        me = new MouseEvent(getDiagram(),
                e.getID(),
                e.getWhen(),
                e.getModifiers()
                | e.getModifiersEx(),
                p.x, p.y,
                e.getXOnScreen(),
                e.getYOnScreen(),
                e.getClickCount(),
                e.isPopupTrigger(),
                e.getButton());
    }
    return me;
}
项目:javify    文件:JMenuItem.java   
/**
 * This method fires MenuDragMouseEvents to registered listeners.
 * Different types of MenuDragMouseEvents are fired depending
 * on the observed mouse event.
 *
 * @param event Mouse
 */
public void processMenuDragMouseEvent(MenuDragMouseEvent event)
{
  switch (event.getID())
    {
    case MouseEvent.MOUSE_ENTERED:
      isDragging = false;
      fireMenuDragMouseEntered(event);
      break;
    case MouseEvent.MOUSE_EXITED:
      isDragging = false;
      fireMenuDragMouseExited(event);
      break;
    case MouseEvent.MOUSE_DRAGGED:
      isDragging = true;
      fireMenuDragMouseDragged(event);
      break;
    case MouseEvent.MOUSE_RELEASED:
      if (isDragging)
        fireMenuDragMouseReleased(event);
      break;
    }
}
项目:jvm-stm    文件:JMenuItem.java   
/**
  * This method fires MenuDragMouseEvents to registered listeners.
  * Different types of MenuDragMouseEvents are fired depending
  * on the observed mouse event.
  *
  * @param event Mouse
  */
 public void processMenuDragMouseEvent(MenuDragMouseEvent event)
 {
   switch (event.getID())
     {
     case MouseEvent.MOUSE_ENTERED:
       isDragging = false;
fireMenuDragMouseEntered(event);
break;
     case MouseEvent.MOUSE_EXITED:
       isDragging = false;
fireMenuDragMouseExited(event);
break;
     case MouseEvent.MOUSE_DRAGGED:
       isDragging = true;
fireMenuDragMouseDragged(event);
break;
     case MouseEvent.MOUSE_RELEASED:
       if (isDragging)
         fireMenuDragMouseReleased(event);
break;
     }
 }
项目:infobip-open-jdk-8    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:jdk8u-dev-jdk    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:OLD-OpenJDK8    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:cn1    文件:JMenuItemTest.java   
public void testFireMenuDragMouseEntered() {
    MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
            new MenuElement[0], new MenuSelectionManager());
    ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.fireMenuDragMouseEntered(event1);
    assertEquals("event fired properly ", "entered", listener1.event);
    assertEquals("event fired properly ", "entered", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
    menuItem.fireMenuDragMouseEntered(event1);
    assertEquals("event fired properly ", "entered", listener1.event);
    assertEquals("event fired properly ", "entered", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
}
项目:cn1    文件:JMenuItemTest.java   
public void testFireMenuDragMouseExited() {
    MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
            new MenuElement[0], new MenuSelectionManager());
    ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.fireMenuDragMouseExited(event1);
    assertEquals("event fired properly ", "exited", listener1.event);
    assertEquals("event fired properly ", "exited", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
    menuItem.fireMenuDragMouseExited(event1);
    assertEquals("event fired properly ", "exited", listener1.event);
    assertEquals("event fired properly ", "exited", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
}
项目:JamVM-PH    文件:JMenuItem.java   
/**
  * This method fires MenuDragMouseEvents to registered listeners.
  * Different types of MenuDragMouseEvents are fired depending
  * on the observed mouse event.
  *
  * @param event Mouse
  */
 public void processMenuDragMouseEvent(MenuDragMouseEvent event)
 {
   switch (event.getID())
     {
     case MouseEvent.MOUSE_ENTERED:
       isDragging = false;
fireMenuDragMouseEntered(event);
break;
     case MouseEvent.MOUSE_EXITED:
       isDragging = false;
fireMenuDragMouseExited(event);
break;
     case MouseEvent.MOUSE_DRAGGED:
       isDragging = true;
fireMenuDragMouseDragged(event);
break;
     case MouseEvent.MOUSE_RELEASED:
       if (isDragging)
         fireMenuDragMouseReleased(event);
break;
     }
 }
项目:tools-idea    文件:IdeGlassPaneImpl.java   
private static MouseEvent convertEvent(final MouseEvent e, final Component target) {
  final Point point = SwingUtilities.convertPoint(e.getComponent(), e.getPoint(), target);
  if (e instanceof MouseWheelEvent) {
    final MouseWheelEvent mwe = (MouseWheelEvent)e;
    return new MouseWheelEvent(target, mwe.getID(), mwe.getWhen(), mwe.getModifiersEx(), point.x, point.y, mwe.getClickCount(),
                               mwe.isPopupTrigger(), mwe.getScrollType(), mwe.getScrollAmount(), mwe.getWheelRotation());
  }
  else if (e instanceof MenuDragMouseEvent) {
    final MenuDragMouseEvent de = (MenuDragMouseEvent)e;
    return new MenuDragMouseEvent(target, de.getID(), de.getWhen(), de.getModifiersEx(), point.x, point.y, e.getClickCount(),
                                  e.isPopupTrigger(), de.getPath(), de.getMenuSelectionManager());
  }
  else {
    return new MouseEvent(target, e.getID(), e.getWhen(), e.getModifiersEx(), point.x, point.y, e.getClickCount(), e.isPopupTrigger(),
                          e.getButton());
  }
}
项目:openjdk-jdk7u-jdk    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:classpath    文件:JMenuItem.java   
/**
 * This method fires MenuDragMouseEvents to registered listeners.
 * Different types of MenuDragMouseEvents are fired depending
 * on the observed mouse event.
 *
 * @param event Mouse
 */
public void processMenuDragMouseEvent(MenuDragMouseEvent event)
{
  switch (event.getID())
    {
    case MouseEvent.MOUSE_ENTERED:
      isDragging = false;
      fireMenuDragMouseEntered(event);
      break;
    case MouseEvent.MOUSE_EXITED:
      isDragging = false;
      fireMenuDragMouseExited(event);
      break;
    case MouseEvent.MOUSE_DRAGGED:
      isDragging = true;
      fireMenuDragMouseDragged(event);
      break;
    case MouseEvent.MOUSE_RELEASED:
      if (isDragging)
        fireMenuDragMouseReleased(event);
      break;
    }
}
项目:freeVM    文件:JMenuItemTest.java   
public void testFireMenuDragMouseEntered() {
    MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
            new MenuElement[0], new MenuSelectionManager());
    ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.fireMenuDragMouseEntered(event1);
    assertEquals("event fired properly ", "entered", listener1.event);
    assertEquals("event fired properly ", "entered", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
    menuItem.fireMenuDragMouseEntered(event1);
    assertEquals("event fired properly ", "entered", listener1.event);
    assertEquals("event fired properly ", "entered", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
}
项目:freeVM    文件:JMenuItemTest.java   
public void testFireMenuDragMouseExited() {
    MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
            new MenuElement[0], new MenuSelectionManager());
    ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.fireMenuDragMouseExited(event1);
    assertEquals("event fired properly ", "exited", listener1.event);
    assertEquals("event fired properly ", "exited", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
    menuItem.fireMenuDragMouseExited(event1);
    assertEquals("event fired properly ", "exited", listener1.event);
    assertEquals("event fired properly ", "exited", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
}
项目:freeVM    文件:JMenuItemTest.java   
public void testFireMenuDragMouseEntered() {
    MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
            new MenuElement[0], new MenuSelectionManager());
    ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.fireMenuDragMouseEntered(event1);
    assertEquals("event fired properly ", "entered", listener1.event);
    assertEquals("event fired properly ", "entered", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
    menuItem.fireMenuDragMouseEntered(event1);
    assertEquals("event fired properly ", "entered", listener1.event);
    assertEquals("event fired properly ", "entered", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
}
项目:freeVM    文件:JMenuItemTest.java   
public void testFireMenuDragMouseExited() {
    MenuDragMouseEvent event1 = new MenuDragMouseEvent(menuItem, 0, 0, 0, 0, 0, 0, false,
            new MenuElement[0], new MenuSelectionManager());
    ConcreteMenuDragMouseListener listener1 = new ConcreteMenuDragMouseListener();
    ConcreteMenuDragMouseListener listener2 = new ConcreteMenuDragMouseListener();
    menuItem.addMenuDragMouseListener(listener1);
    menuItem.addMenuDragMouseListener(listener2);
    menuItem.fireMenuDragMouseExited(event1);
    assertEquals("event fired properly ", "exited", listener1.event);
    assertEquals("event fired properly ", "exited", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
    menuItem.fireMenuDragMouseExited(event1);
    assertEquals("event fired properly ", "exited", listener1.event);
    assertEquals("event fired properly ", "exited", listener2.event);
    assertSame("one event fired ", listener1.event, listener2.event);
}
项目:openjdk-icedtea7    文件:bug7170657.java   
public static void main(final String[] args) {
    final int mask = InputEvent.META_DOWN_MASK | InputEvent.CTRL_MASK;

    Frame f = new Frame();

    MouseEvent mwe = new MouseWheelEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                         1, 1, 1);
    MouseEvent mdme = new MenuDragMouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1,
                                             true, null, null);
    MouseEvent me = new MouseEvent(f, 1, 1, mask, 1, 1, 1, 1, 1, true,
                                   MouseEvent.NOBUTTON);

    test(f, mwe);
    test(f, mdme);
    test(f, me);

    if (FAILED) {
        throw new RuntimeException("Wrong mouse event");
    }
}
项目:openjdk-jdk10    文件:JMenuItemOperator.java   
/**
 * Maps {@code JMenuItem.processMenuDragMouseEvent(MenuDragMouseEvent)}
 * through queue
 */
public void processMenuDragMouseEvent(final MenuDragMouseEvent menuDragMouseEvent) {
    runMapping(new MapVoidAction("processMenuDragMouseEvent") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).processMenuDragMouseEvent(menuDragMouseEvent);
        }
    });
}
项目:openjdk9    文件:JMenuItemOperator.java   
/**
 * Maps {@code JMenuItem.processMenuDragMouseEvent(MenuDragMouseEvent)}
 * through queue
 */
public void processMenuDragMouseEvent(final MenuDragMouseEvent menuDragMouseEvent) {
    runMapping(new MapVoidAction("processMenuDragMouseEvent") {
        @Override
        public void map() {
            ((JMenuItem) getSource()).processMenuDragMouseEvent(menuDragMouseEvent);
        }
    });
}
项目:javify    文件:JMenuItem.java   
/**
 * Process mouse events forwarded from MenuSelectionManager.
 *
 * @param ev event forwarded from MenuSelectionManager
 * @param path path to the menu element from which event was generated
 * @param manager MenuSelectionManager for the current menu hierarchy
 */
public void processMouseEvent(MouseEvent ev, MenuElement[] path,
                              MenuSelectionManager manager)
{
  MenuDragMouseEvent e = new MenuDragMouseEvent(ev.getComponent(),
                                                ev.getID(), ev.getWhen(),
                                                ev.getModifiers(), ev.getX(),
                                                ev.getY(),
                                                ev.getClickCount(),
                                                ev.isPopupTrigger(), path,
                                                manager);
  processMenuDragMouseEvent(e);
}
项目:javify    文件:JMenuItem.java   
/**
 * 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);
}
项目:javify    文件:JMenuItem.java   
/**
 * 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);
}
项目:javify    文件:JMenuItem.java   
/**
 * 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);
}
项目:javify    文件:JMenuItem.java   
/**
 * 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);
}
项目:javify    文件:BasicMenuItemUI.java   
/**
 * Tbis method is invoked when mouse was dragged and released inside the
 * menu item.
 *
 * @param e
 *          The MenuDragMouseEvent
 */
public void menuDragMouseReleased(MenuDragMouseEvent e)
{
  MenuSelectionManager manager = e.getMenuSelectionManager();
  int x = e.getX();
  int y = e.getY();
  if (x >= 0 && x < menuItem.getWidth() && y >= 0
      && y < menuItem.getHeight())
    doClick(manager);
  else
    manager.clearSelectedPath();
}
项目:intellij-ce-playground    文件:BegMenuItemUI.java   
public void menuDragMouseReleased(MenuDragMouseEvent e){
  MenuSelectionManager manager=e.getMenuSelectionManager();
  Point p=e.getPoint();
  if(p.x>=0&&p.x<menuItem.getWidth()&&
     p.y>=0&&p.y<menuItem.getHeight()){
    doClick(manager,e);
  } else{
    manager.clearSelectedPath();
  }
}
项目:intellij-ce-playground    文件:MouseEventAdapter.java   
public static MouseEvent convert(MouseEvent event, Component source, int id, long when, int modifiers, int x, int y) {
  if (event instanceof MouseWheelEvent) return convert((MouseWheelEvent)event, source, id, when, modifiers, x, y);
  if (event instanceof MenuDragMouseEvent) return convert((MenuDragMouseEvent)event, source, id, when, modifiers, x, y);
  return new MouseEvent(source, id, when, modifiers, x, y,
                        event.getClickCount(),
                        event.isPopupTrigger(),
                        event.getButton());
}
项目:intellij-ce-playground    文件:MouseEventAdapter.java   
public static MenuDragMouseEvent convert(MenuDragMouseEvent event, Component source, int id, long when, int modifiers, int x, int y) {
  return new MenuDragMouseEvent(source, id, when, modifiers, x, y,
                                event.getClickCount(),
                                event.isPopupTrigger(),
                                event.getPath(),
                                event.getMenuSelectionManager());
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * Process mouse events forwarded from MenuSelectionManager.
 *
 * @param ev event forwarded from MenuSelectionManager
 * @param path path to the menu element from which event was generated
 * @param manager MenuSelectionManager for the current menu hierarchy
 */
public void processMouseEvent(MouseEvent ev, MenuElement[] path,
                              MenuSelectionManager manager)
{
  MenuDragMouseEvent e = new MenuDragMouseEvent(ev.getComponent(),
                                                ev.getID(), ev.getWhen(),
                                                ev.getModifiers(), ev.getX(),
                                                ev.getY(),
                                                ev.getClickCount(),
                                                ev.isPopupTrigger(), path,
                                                manager);
  processMenuDragMouseEvent(e);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * 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);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * 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);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * 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);
}
项目:jvm-stm    文件:JMenuItem.java   
/**
 * 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);
}
项目:jvm-stm    文件:BasicMenuItemUI.java   
/**
 * Tbis method is invoked when mouse was dragged and released inside the
 * menu item.
 * 
 * @param e
 *          The MenuDragMouseEvent
 */
public void menuDragMouseReleased(MenuDragMouseEvent e)
{
  MenuSelectionManager manager = e.getMenuSelectionManager();
  int x = e.getX();
  int y = e.getY();
  if (x >= 0 && x < menuItem.getWidth() && y >= 0
      && y < menuItem.getHeight())
    doClick(manager);
  else
    manager.clearSelectedPath();
}