Interface WidgetAction
- All Known Implementing Classes:
WidgetAction.Adapter
,WidgetAction.Chain
,WidgetAction.LockedAdapter
public interface WidgetAction
This interface is defining an action that is usually assigned to a widget. The action is notified about all Swing events
related to the widget where the action is assigned.
Events: mouse, mouse-motion, mouse-wheel, drag'n'drop, focus, keyboard.
Each event handler has to return a state of the event processing (represented by WidgetAction.State).
Each Swing event is processed by all actions of all widgets in a scene. The processing can be stopped by consuming the event. When processing event for a widget, then all children widget (from the last) of widget are asked for processing first. Then finally the event is processed by all actions (from the first to the last) assigned to the widget.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
An adapter of the widget action.static final class
Represents a chain of widget actions.static class
An adapter of the widget action.static class
Represents a state of event processing.static final class
Represents a drop target drag event.static final class
Represents a drop target drop event.static final class
Represents a drop target event.static interface
Represents an widget event.static final class
Represents a focus event of a scene view.static final class
Represents a key event.static interface
Represents an location event used for controlling mouse location.static final class
Represents a mouse event.static final class
-
Method Summary
Modifier and TypeMethodDescriptiondragEnter
(Widget widget, WidgetAction.WidgetDropTargetDragEvent event) Called for handling a dragEnter event.dragExit
(Widget widget, WidgetAction.WidgetDropTargetEvent event) Called for handling a dragExit event.dragOver
(Widget widget, WidgetAction.WidgetDropTargetDragEvent event) Called for handling a dragOver event.drop
(Widget widget, WidgetAction.WidgetDropTargetDropEvent event) Called for handling a drop event.dropActionChanged
(Widget widget, WidgetAction.WidgetDropTargetDragEvent event) Called for handling a dropActionChanged event.focusGained
(Widget widget, WidgetAction.WidgetFocusEvent event) Called for handling a focusGained event.focusLost
(Widget widget, WidgetAction.WidgetFocusEvent event) Called for handling a focusLost event.keyPressed
(Widget widget, WidgetAction.WidgetKeyEvent event) Called for handling a keyPressed event.keyReleased
(Widget widget, WidgetAction.WidgetKeyEvent event) Called for handling a keyReleased event.keyTyped
(Widget widget, WidgetAction.WidgetKeyEvent event) Called for handling a keyTyped event.mouseClicked
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mouseClicked event.mouseDragged
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mouseDragged event.mouseEntered
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mouseEntered event.mouseExited
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mouseExited event.mouseMoved
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mouseMoved event.mousePressed
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mousePressed event.mouseReleased
(Widget widget, WidgetAction.WidgetMouseEvent event) Called for handling a mouseReleased event.mouseWheelMoved
(Widget widget, WidgetAction.WidgetMouseWheelEvent event) Called for handling a mouseWheelMoved event.
-
Method Details
-
mouseClicked
Called for handling a mouseClicked event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mousePressed
Called for handling a mousePressed event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mouseReleased
Called for handling a mouseReleased event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mouseEntered
Called for handling a mouseEntered event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mouseExited
Called for handling a mouseExited event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mouseDragged
Called for handling a mouseDragged event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mouseMoved
Called for handling a mouseMoved event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse event- Returns:
- the event state
-
mouseWheelMoved
Called for handling a mouseWheelMoved event.- Parameters:
widget
- the widget where the action is assignedevent
- the mouse wheel event- Returns:
- the event state
-
keyTyped
Called for handling a keyTyped event.- Parameters:
widget
- the widget where the action is assignedevent
- the key event- Returns:
- the event state
-
keyPressed
Called for handling a keyPressed event.- Parameters:
widget
- the widget where the action is assignedevent
- the key event- Returns:
- the event state
-
keyReleased
Called for handling a keyReleased event.- Parameters:
widget
- the widget where the action is assignedevent
- the key event- Returns:
- the event state
-
focusGained
Called for handling a focusGained event.- Parameters:
widget
- the widget where the action is assignedevent
- the focus event- Returns:
- the event state
-
focusLost
Called for handling a focusLost event.- Parameters:
widget
- the widget where the action is assignedevent
- the focus event- Returns:
- the event state
-
dragEnter
Called for handling a dragEnter event.- Parameters:
widget
- the widget where the action is assignedevent
- the drop target drag event- Returns:
- the event state
-
dragOver
Called for handling a dragOver event.- Parameters:
widget
- the widget where the action is assignedevent
- the drop target drag event- Returns:
- the event state
-
dropActionChanged
Called for handling a dropActionChanged event.- Parameters:
widget
- the widget where the action is assignedevent
- the drop target drag event- Returns:
- the event state
-
dragExit
Called for handling a dragExit event.- Parameters:
widget
- the widget where the action is assignedevent
- the drop target event- Returns:
- the event state
-
drop
Called for handling a drop event.- Parameters:
widget
- the widget where the action is assignedevent
- the drop target drop event- Returns:
- the event state
-