Package docking.event.mouse
Class GMouseListenerAdapter
- java.lang.Object
-
- java.awt.event.MouseAdapter
-
- docking.event.mouse.GMouseListenerAdapter
-
- All Implemented Interfaces:
java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
public class GMouseListenerAdapter extends java.awt.event.MouseAdapter
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
-
-
Constructor Summary
Constructors Constructor Description GMouseListenerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doubleClickTriggered(java.awt.event.MouseEvent e)
Called when a double-click event is discovered.void
mouseClicked(java.awt.event.MouseEvent e)
void
mousePressed(java.awt.event.MouseEvent e)
void
mouseReleased(java.awt.event.MouseEvent e)
void
popupTriggered(java.awt.event.MouseEvent e)
Called when a popup event is discovered.boolean
shouldConsume(java.awt.event.MouseEvent e)
This method is called to ask the client if they wish to consume the given event.
-
-
-
Method Detail
-
shouldConsume
public boolean shouldConsume(java.awt.event.MouseEvent e)
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
public void doubleClickTriggered(java.awt.event.MouseEvent e)
Called when a double-click event is discovered.- Parameters:
e
- the event that triggered the double-click
-
popupTriggered
public void popupTriggered(java.awt.event.MouseEvent e)
Called when a popup event is discovered.- Parameters:
e
- the event that triggered the popup
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classjava.awt.event.MouseAdapter
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classjava.awt.event.MouseAdapter
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Overrides:
mouseClicked
in classjava.awt.event.MouseAdapter
-
-