Package org.eclipse.draw2d
Class SWTEventDispatcher
java.lang.Object
org.eclipse.draw2d.EventDispatcher
org.eclipse.draw2d.SWTEventDispatcher
The SWTEventDispatcher provides draw2d with the ability to dispatch SWT
 Events. The 
LightweightSystem adds SWT event
 listeners on its Canvas. When the Canvas receives an SWT event, it calls the
 appropriate dispatcher method in SWTEventDispatcher.- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classImplementsEventDispatcher.AccessibilityDispatcherbut does nothing in the implementation.Nested classes/interfaces inherited from class org.eclipse.draw2d.EventDispatcherEventDispatcher.AccessibilityDispatcher
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intDeprecated.protected ControlThe control this dispatcher is listening to.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidDispatches a focus gained event.voidDispatches a focus lost event.voidDispatches a key pressed event.voidDispatches a key released event.voidDispatches a key traversed event.voidDispatches a mouse double clicked event.voidDispatches a mouse entered event.voidDispatches a mouse exited event.voidDispatches a mouse hover event.voidDispatches a moved event event.voidDispatches a mouse pressed event.voidDispatches a mouse released event.voidDispatches a MouseWheel event.protected EventDispatcher.AccessibilityDispatcherReturns the AccessibilityDispatcher.protected MouseEventReturns the current mouse event.protected IFigureReturns the figure that the cursor is over.Returns the IFigure that currently has focus.protected final FocusTraverseManagerReturns the FocusTraverseManager which is used to determine which figure will get focus when a TAB or ALT+TAB key sequence occurs.protected IFigureReturns the figure that is the target of mouse events.protected IFiguregetRoot()Returns the root figure for this dispatcher.protected ToolTipHelperReturns the ToolTipHelper used to display tooltips on hover events.booleanprotected voidReleases capture initiated byEventDispatcher.setCapture(IFigure).voidrequestFocus(IFigure fig) Requests focus for the given figure.voidRequests focus to be removed from the given figure.protected voidsetCapture(IFigure figure) Sets capture to the given figure.voidSets the contol associated with this event dispatcher.protected voidSets the mouse cursor.voidsetEnableKeyTraversal(boolean traverse) Enables key traversal via TAB and ALT+TAB if traverse istrue.protected voidSets the figure under the mouse cursor.protected voidSets the focus figure.protected voidsetHoverSource(Figure figure, MouseEvent me) Sets the figure that the mouse cursor is hovering over.protected voidsetMouseTarget(IFigure figure) Sets the given figure to be the target of future mouse events.voidSets the root figure for this dispatcher.protected voidUpdates the cursor.protected voidUpdates the figure under the cursor, unless the mouse is captured, in which case all mouse events will be routed to the figure that captured the mouse.protected voidUpdates the figure that will receive hover events.
- 
Field Details- 
ANY_BUTTONDeprecated.UseSWT.BUTTON_MASKinstead.Used to tell if any button is pressed without regard to the specific button.
- 
controlThe control this dispatcher is listening to.
 
- 
- 
Constructor Details- 
SWTEventDispatcherpublic SWTEventDispatcher()
 
- 
- 
Method Details- 
dispatchFocusGainedDescription copied from class:EventDispatcherDispatches a focus gained event.- Specified by:
- dispatchFocusGainedin class- EventDispatcher
- Parameters:
- e- the event
- See Also:
 
- 
dispatchFocusLostDescription copied from class:EventDispatcherDispatches a focus lost event.- Specified by:
- dispatchFocusLostin class- EventDispatcher
- Parameters:
- e- the event
- See Also:
 
- 
dispatchKeyPressedDescription copied from class:EventDispatcherDispatches a key pressed event.- Specified by:
- dispatchKeyPressedin class- EventDispatcher
- Parameters:
- e- the event
- See Also:
 
- 
dispatchKeyReleasedDescription copied from class:EventDispatcherDispatches a key released event.- Specified by:
- dispatchKeyReleasedin class- EventDispatcher
- Parameters:
- e- the event
- See Also:
 
- 
dispatchKeyTraversedDescription copied from class:EventDispatcherDispatches a key traversed event.- Specified by:
- dispatchKeyTraversedin class- EventDispatcher
- Parameters:
- e- the event
- See Also:
 
- 
dispatchMouseHoverDescription copied from class:EventDispatcherDispatches a mouse hover event.- Specified by:
- dispatchMouseHoverin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMouseDoubleClickedDescription copied from class:EventDispatcherDispatches a mouse double clicked event.- Specified by:
- dispatchMouseDoubleClickedin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMouseEnteredDescription copied from class:EventDispatcherDispatches a mouse entered event.- Specified by:
- dispatchMouseEnteredin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMouseExitedDescription copied from class:EventDispatcherDispatches a mouse exited event.- Specified by:
- dispatchMouseExitedin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMousePressedDescription copied from class:EventDispatcherDispatches a mouse pressed event.- Specified by:
- dispatchMousePressedin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMouseMovedDescription copied from class:EventDispatcherDispatches a moved event event.- Specified by:
- dispatchMouseMovedin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMouseReleasedDescription copied from class:EventDispatcherDispatches a mouse released event.- Specified by:
- dispatchMouseReleasedin class- EventDispatcher
- Parameters:
- me- the event
- See Also:
 
