Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Draw2d
3.3

org.eclipse.draw2d
Class SWTEventDispatcher

java.lang.Object
  extended by

org.eclipse.draw2d.EventDispatcher
      extended by
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.


Nested Class Summary
protected  class SWTEventDispatcher.FigureAccessibilityDispatcher
          Implements EventDispatcher.AccessibilityDispatcher but does nothing in the implementation.
 
Nested classes inherited from class org.eclipse.draw2d. EventDispatcher
EventDispatcher.AccessibilityDispatcher
 
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.
 
Constructor Summary
SWTEventDispatcher ()
           
 
Method Summary
 void dispatchFocusGained (org.eclipse.swt.events.FocusEvent e)
           
 void dispatchFocusLost (org.eclipse.swt.events.FocusEvent e)
           
 void dispatchKeyPressed (org.eclipse.swt.events.KeyEvent e)
           
 void dispatchKeyReleased (org.eclipse.swt.events.KeyEvent e)
           
 void dispatchKeyTraversed (TraverseEvent e)
          Dispatches a key traversed event.
 void dispatchMouseDoubleClicked (org.eclipse.swt.events.MouseEvent me)
           
 void dispatchMouseEntered (org.eclipse.swt.events.MouseEvent me)
           
 void dispatchMouseExited (org.eclipse.swt.events.MouseEvent me)
           
 void dispatchMouseHover (org.eclipse.swt.events.MouseEvent me)
           
 void dispatchMouseMoved (org.eclipse.swt.events.MouseEvent me)
           
 void dispatchMousePressed (org.eclipse.swt.events.MouseEvent me)
           
 void dispatchMouseReleased (org.eclipse.swt.events.MouseEvent me)
           
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.
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 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, org.eclipse.swt.events.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 (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.
protected  void updateHoverSource (org.eclipse.swt.events.MouseEvent me)
          Updates the figure that will receive hover events.
 
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
 

Field Detail

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.

Constructor Detail

SWTEventDispatcher

public SWTEventDispatcher()
Method Detail

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

Eclipse Draw2d
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire