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


Java MenuSelectionManager.processMouseEvent方法代码示例

本文整理汇总了Java中javax.swing.MenuSelectionManager.processMouseEvent方法的典型用法代码示例。如果您正苦于以下问题:Java MenuSelectionManager.processMouseEvent方法的具体用法?Java MenuSelectionManager.processMouseEvent怎么用?Java MenuSelectionManager.processMouseEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.MenuSelectionManager的用法示例。


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

示例1: mouseEntered

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse enters menu item. When this happens menu
 * item is considered to be selected and selection path in
 * MenuSelectionManager is set. This event is also forwarded to
 * MenuSelection Manager for further processing.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mouseEntered(MouseEvent e)
{
  Component source = (Component) e.getSource();
  if (source.getParent() instanceof MenuElement)
    {
      MenuSelectionManager manager = MenuSelectionManager.defaultManager();
      manager.setSelectedPath(getPath());
      manager.processMouseEvent(e);
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:BasicMenuItemUI.java

示例2: mouseReleased

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse is released. If the mouse is released
 * inside this menuItem, then this menu item is considered to be chosen and
 * the menu hierarchy should be closed.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mouseReleased(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  int x = e.getX();
  int y = e.getY();
  if (x > 0 && x < menuItem.getWidth() && y > 0
      && y < menuItem.getHeight())
    {
      doClick(manager);
    }
  else
    manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:22,代码来源:BasicMenuItemUI.java

示例3: mouseDragged

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
public void mouseDragged(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:6,代码来源:BasicMenuUI.java

示例4: mouseExited

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
public void mouseExited(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:6,代码来源:BasicMenuUI.java

示例5: mouseReleased

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
public void mouseReleased(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:6,代码来源:BasicMenuUI.java

示例6: mouseClicked

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse is clicked on the menu item. It forwards
 * this event to MenuSelectionManager.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mouseClicked(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:BasicMenuItemUI.java

示例7: mouseDragged

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse is dragged inside the menu item. It
 * forwards this event to MenuSelectionManager.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mouseDragged(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:BasicMenuItemUI.java

示例8: mouseExited

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse exits menu item. The event is forwarded
 * to MenuSelectionManager for processing.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mouseExited(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:BasicMenuItemUI.java

示例9: mouseMoved

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse is inside the menu item. This event is
 * forwarder to MenuSelectionManager for further processing.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mouseMoved(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:BasicMenuItemUI.java

示例10: mousePressed

import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
/**
 * This method is called when mouse is pressed. This event is forwarded to
 * MenuSelectionManager for further processing.
 *
 * @param e
 *          A {@link MouseEvent}.
 */
public void mousePressed(MouseEvent e)
{
  MenuSelectionManager manager = MenuSelectionManager.defaultManager();
  manager.processMouseEvent(e);
}
 
开发者ID:vilie,项目名称:javify,代码行数:13,代码来源:BasicMenuItemUI.java


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