Class PopupListener
java.lang.Object
java.awt.event.MouseAdapter
info.monitorenter.gui.chart.events.PopupListener
- All Implemented Interfaces:
MouseListener
,MouseMotionListener
,MouseWheelListener
,EventListener
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
ConstructorsConstructorDescriptionPopupListener
(JPopupMenu popup) Creates an instance that will show the given popup upon a right mouse click on aJComponent
this instance will be registered as listener to. -
Method Summary
Modifier and TypeMethodDescriptionfinal MouseEvent
Returns the lastPopupMouseEvent.final 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
void
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
-
Constructor Details
-
PopupListener
Creates an instance that will show the given popup upon a right mouse click on aJComponent
this instance will be registered as listener to.- Parameters:
popup
- the popup to show upon a right mouse click on aJComponent
this instance will be registered as listener to.- See Also:
-
-
Method Details
-
lookup
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
Returns the lastPopupMouseEvent.- Returns:
- the lastPopupMouseEvent
-
getPopup
- Returns:
- the popup menu.
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classMouseAdapter
- See Also:
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classMouseAdapter
- See Also:
-