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.
|
private static CentralLogger |
LOG
Logger
|
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(java.awt.event.MouseEvent evt)
Determine if mouse events can be processed.
|
static boolean |
captureMouseEvents(boolean state)
Enable or disable capture of mouse events.
|
static MouseWidgetAction |
deregisterTooltipWorker(int wId)
Deregister the specified widget for tooltip worker events.
|
static void |
deregisterWidget(int wid)
Deregister the specified widget for mouse events.
|
static org.roaringbitmap.RoaringBitmap |
getCachedActions(int wid,
java.util.function.Supplier<org.roaringbitmap.RoaringBitmap> calc)
Get the cached mouse actions for this widget.
|
static org.roaringbitmap.RoaringBitmap |
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.
|
private static boolean |
handleMouseEventIfMovable(Widget<GuiOutputManager> source,
java.awt.event.MouseEvent evt)
Handle mouse events for movable widgets.
|
private static boolean |
handleMouseEventIfSelectable(Widget<GuiOutputManager> source,
java.awt.event.MouseEvent evt)
Handle mouse events for selectable widgets.
|
private static boolean |
isMouseClickEvent(java.awt.event.MouseEvent evt)
When a mouse button is clicked 3 events MOUSE_CLICKED, MOUSE_PRESSED and MOUSE_RELEASED are generated.
|
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 |
performAction(WidgetId id,
java.awt.event.MouseEvent evt,
java.util.function.Consumer<MouseDirectManipulation> mouseAction)
Use a specific callback over all mouse direct manipulation registered actions.
|
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 CentralLogger LOG
private static final MouseHandler.ContextContainer local
protected EmulatedWindowState ews
protected final ThinClient tc
ThinClient.public MouseHandler()
public static org.roaringbitmap.RoaringBitmap getCachedActions(int wid,
java.util.function.Supplier<org.roaringbitmap.RoaringBitmap> calc)
wid - The widget's ID.calc - The resolver for the widget's mouse actions, if not cached.public static boolean captureMouseEvents(boolean state)
state - true to capture mouse events, false to ignore them.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.private static boolean handleMouseEventIfMovable(Widget<GuiOutputManager> source, java.awt.event.MouseEvent evt)
source - Widgetevt - Mouse eventtrue iv event has been consumed false if not.private static boolean handleMouseEventIfSelectable(Widget<GuiOutputManager> source, java.awt.event.MouseEvent evt)
source - Widgetevt - Mouse eventtrue iv event has been consumed false if not.private static void performAction(WidgetId id, java.awt.event.MouseEvent evt, java.util.function.Consumer<MouseDirectManipulation> mouseAction)
id - Widget IDevt - Mouse eventmouseAction - The callback which should be fired.private static boolean isMouseClickEvent(java.awt.event.MouseEvent evt)
evt - mouse event.true if is a mouse click false if not.public static org.roaringbitmap.RoaringBitmap getWidgetActions(int widgetId)
event IDs for all actions registered with the
specified widget.widgetId - The widget ID.protected static void applyMouseEvent(Widget<GuiOutputManager> mouseSource, java.awt.event.MouseEvent evt)
mouseSource - The mouse source.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.MouseListenermouseClicked in class java.awt.event.MouseAdaptere - 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.MouseListenermousePressed in class java.awt.event.MouseAdaptere - 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.MouseMotionListenermouseDragged in class java.awt.event.MouseAdaptere - 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.MouseListenermouseReleased in class java.awt.event.MouseAdaptere - 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.MouseListenermouseExited in class java.awt.event.MouseAdaptere - 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.MouseListenermouseEntered in class java.awt.event.MouseAdaptere - 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.MouseMotionListenermouseMoved in class java.awt.event.MouseAdaptere - 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.MouseWheelListenermouseWheelMoved in class java.awt.event.MouseAdaptere - The mouse event.protected static boolean canProcessMouse(java.awt.event.MouseEvent evt)