public abstract class MouseHandler
extends java.awt.event.MouseAdapter
Modifier and Type | Class and Description |
---|---|
private static class |
MouseHandler.ContextContainer
Simple container that stores and returns a context-local instance of
the global work area.
|
private static class |
MouseHandler.WorkArea
Container for mouse-related data.
|
Modifier and Type | Field and Description |
---|---|
protected EmulatedWindowState |
ews
The GUI window emulator with which this mouse handler is registered.
|
private static MouseHandler.ContextContainer |
local
Context-local data for this mouse-handler.
|
protected ThinClient |
tc
Access to
ThinClient . |
Constructor and Description |
---|
MouseHandler()
Create a new mouse handler, for the specified window emulator.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
applyMouseEvent(Widget<GuiOutputManager> mouseSource,
java.awt.event.MouseEvent evt)
Apply the specified mouse event to the specified source.
|
protected static boolean |
canProcessMouse()
Determine if mouse events can be processed.
|
static boolean |
captureMouseEvents(boolean state)
Enable or disable capture of mouse events.
|
static MouseWidgetAction |
deregisterTooltipWorker(int wId)
Deregisters the specified widget for tooltip worker events.
|
static void |
deregisterWidget(int wid)
Deregister the specified widget for mouse events.
|
static java.util.Set<java.lang.Integer> |
getWidgetActions(int widgetId)
Get the
event IDs for all actions registered with the
specified widget. |
static java.lang.Integer[] |
getWidgetListForTooltipWorkers()
Getting the list of the widgets with registered tooltip workers.
|
static void |
handleMouseEvent(int sourceID,
java.awt.event.MouseEvent evt)
Handle the specified event, in the context of the specified widget.
|
static boolean |
hasAnyAction(int widgetId)
Determine if the specified widget is registered to listen for any mouse action.
|
static void |
listenAnyMouseEvent(int wid,
long when)
Notify the widget of any mouse events, generated after the given timestamp (in millis).
|
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 moved event.
|
private static void |
processAnywhereActions(java.awt.event.MouseEvent evt)
Notify all widgets listening for any mouse events.
|
protected static void |
processWidgetActions(int sourceID,
java.awt.event.MouseEvent evt)
Process the mouse actions registered for the specified source.
|
static void |
registerWidgetAction(int wid,
MouseWidgetAction action)
Register the specified mouse action with the specified widget.
|
void |
setWindow(EmulatedWindowState ews)
Set the window on which this mouse handler acts.
|
private static final MouseHandler.ContextContainer local
protected EmulatedWindowState ews
protected final ThinClient tc
ThinClient
.public MouseHandler()
public static boolean captureMouseEvents(boolean state)
state
- true
to capture mouse events, false
to ignore them.public static void listenAnyMouseEvent(int wid, long when)
wid
- The widget to be notified.when
- Only events generated after this timestamp will be notified.public static void registerWidgetAction(int wid, MouseWidgetAction action)
wid
- The widget ID.action
- The action to be triggered for this widget, via mouse.public static void deregisterWidget(int wid)
wid
- The widget ID.public static java.lang.Integer[] getWidgetListForTooltipWorkers()
public static MouseWidgetAction deregisterTooltipWorker(int wId)
wId
- The widget ID.null
if
the tooltip worker was not registered for this widget.public static void handleMouseEvent(int sourceID, java.awt.event.MouseEvent evt)
sourceID
- The source widget ID.evt
- The mouse event.public static java.util.Set<java.lang.Integer> getWidgetActions(int widgetId)
event IDs
for all actions registered with the
specified widget.widgetId
- The widget ID.public static boolean hasAnyAction(int widgetId)
widgetId
- The widget ID.true
if the widget ID is registered in the
MouseHandler.WorkArea.anyActions
map.protected static void applyMouseEvent(Widget<GuiOutputManager> mouseSource, java.awt.event.MouseEvent evt)
mouseSource
- The mouse source.evt
- The mouse event.private static void processAnywhereActions(java.awt.event.MouseEvent evt)
evt
- The mouse event.protected static void processWidgetActions(int sourceID, java.awt.event.MouseEvent evt)
sourceID
- The source widget ID.evt
- The mouse event.public void setWindow(EmulatedWindowState ews)
ews
- The window.public void mouseClicked(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mousePressed(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mouseDragged(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mouseReleased(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mouseExited(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mouseEntered(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mouseMoved(java.awt.event.MouseEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class java.awt.event.MouseAdapter
e
- The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
ThinClient.postMouseEvent(java.awt.event.MouseEvent, int)
only if mouse processing is active.mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class java.awt.event.MouseAdapter
e
- The mouse event.protected static boolean canProcessMouse()