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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when a double-click event is discovered.void
void
void
void
Called when a popup event is discovered.boolean
This 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:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classMouseAdapter
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
- Overrides:
mouseReleased
in classMouseAdapter
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
- Overrides:
mouseClicked
in classMouseAdapter
-