edu.rice.cs.util.swing
Class RightClickMouseAdapter
java.lang.Object
java.awt.event.MouseAdapter
edu.rice.cs.util.swing.RightClickMouseAdapter
- All Implemented Interfaces:
- MouseListener, MouseMotionListener, MouseWheelListener, EventListener
- Direct Known Subclasses:
- RegionsListPanel.RegionMouseAdapter, RegionsTreePanel.RegionMouseAdapter
public abstract class RightClickMouseAdapter
- extends MouseAdapter
Abstract mouse listener that supports showing a popup menu.
If subclasses override mousePressed() or mouseReleased(), they should
first call the superclass method so that the popup will be shown correctly.
Because of platform differences, we must check for popup trigger both
when the mouse is pressed and when it is released.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RightClickMouseAdapter
public RightClickMouseAdapter()
_popupAction
protected abstract void _popupAction(MouseEvent e)
- Performs the action when the popup trigger is received.
Generally shows a popup context menu.
- Parameters:
e
- the MouseEvent that is a popup trigger
mousePressed
public void mousePressed(MouseEvent e)
- Signals that the mouse has been pressed.
- Specified by:
mousePressed
in interface MouseListener
- Overrides:
mousePressed
in class MouseAdapter
- Parameters:
e
- the MouseEvent that just occurred
mouseReleased
public void mouseReleased(MouseEvent e)
- Signals that the mouse has been released.
- Specified by:
mouseReleased
in interface MouseListener
- Overrides:
mouseReleased
in class MouseAdapter
- Parameters:
e
- the MouseEvent that just occurred