Top Description Fields Constructors Methods
org.eclipse.swt.events

public Class MouseEvent

extends TypedEvent
Class Inheritance
Known Direct Subclasses
org.eclipse.swt.events.DragDetectEvent
Imports
org.eclipse.swt.widgets.*

Instances of this class are sent whenever mouse related actions occur. This includes mouse buttons being pressed and released, the mouse pointer being moved and the mouse pointer crossing widget boundaries.

Note

The button field is an integer that represents the mouse button number. This is not the same as the SWT mask constants BUTTONx.

See Also
MouseListener, MouseMoveListener, MouseTrackListener, Sample code and further information

Field Summary

Modifier and TypeField and Description
public int
button

the button that was pressed or released;

  • 1 for the first button (usually 'left')
  • 2 for the second button (usually 'middle')
  • 3 for the third button (usually 'right')
  • etc.
public int
count

the number times the mouse has been clicked, as defined by the operating system; 1 for the first click, 2 for the second click and so on.

pack-priv static final long
public int
stateMask

the state of the keyboard modifier keys and mouse masks at the time the event was generated.

public int
x

the widget-relative, x coordinate of the pointer at the time the mouse button was pressed or released

public int
y

the widget-relative, y coordinate of the pointer at the time the mouse button was pressed or released

Inherited from org.eclipse.swt.events.TypedEvent:
datadisplaytimewidget

Constructor Summary

AccessConstructor and Description
public
MouseEvent(Event
the untyped event containing the information
e
)

Constructs a new instance of this class based on the information in the given untyped event.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

a string representation of the event
toString
()

Overrides org.eclipse.swt.events.TypedEvent.toString.

Returns a string containing a concise, human-readable description of the receiver.
Inherited from org.eclipse.swt.events.TypedEvent:
getName

Field Detail

buttonback to summary
public int button

the button that was pressed or released;

  • 1 for the first button (usually 'left')
  • 2 for the second button (usually 'middle')
  • 3 for the third button (usually 'right')
  • etc.
countback to summary
public int count

the number times the mouse has been clicked, as defined by the operating system; 1 for the first click, 2 for the second click and so on.

Since
3.3
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides org.eclipse.swt.events.TypedEvent.serialVersionUID.

stateMaskback to summary
public int stateMask

the state of the keyboard modifier keys and mouse masks at the time the event was generated.

See Also
org.eclipse.swt.SWT#MODIFIER_MASK, org.eclipse.swt.SWT#BUTTON_MASK
xback to summary
public int x

the widget-relative, x coordinate of the pointer at the time the mouse button was pressed or released

yback to summary
public int y

the widget-relative, y coordinate of the pointer at the time the mouse button was pressed or released

Constructor Detail

MouseEventback to summary
public MouseEvent(Event e)

Constructs a new instance of this class based on the information in the given untyped event.

Parameters
e:Event

the untyped event containing the information

Method Detail

toStringback to summary
public String toString()

Overrides org.eclipse.swt.events.TypedEvent.toString.

Returns a string containing a concise, human-readable description of the receiver.

Returns:String

a string representation of the event

Annotations
@Override