Class PopupMenuHandler

  • All Implemented Interfaces:
    KeyListener, MouseListener, EventListener

    public class PopupMenuHandler
    extends Object
    implements MouseListener, KeyListener
    A handler which can be registered on components as a mouse listener.

    This handler pops-up a popup menu if the corresponding event is a popup menu trigger on a given platform. The popup-menu is created by the PopupMenuFactory instance passed to the constructor of this class.

    See Also:
    PopupMenuFactory
    • Constructor Detail

      • PopupMenuHandler

        public PopupMenuHandler​(PopupMenuFactory popupMenuFactory)
        Constructs a new pop-up menu handler for th given pop-up menu factory.
        Parameters:
        popupMenuFactory - the factory for the menu, must not be null
    • Method Detail

      • mouseClicked

        public void mouseClicked​(MouseEvent event)
        Invoked when the mouse has been clicked on a component.
        Specified by:
        mouseClicked in interface MouseListener
      • mousePressed

        public void mousePressed​(MouseEvent event)
        Invoked when a mouse button has been pressed on a component.
        Specified by:
        mousePressed in interface MouseListener
      • mouseReleased

        public void mouseReleased​(MouseEvent event)
        Invoked when a mouse button has been released on a component.
        Specified by:
        mouseReleased in interface MouseListener
      • keyPressed

        public void keyPressed​(KeyEvent event)
        Invoked when a key has been pressed.
        Specified by:
        keyPressed in interface KeyListener
      • keyReleased

        public void keyReleased​(KeyEvent event)
        Invoked when a key has been released.
        Specified by:
        keyReleased in interface KeyListener
      • keyTyped

        public void keyTyped​(KeyEvent event)
        Invoked when a key has been typed. This event occurs when a key press is followed by a key release.
        Specified by:
        keyTyped in interface KeyListener