- 
dispatchMouseWheelScrolledDescription copied from class:EventDispatcherDispatches a MouseWheel event. Does nothing by default.- Overrides:
- dispatchMouseWheelScrolledin class- EventDispatcher
- Parameters:
- e- the SWT event
- See Also:
 
- 
getAccessibilityDispatcherDescription copied from class:EventDispatcherReturns the AccessibilityDispatcher.- Specified by:
- getAccessibilityDispatcherin class- EventDispatcher
- Returns:
- the AccessibilityDispatcher
- See Also:
 
- 
getCurrentEventReturns the current mouse event.- Returns:
- the current mouse event; can be null
 
- 
getCursorTargetReturns the figure that the cursor is over.- Returns:
- the cursor target
 
- 
getToolTipHelperReturns the ToolTipHelper used to display tooltips on hover events.- Returns:
- the ToolTipHelper
 
- 
getFocusTraverseManagerReturns the FocusTraverseManager which is used to determine which figure will get focus when a TAB or ALT+TAB key sequence occurs.- Returns:
- the FocusTraverseManager
 
- 
getFocusOwnerDescription copied from class:EventDispatcherReturns the IFigure that currently has focus.- Specified by:
- getFocusOwnerin class- EventDispatcher
- Returns:
- the IFigure that currently has focus
- Since:
- 3.6
- See Also:
 
- 
getMouseTargetReturns the figure that is the target of mouse events. This may not be the figure beneath the cursor because another figure may have captured the mouse and will continue to get mouse events until capture is released.- Returns:
- the mouse target
 
- 
getRootReturns the root figure for this dispatcher.- Returns:
- the root figure
 
- 
isCapturedpublic boolean isCaptured()- Specified by:
- isCapturedin class- EventDispatcher
- Returns:
- whether events are captured by a figure
- See Also:
 
- 
releaseCaptureprotected void releaseCapture()Description copied from class:EventDispatcherReleases capture initiated byEventDispatcher.setCapture(IFigure).- Specified by:
- releaseCapturein class- EventDispatcher
- See Also:
 
- 
requestFocusDescription copied from class:EventDispatcherRequests focus for the given figure.- Specified by:
- requestFocusin class- EventDispatcher
- Parameters:
- fig- the figure requesting focus
- See Also:
 
- 
requestRemoveFocusDescription copied from class:EventDispatcherRequests focus to be removed from the given figure.- Specified by:
- requestRemoveFocusin class- EventDispatcher
- Parameters:
- fig- the figure requesting focus be removed
- See Also:
 
- 
setCaptureDescription copied from class:EventDispatcherSets capture to the given figure. All subsequent events will be sent to the given figure untilEventDispatcher.releaseCapture()is called.- Specified by:
- setCapturein class- EventDispatcher
- Parameters:
- figure- the figure capturing the events
- See Also:
 
- 
setControlDescription copied from class:EventDispatcherSets the contol associated with this event dispatcher.- Specified by:
- setControlin class- EventDispatcher
- Parameters:
- c- the control
- See Also:
 
- 
setCursorSets the mouse cursor.- Parameters:
- c- the new cursor
 
- 
setEnableKeyTraversalpublic void setEnableKeyTraversal(boolean traverse) Enables key traversal via TAB and ALT+TAB if traverse istrue. Disables it otherwise.- Parameters:
- traverse- whether key traversal should be enabled
 
- 
setFigureUnderCursorSets the figure under the mouse cursor.- Parameters:
- f- the new figure under the cursor
 
- 
setFocusSets the focus figure. If the figure currently with focus is notnull,IFigure.handleFocusLost(FocusEvent)is called on the current focused figure. If the new focus figure is notnull, this will callIFigure.handleFocusGained(FocusEvent)on the new focused figure.- Parameters:
- fig- the new focus figure
 
- 
setHoverSourceSets the figure that the mouse cursor is hovering over.- Parameters:
- figure- the new hover source
- me- the mouse event
 
- 
setMouseTargetSets the given figure to be the target of future mouse events.- Parameters:
- figure- the new mouse target
 
- 
setRootDescription copied from class:EventDispatcherSets the root figure for this dispatcher.- Specified by:
- setRootin class- EventDispatcher
- Parameters:
- figure- the root figure
- See Also:
 
- 
updateCursorprotected void updateCursor()Description copied from class:EventDispatcherUpdates the cursor.- Specified by:
- updateCursorin class- EventDispatcher
- See Also:
 
- 
updateFigureUnderCursorUpdates the figure under the cursor, unless the mouse is captured, in which case all mouse events will be routed to the figure that captured the mouse.- Parameters:
- me- the mouse event
 
- 
updateHoverSourceUpdates the figure that will receive hover events. The hover source must have a tooltip. If the figure under the mouse doesn't have a tooltip set, this method will walk up the ancestor hierarchy until either a figure with a tooltip is found or it gets to the root figure.- Parameters:
- me- the mouse event
 
 
- 
SWT.BUTTON_MASKinstead.