本文整理汇总了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);
}
}
示例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);
}
示例3: mouseDragged
import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
public void mouseDragged(MouseEvent e)
{
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
manager.processMouseEvent(e);
}
示例4: mouseExited
import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
public void mouseExited(MouseEvent e)
{
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
manager.processMouseEvent(e);
}
示例5: mouseReleased
import javax.swing.MenuSelectionManager; //导入方法依赖的package包/类
public void mouseReleased(MouseEvent e)
{
MenuSelectionManager manager = MenuSelectionManager.defaultManager();
manager.processMouseEvent(e);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}