public class SWTEventDispatcher extends EventDispatcher
LightweightSystem adds SWT event
listeners on its Canvas. When the Canvas receives an SWT event, it calls the
appropriate dispatcher method in SWTEventDispatcher.| Modifier and Type | Class and Description |
|---|---|
protected class |
SWTEventDispatcher.FigureAccessibilityDispatcher
Implements
EventDispatcher.AccessibilityDispatcher but does
nothing in the implementation. |
EventDispatcher.AccessibilityDispatcher| Modifier and Type | Field and Description |
|---|---|
protected static int |
ANY_BUTTON
Deprecated.
Use
SWT.BUTTON_MASK instead. |
protected Control |
control
The control this dispatcher is listening to.
|
| Constructor and Description |
|---|
SWTEventDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispatchFocusGained(FocusEvent e)
Dispatches a focus gained event.
|
void |
dispatchFocusLost(FocusEvent e)
Dispatches a focus lost event.
|
void |
dispatchKeyPressed(KeyEvent e)
Dispatches a key pressed event.
|
void |
dispatchKeyReleased(KeyEvent e)
Dispatches a key released event.
|
void |
dispatchKeyTraversed(TraverseEvent e)
Dispatches a key traversed event.
|
void |
dispatchMouseDoubleClicked(MouseEvent me)
Dispatches a mouse double clicked event.
|
void |
dispatchMouseEntered(MouseEvent me)
Dispatches a mouse entered event.
|
void |
dispatchMouseExited(MouseEvent me)
Dispatches a mouse exited event.
|
void |
dispatchMouseHover(MouseEvent me)
Dispatches a mouse hover event.
|
void |
dispatchMouseMoved(MouseEvent me)
Dispatches a moved event event.
|
void |
dispatchMousePressed(MouseEvent me)
Dispatches a mouse pressed event.
|
void |
dispatchMouseReleased(MouseEvent me)
Dispatches a mouse released event.
|
protected EventDispatcher.AccessibilityDispatcher |
getAccessibilityDispatcher()
Returns the AccessibilityDispatcher.
|
protected MouseEvent |
getCurrentEvent()
Returns the current mouse event.
|
protected IFigure |
getCursorTarget()
Returns the figure that the cursor is over.
|
IFigure |
getFocusOwner()
Returns the IFigure that currently has focus.
|
protected FocusTraverseManager |
getFocusTraverseManager()
Returns the FocusTraverseManager which is used to determine which figure
will get focus when a TAB or ALT+TAB key sequence occurs.
|
protected IFigure |
getMouseTarget()
Returns the figure that is the target of mouse events.
|
protected IFigure |
getRoot()
Returns the root figure for this dispatcher.
|
protected ToolTipHelper |
getToolTipHelper()
Returns the ToolTipHelper used to display tooltips on hover events.
|
boolean |
isCaptured() |
protected void |
releaseCapture()
Releases capture initiated by
EventDispatcher.setCapture(IFigure). |
void |
requestFocus(IFigure fig)
Requests focus for the given figure.
|
void |
requestRemoveFocus(IFigure fig)
Requests focus to be removed from the given figure.
|
protected void |
setCapture(IFigure figure)
Sets capture to the given figure.
|
void |
setControl(Control c)
Sets the contol associated with this event dispatcher.
|
protected void |
setCursor(Cursor c)
Sets the mouse cursor.
|
void |
setEnableKeyTraversal(boolean traverse)
Enables key traversal via TAB and ALT+TAB if traverse is
true. |
protected void |
setFigureUnderCursor(IFigure f)
Sets the figure under the mouse cursor.
|
protected void |
setFocus(IFigure fig)
Sets the focus figure.
|
protected void |
setHoverSource(Figure figure,
MouseEvent me)
Sets the figure that the mouse cursor is hovering over.
|
protected void |
setMouseTarget(IFigure figure)
Sets the given figure to be the target of future mouse events.
|
void |
setRoot(IFigure figure)
Sets the root figure for this dispatcher.
|
protected void |
updateCursor()
Updates the cursor.
|
protected void |
updateFigureUnderCursor(MouseEvent me)
Updates 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 void |
updateHoverSource(MouseEvent me)
Updates the figure that will receive hover events.
|
dispatchMouseWheelScrolledprotected static final int ANY_BUTTON
SWT.BUTTON_MASK instead.protected Control control
public void dispatchFocusGained(FocusEvent e)
EventDispatcherdispatchFocusGained in class EventDispatchere - the eventEventDispatcher.dispatchFocusGained(org.eclipse.swt.events.FocusEvent)public void dispatchFocusLost(FocusEvent e)
EventDispatcherdispatchFocusLost in class EventDispatchere - the eventEventDispatcher.dispatchFocusLost(org.eclipse.swt.events.FocusEvent)public void dispatchKeyPressed(KeyEvent e)
EventDispatcherdispatchKeyPressed in class EventDispatchere - the eventEventDispatcher.dispatchKeyPressed(org.eclipse.swt.events.KeyEvent)public void dispatchKeyReleased(KeyEvent e)
EventDispatcherdispatchKeyReleased in class EventDispatchere - the eventEventDispatcher.dispatchKeyReleased(org.eclipse.swt.events.KeyEvent)public void dispatchKeyTraversed(TraverseEvent e)
EventDispatcherdispatchKeyTraversed in class EventDispatchere - the eventEventDispatcher.dispatchKeyTraversed(TraverseEvent)public void dispatchMouseHover(MouseEvent me)
EventDispatcherdispatchMouseHover in class EventDispatcherme - the eventEventDispatcher.dispatchMouseHover(org.eclipse.swt.events.MouseEvent)public void dispatchMouseDoubleClicked(MouseEvent me)
EventDispatcherdispatchMouseDoubleClicked in class EventDispatcherme - the eventEventDispatcher.dispatchMouseDoubleClicked(org.eclipse.swt.events.MouseEvent)public void dispatchMouseEntered(MouseEvent me)
EventDispatcherdispatchMouseEntered in class EventDispatcherme - the eventEventDispatcher.dispatchMouseEntered(org.eclipse.swt.events.MouseEvent)public void dispatchMouseExited(MouseEvent me)
EventDispatcherdispatchMouseExited in class EventDispatcherme - the eventEventDispatcher.dispatchMouseExited(org.eclipse.swt.events.MouseEvent)public void dispatchMousePressed(MouseEvent me)
EventDispatcherdispatchMousePressed in class EventDispatcherme - the eventEventDispatcher.dispatchMousePressed(org.eclipse.swt.events.MouseEvent)public void dispatchMouseMoved(MouseEvent me)
EventDispatcherdispatchMouseMoved in class EventDispatcherme - the eventEventDispatcher.dispatchMouseMoved(org.eclipse.swt.events.MouseEvent)public void dispatchMouseReleased(MouseEvent me)
EventDispatcherdispatchMouseReleased in class EventDispatcherme - the eventEventDispatcher.dispatchMouseReleased(org.eclipse.swt.events.MouseEvent)protected EventDispatcher.AccessibilityDispatcher getAccessibilityDispatcher()
EventDispatchergetAccessibilityDispatcher in class EventDispatcherEventDispatcher.getAccessibilityDispatcher()protected MouseEvent getCurrentEvent()
nullprotected IFigure getCursorTarget()
protected ToolTipHelper getToolTipHelper()
protected final FocusTraverseManager getFocusTraverseManager()
public IFigure getFocusOwner()
EventDispatchergetFocusOwner in class EventDispatcherEventDispatcher.getFocusOwner()protected IFigure getMouseTarget()
protected IFigure getRoot()
public boolean isCaptured()
isCaptured in class EventDispatcherEventDispatcher.isCaptured()protected void releaseCapture()
EventDispatcherEventDispatcher.setCapture(IFigure).releaseCapture in class EventDispatcherEventDispatcher.releaseCapture()public void requestFocus(IFigure fig)
EventDispatcherrequestFocus in class EventDispatcherfig - the figure requesting focusEventDispatcher.requestFocus(IFigure)public void requestRemoveFocus(IFigure fig)
EventDispatcherrequestRemoveFocus in class EventDispatcherfig - the figure requesting focus be removedEventDispatcher.requestRemoveFocus(IFigure)protected void setCapture(IFigure figure)
EventDispatcherEventDispatcher.releaseCapture() is called.setCapture in class EventDispatcherfigure - the figure capturing the eventsEventDispatcher.setCapture(IFigure)public void setControl(Control c)
EventDispatchersetControl in class EventDispatcherc - the controlEventDispatcher.setControl(Control)protected void setCursor(Cursor c)
c - the new cursorpublic void setEnableKeyTraversal(boolean traverse)
true. Disables it otherwise.traverse - whether key traversal should be enabledprotected void setFigureUnderCursor(IFigure f)
f - the new figure under the cursorprotected void setFocus(IFigure fig)
null, IFigure.handleFocusLost(FocusEvent) is called
on the current focused figure. If the new focus figure is not
null, this will call
IFigure.handleFocusGained(FocusEvent) on the new focused figure.fig - the new focus figureprotected void setHoverSource(Figure figure, MouseEvent me)
figure - the new hover sourceme - the mouse eventprotected void setMouseTarget(IFigure figure)
figure - the new mouse targetpublic void setRoot(IFigure figure)
EventDispatchersetRoot in class EventDispatcherfigure - the root figureEventDispatcher.setRoot(IFigure)protected void updateCursor()
EventDispatcherupdateCursor in class EventDispatcherEventDispatcher.updateCursor()protected void updateFigureUnderCursor(MouseEvent me)
me - the mouse eventprotected void updateHoverSource(MouseEvent me)
me - the mouse eventCopyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.