org.eclipse.draw2d
Class SWTEventDispatcher
java.lang.Object
org.eclipse.draw2d.EventDispatcher
org.eclipse.draw2d.SWTEventDispatcher
- public class SWTEventDispatcher
- extends
EventDispatcher
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.
Field Summary
|
protected static int
|
ANY_BUTTON
Deprecated. Use SWT#BUTTON_MASK instead.
|
protected org.eclipse.swt.widgets.Control
|
control
The control this dispatcher is listening to. |
Methods inherited from class org.eclipse.draw2d.
EventDispatcher
|
dispatchFocusGained,
dispatchFocusLost,
dispatchKeyPressed,
dispatchKeyReleased,
dispatchMouseDoubleClicked,
dispatchMouseEntered,
dispatchMouseExited,
dispatchMouseHover,
dispatchMouseMoved,
dispatchMousePressed,
dispatchMouseReleased,
dispatchMouseWheelScrolled
|
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
ANY_BUTTON
protected static final int ANY_BUTTON
-
Deprecated. Use
SWT#BUTTON_MASK
instead.
- Used to tell if any button is pressed without regard to the specific button.
control
protected org.eclipse.swt.widgets.Control control
- The control this dispatcher is listening to.
SWTEventDispatcher
public SWTEventDispatcher()
dispatchFocusGained
public void dispatchFocusGained(org.eclipse.swt.events.FocusEvent e)
-
-
Specified by:
-
dispatchFocusGained
in class
EventDispatcher
-
-
Parameters:
-
e
- the event -
See Also:
-
EventDispatcher#dispatchFocusGained(org.eclipse.swt.events.FocusEvent)
dispatchFocusLost
public void dispatchFocusLost(org.eclipse.swt.events.FocusEvent e)
-
-
Specified by:
-
dispatchFocusLost
in class
EventDispatcher
-
-
Parameters:
-
e
- the event -
See Also:
-
EventDispatcher#dispatchFocusLost(org.eclipse.swt.events.FocusEvent)
dispatchKeyPressed
public void dispatchKeyPressed(org.eclipse.swt.events.KeyEvent e)
-
-
Specified by:
-
dispatchKeyPressed
in class
EventDispatcher
-
-
Parameters:
-
e
- the event -
See Also:
-
EventDispatcher#dispatchKeyPressed(org.eclipse.swt.events.KeyEvent)
dispatchKeyReleased
public void dispatchKeyReleased(org.eclipse.swt.events.KeyEvent e)
-
-
Specified by:
-
dispatchKeyReleased
in class
EventDispatcher
-
-
Parameters:
-
e
- the event -
See Also:
-
EventDispatcher#dispatchKeyReleased(org.eclipse.swt.events.KeyEvent)
dispatchKeyTraversed
public void dispatchKeyTraversed(TraverseEvent e)
-
Description copied from class:
EventDispatcher
- Dispatches a key traversed event.
-
-
Specified by:
-
dispatchKeyTraversed
in class
EventDispatcher
-
-
Parameters:
-
e
- the event -
See Also:
-
EventDispatcher.dispatchKeyTraversed(TraverseEvent)
dispatchMouseHover
public void dispatchMouseHover(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMouseHover
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMouseHover(org.eclipse.swt.events.MouseEvent)
dispatchMouseDoubleClicked
public void dispatchMouseDoubleClicked(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMouseDoubleClicked
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMouseDoubleClicked(org.eclipse.swt.events.MouseEvent)
dispatchMouseEntered
public void dispatchMouseEntered(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMouseEntered
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMouseEntered(org.eclipse.swt.events.MouseEvent)
dispatchMouseExited
public void dispatchMouseExited(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMouseExited
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMouseExited(org.eclipse.swt.events.MouseEvent)
dispatchMousePressed
public void dispatchMousePressed(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMousePressed
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMousePressed(org.eclipse.swt.events.MouseEvent)
dispatchMouseMoved
public void dispatchMouseMoved(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMouseMoved
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMouseMoved(org.eclipse.swt.events.MouseEvent)
dispatchMouseReleased
public void dispatchMouseReleased(org.eclipse.swt.events.MouseEvent me)
-
-
Specified by:
-
dispatchMouseReleased
in class
EventDispatcher
-
-
Parameters:
-
me
- the event -
See Also:
-
EventDispatcher#dispatchMouseReleased(org.eclipse.swt.events.MouseEvent)
getAccessibilityDispatcher
protected
EventDispatcher.AccessibilityDispatcher getAccessibilityDispatcher()
-
Description copied from class:
EventDispatcher
- Returns the AccessibilityDispatcher.
-
-
Specified by:
-
getAccessibilityDispatcher
in class
EventDispatcher
-
-
Returns:
- the AccessibilityDispatcher
-
See Also:
-
EventDispatcher.getAccessibilityDispatcher()
getCurrentEvent
protected
MouseEvent getCurrentEvent()
- Returns the current mouse event.
-
-
Returns:
- the current mouse event; can be
null
getCursorTarget
protected
IFigure getCursorTarget()
- Returns the figure that the cursor is over.
-
-
Returns:
- the cursor target
getToolTipHelper
protected
ToolTipHelper getToolTipHelper()
- Returns the ToolTipHelper used to display tooltips on hover events.
-
-
Returns:
- the ToolTipHelper
getFocusTraverseManager
protected final
FocusTraverseManager getFocusTraverseManager()
- Returns the FocusTraverseManager which is used to determine which figure will get focus
when a TAB or ALT+TAB key sequence occurs.
-
-
Returns:
- the FocusTraverseManager
getMouseTarget
protected
IFigure getMouseTarget()
- Returns 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
getRoot
protected
IFigure getRoot()
- Returns the root figure for this dispatcher.
-
-
Returns:
- the root figure
isCaptured
public boolean isCaptured()
-
-
Specified by:
-
isCaptured
in class
EventDispatcher
-
-
Returns:
- whether events are captured by a figure
-
See Also:
-
EventDispatcher.isCaptured()
releaseCapture
protected void releaseCapture()
-
Description copied from class:
EventDispatcher
- Releases capture initiated by
EventDispatcher.setCapture(IFigure)
.
-
-
Specified by:
-
releaseCapture
in class
EventDispatcher
-
-
See Also:
-
EventDispatcher.releaseCapture()
requestFocus
public void requestFocus(
IFigure fig)
-
Description copied from class:
EventDispatcher
- Requests focus for the given figure.
-
-
Specified by:
-
requestFocus
in class
EventDispatcher
-
-
Parameters:
-
fig
- the figure requesting focus -
See Also:
-
EventDispatcher.requestFocus(IFigure)
requestRemoveFocus
public void requestRemoveFocus(
IFigure fig)
-
Description copied from class:
EventDispatcher
- Requests focus to be removed from the given figure.
-
-
Specified by:
-
requestRemoveFocus
in class
EventDispatcher
-
-
Parameters:
-
fig
- the figure requesting focus be removed -
See Also:
-
EventDispatcher.requestRemoveFocus(IFigure)
setCapture
protected void setCapture(
IFigure figure)
-
Description copied from class:
EventDispatcher
- Sets capture to the given figure. All subsequent events will be sent to the given
figure until
EventDispatcher.releaseCapture()
is called.
-
-
Specified by:
-
setCapture
in class
EventDispatcher
-
-
Parameters:
-
figure
- the figure capturing the events -
See Also:
-
EventDispatcher.setCapture(IFigure)
setControl
public void setControl(Control c)
-
Description copied from class:
EventDispatcher
- Sets the contol associated with this event dispatcher.
-
-
Specified by:
-
setControl
in class
EventDispatcher
-
-
Parameters:
-
c
- the control -
See Also:
-
EventDispatcher.setControl(Control)
setCursor
protected void setCursor(Cursor c)
- Sets the mouse cursor.
-
-
Parameters:
-
c
- the new cursor
setEnableKeyTraversal
public void setEnableKeyTraversal(boolean traverse)
- Enables key traversal via TAB and ALT+TAB if traverse is
true
.
Disables it otherwise.
-
-
Parameters:
-
traverse
- whether key traversal should be enabled
setFigureUnderCursor
protected void setFigureUnderCursor(
IFigure f)
- Sets the figure under the mouse cursor.
-
-
Parameters:
-
f
- the new figure under the cursor
setFocus
protected void setFocus(
IFigure fig)
- Sets the focus figure. If the figure currently with focus is not
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.
-
-
Parameters:
-
fig
- the new focus figure
setHoverSource
protected void setHoverSource(
Figure figure,
org.eclipse.swt.events.MouseEvent me)
- Sets the figure that the mouse cursor is hovering over.
-
-
Parameters:
-
figure
- the new hover source -
me
- the mouse event
setMouseTarget
protected void setMouseTarget(
IFigure figure)
- Sets the given figure to be the target of future mouse events.
-
-
Parameters:
-
figure
- the new mouse target
setRoot
public void setRoot(
IFigure figure)
-
Description copied from class:
EventDispatcher
- Sets the root figure for this dispatcher.
-
-
Specified by:
-
setRoot
in class
EventDispatcher
-
-
Parameters:
-
figure
- the root figure -
See Also:
-
EventDispatcher.setRoot(IFigure)
updateCursor
protected void updateCursor()
-
Description copied from class:
EventDispatcher
- Updates the cursor.
-
-
Specified by:
-
updateCursor
in class
EventDispatcher
-
-
See Also:
-
EventDispatcher.updateCursor()
updateFigureUnderCursor
protected void updateFigureUnderCursor(org.eclipse.swt.events.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.
-
-
Parameters:
-
me
- the mouse event
updateHoverSource
protected void updateHoverSource(org.eclipse.swt.events.MouseEvent me)
- Updates 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
Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.