Package docking.event.mouse
Class GMouseListenerAdapter
java.lang.Object
java.awt.event.MouseAdapter
docking.event.mouse.GMouseListenerAdapter
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener
A mouse listener implementation designed to provide consistent handling of triggers for
popups and double-clicking.
Notes:
- Popup triggers always supersedes double-click actions.
- The stage an action triggers (pressed/released/clicked) is platform dependent.
- Each of the methods mentioned below will be called as appropriate.
- You can override any of these methods to be called for each trigger.
- Normally popups are handled by the framework via custom actions. But, for custom widgets it is sometimes simpler to handle your own popups. This class makes that easier
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when a double-click event is discovered.voidvoidvoidvoidCalled when a popup event is discovered.booleanThis method is called to ask the client if they wish to consume the given event.Methods inherited from class java.awt.event.MouseAdapter
mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved
-
Constructor Details
-
GMouseListenerAdapter
public GMouseListenerAdapter()
-
-
Method Details
-
shouldConsume
This method is called to ask the client if they wish to consume the given event. This allows clients to keep events from propagating to other listeners.- Parameters:
e- the event to potentially consume- Returns:
- true if the event should be consumed
-
doubleClickTriggered
Called when a double-click event is discovered.- Parameters:
e- the event that triggered the double-click
-
popupTriggered
Called when a popup event is discovered.- Parameters:
e- the event that triggered the popup
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classMouseAdapter
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classMouseAdapter
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener- Overrides:
mouseClickedin classMouseAdapter
-