public class SwingMouseHandler extends MouseHandler
| Modifier and Type | Class and Description |
|---|---|
private static class |
SwingMouseHandler.WorkArea
Container for mouse-related data.
|
| Modifier and Type | Field and Description |
|---|---|
private java.awt.event.MouseEvent |
delayedMouseExited
Delayed mouseExited event.
|
private Widget<?> |
lastHoveredWidget
The last widget over which the mouse was moved.
|
private static ContextLocal<SwingMouseHandler.WorkArea> |
local
Context-local data for this mouse-handler.
|
private static java.awt.Point |
pointerLocation
Current mouse pointer location
|
private boolean |
pressed
Pressed flag.
|
ews, tc| Constructor and Description |
|---|
SwingMouseHandler() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
deregisterActions(java.util.Collection<MouseHoverAction> toRemove)
Remove all mouse actions provided in the argument list.
|
(package private) static void |
deregisterWidgetActions(int wid)
Deregister the complex actions for the specified widget ID.
|
private Widget<?> |
findMouseSource(java.awt.event.MouseEvent e)
Find the mouse source on which the specified event will act, based on coordinates.
|
Widget<?> |
getDropCandidate()
Returns the widget that can be considered as candidate for drop operation.
|
static java.awt.Point |
getPointerLocation()
Retrieves the current location of the mouse pointer.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Notification of a mouse dragged event.
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Notification of a mouse entered event.
|
void |
mouseExited(java.awt.event.MouseEvent e)
Notification of a mouse exited event.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Notification of a mouse moved event.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Notification of a mouse pressed event.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Notification of a mouse released event.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Notification of a mouse wheel event.
|
private boolean |
processAction(java.awt.event.MouseEvent e)
Determine the widget which will react on the specified event and process any actions
associated with it.
|
private boolean |
processAction(Widget<?> widget,
java.awt.event.MouseEvent e)
Process any actions for the given widget and event.
|
(package private) static void |
registerAction(int wid,
MouseWidgetAction action)
Register a complex action for the specified widget ID.
|
applyMouseEvent, canProcessMouse, captureMouseEvents, deregisterTooltipWorker, deregisterWidget, getCachedActions, getWidgetActions, getWidgetListForTooltipWorkers, handleMouseEvent, processWidgetActions, registerWidgetAction, setWindowprivate static java.awt.Point pointerLocation
private static final ContextLocal<SwingMouseHandler.WorkArea> local
private Widget<?> lastHoveredWidget
private boolean pressed
private java.awt.event.MouseEvent delayedMouseExited
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenermouseClicked in class MouseHandlere - The mouse event.public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenermousePressed in class MouseHandlere - The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class MouseHandlere - The mouse event.public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenermouseEntered in class MouseHandlere - The mouse event.public void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenermouseExited in class MouseHandlere - The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved in interface java.awt.event.MouseWheelListenermouseWheelMoved in class MouseHandlere - The mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class MouseHandlere - The mouse event.public void mouseMoved(java.awt.event.MouseEvent e)
If the hovered widget has changed, it will raise MouseEvent.MOUSE_EXITED and
MouseEvent.MOUSE_ENTERED events instead of MouseEvent.MOUSE_MOVED.
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class MouseHandlere - The mouse event.public Widget<?> getDropCandidate()
static final void deregisterWidgetActions(int wid)
wid - The widget ID.static final void deregisterActions(java.util.Collection<MouseHoverAction> toRemove)
toRemove - actions to removestatic final void registerAction(int wid,
MouseWidgetAction action)
Use this method (instead of the
MouseHandler.registerWidgetAction(int, MouseWidgetAction)) to register
actions to Swing GUI-specific action map, i.e. the actions will be ignored
by other drivers.
wid - The widget ID.action - The mouse action.private Widget<?> findMouseSource(java.awt.event.MouseEvent e)
e - The event.TitledWindow.findMouseSource(com.goldencode.p2j.ui.client.event.MouseEvt).private boolean processAction(java.awt.event.MouseEvent e)
e - The mouse event.private boolean processAction(Widget<?> widget, java.awt.event.MouseEvent e)
widget - The widget. If null, it will be determined by
findMouseSource(java.awt.event.MouseEvent).e - The mouse event.true if at least one action was executedpublic static java.awt.Point getPointerLocation()
Point representing the mouse pointer's coordinates on the screen.