info.monitorenter.gui.chart.events
Class PopupListener

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by info.monitorenter.gui.chart.events.PopupListener
All Implemented Interfaces:
MouseListener, EventListener

public final class PopupListener
extends MouseAdapter

A general purpose PopupListener.

It is used to connect JPopupMenu instances with the components retrieved from factory methods (of factory LayoutFactory).

Note that instances have to be registered as a listener on components via Component.addMouseListener(java.awt.event.MouseListener) to make it working.

Version:
$Revision: 1.10 $
Author:
Achim Westermann

Constructor Summary
PopupListener(JPopupMenu popup)
          Creates an instance that will show the given popup upon a right mouse click on a JComponent this instance will be registered as listener to.
 
Method Summary
 MouseEvent getLastPopupMouseEvent()
          Returns the lastPopupMouseEvent.
 JPopupMenu getPopup()
           
static PopupListener lookup(JPopupMenu popup)
          Returns the listener for the given popup or null, if there is no listener for that popup.
 void mousePressed(MouseEvent me)
           
 void mouseReleased(MouseEvent me)
           
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PopupListener

public PopupListener(JPopupMenu popup)
Creates an instance that will show the given popup upon a right mouse click on a JComponent this instance will be registered as listener to.

Parameters:
popup - the popup to show upon a right mouse click on a JComponent this instance will be registered as listener to.
See Also:
Component.addMouseListener(java.awt.event.MouseListener)
Method Detail

lookup

public static PopupListener lookup(JPopupMenu popup)
Returns the listener for the given popup or null, if there is no listener for that popup.

Parameters:
popup - the popup to search the listener for.
Returns:
the listener for the given popup or null, if there is no listener for that popup.

getLastPopupMouseEvent

public final MouseEvent getLastPopupMouseEvent()
Returns the lastPopupMouseEvent.

Returns:
the lastPopupMouseEvent

getPopup

public final JPopupMenu getPopup()
Returns:
the popup menu.

mousePressed

public void mousePressed(MouseEvent me)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class MouseAdapter
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(MouseEvent me)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class MouseAdapter
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)


Copyright © 2001 - 2010 LGPL, All Rights Footloose.