javax.swing.plaf.basic
Class BasicMenuUI.MouseInputHandler

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler
All Implemented Interfaces:
MouseListener sample code for java.awt.event.MouseListener definition code for java.awt.event.MouseListener , MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener , EventListener sample code for java.util.EventListener definition code for java.util.EventListener , MouseInputListener sample code for javax.swing.event.MouseInputListener definition code for javax.swing.event.MouseInputListener
Enclosing class:
BasicMenuUI sample code for javax.swing.plaf.basic.BasicMenuUI definition code for javax.swing.plaf.basic.BasicMenuUI

protected class BasicMenuUI.MouseInputHandler
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements MouseInputListener sample code for javax.swing.event.MouseInputListener definition code for javax.swing.event.MouseInputListener

Instantiated and used by a menu item to handle the current menu selection from mouse events. A MouseInputHandler processes and forwards all mouse events to a shared instance of the MenuSelectionManager.

This class is protected so that it can be subclassed by other look and feels to implement their own mouse handling behavior. All overridden methods should call the parent methods so that the menu selection is correct.

Since:
1.4
See Also:
MenuSelectionManager sample code for javax.swing.MenuSelectionManager definition code for javax.swing.MenuSelectionManager

Constructor Summary
protected BasicMenuUI.MouseInputHandler sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.BasicMenuUI.MouseInputHandler() definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.BasicMenuUI.MouseInputHandler() ()
           
 
Method Summary
 void mouseClicked sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseClicked(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseClicked(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void mouseDragged sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseDragged(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseDragged(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when a mouse button is pressed on the menu and then dragged.
 void mouseEntered sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseEntered(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseEntered(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the cursor enters the menu.
 void mouseExited sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseExited(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseExited(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the mouse exits a component.
 void mouseMoved sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseMoved(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseMoved(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
 void mousePressed sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mousePressed(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mousePressed(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the mouse has been clicked on the menu.
 void mouseReleased sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseReleased(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseReleased(java.awt.event.MouseEvent) (MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
          Invoked when the mouse has been released on the menu.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

BasicMenuUI.MouseInputHandler sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler() definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler()

protected BasicMenuUI.MouseInputHandler()
Method Detail

mouseClicked sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseClicked(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseClicked(java.awt.event.MouseEvent)

public void mouseClicked(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Description copied from interface: MouseListener sample code for java.awt.event.MouseListener.mouseClicked(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mouseClicked(java.awt.event.MouseEvent)
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked sample code for java.awt.event.MouseListener.mouseClicked(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mouseClicked(java.awt.event.MouseEvent) in interface MouseListener sample code for java.awt.event.MouseListener definition code for java.awt.event.MouseListener

mousePressed sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mousePressed(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mousePressed(java.awt.event.MouseEvent)

public void mousePressed(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Invoked when the mouse has been clicked on the menu. This method clears or sets the selection path of the MenuSelectionManager.

Specified by:
mousePressed sample code for java.awt.event.MouseListener.mousePressed(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mousePressed(java.awt.event.MouseEvent) in interface MouseListener sample code for java.awt.event.MouseListener definition code for java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseReleased sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseReleased(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseReleased(java.awt.event.MouseEvent)

public void mouseReleased(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Invoked when the mouse has been released on the menu. Delegates the mouse event to the MenuSelectionManager.

Specified by:
mouseReleased sample code for java.awt.event.MouseListener.mouseReleased(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mouseReleased(java.awt.event.MouseEvent) in interface MouseListener sample code for java.awt.event.MouseListener definition code for java.awt.event.MouseListener
Parameters:
e - the mouse event

mouseEntered sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseEntered(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseEntered(java.awt.event.MouseEvent)

public void mouseEntered(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Invoked when the cursor enters the menu. This method sets the selected path for the MenuSelectionManager and handles the case in which a menu item is used to pop up an additional menu, as in a hierarchical menu system.

Specified by:
mouseEntered sample code for java.awt.event.MouseListener.mouseEntered(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mouseEntered(java.awt.event.MouseEvent) in interface MouseListener sample code for java.awt.event.MouseListener definition code for java.awt.event.MouseListener
Parameters:
e - the mouse event; not used

mouseExited sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseExited(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseExited(java.awt.event.MouseEvent)

public void mouseExited(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Description copied from interface: MouseListener sample code for java.awt.event.MouseListener.mouseExited(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mouseExited(java.awt.event.MouseEvent)
Invoked when the mouse exits a component.

Specified by:
mouseExited sample code for java.awt.event.MouseListener.mouseExited(java.awt.event.MouseEvent) definition code for java.awt.event.MouseListener.mouseExited(java.awt.event.MouseEvent) in interface MouseListener sample code for java.awt.event.MouseListener definition code for java.awt.event.MouseListener

mouseDragged sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseDragged(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseDragged(java.awt.event.MouseEvent)

public void mouseDragged(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Invoked when a mouse button is pressed on the menu and then dragged. Delegates the mouse event to the MenuSelectionManager.

Specified by:
mouseDragged sample code for java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent) in interface MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener
Parameters:
e - the mouse event
See Also:
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent) sample code for java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)

mouseMoved sample code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseMoved(java.awt.event.MouseEvent) definition code for javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler.mouseMoved(java.awt.event.MouseEvent)

public void mouseMoved(MouseEvent sample code for java.awt.event.MouseEvent definition code for java.awt.event.MouseEvent  e)
Description copied from interface: MouseMotionListener sample code for java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.

Specified by:
mouseMoved sample code for java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent) definition code for java.awt.event.MouseMotionListener.mouseMoved(java.awt.event.MouseEvent) in interface MouseMotionListener sample code for java.awt.event.MouseMotionListener definition code for java.awt.event.MouseMotionListener