本文整理匯總了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);
}