當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。