Class HubClientPopupListener

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.util.EventListener

    class HubClientPopupListener
    extends java.lang.Object
    implements java.awt.event.MouseListener
    MouseListener which provides a popup menu with per-client options for use with a JList containing HubClient objects.
    Since:
    8 Jul 2009
    Author:
    Mark Taylor
    • Field Detail

      • PING_MSG

        private static final Message PING_MSG
        Message which does a ping.
    • Constructor Detail

      • HubClientPopupListener

        public HubClientPopupListener​(BasicHubService hub)
        Constructor.
        Parameters:
        hub - hub service which knows about the HubClients contained in the JList this will be listening to
    • Method Detail

      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent evt)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • maybeShowPopup

        private void maybeShowPopup​(java.awt.event.MouseEvent evt)
        Invoked for a MouseEvent which may be a popup menu trigger.
        Parameters:
        evt - popup trigger event candidate
      • createPopup

        private javax.swing.JPopupMenu createPopup​(java.awt.Component parent,
                                                   HubClient client)
        Returns a new popup menu for a given client. The actions on this menu are not dynamic (e.g. do not enable/disable themselves according to changes in the hub status) because the menu is likely to be short-lived.
        Parameters:
        parent - parent component
        client - hub client which the menu will affect
        Returns:
        new popup menu