org.gnu.gtk.event

Class MouseEvent

public class MouseEvent extends GtkEvent

This event represents mouse events.

See Also: MouseListener

Nested Class Summary
static classMouseEvent.Type
Field Summary
static intBUTTON1
static intBUTTON2
static intBUTTON3
static intDOUBLE_CLICK
static intSINGLE_CLICK
static intTRIPLE_CLICK
static intTRIPPLE_CLICK
Constructor Summary
MouseEvent(Object source, MouseEvent.Type type, EventButton gdkEvent)
Construct a LifeCycleEvent object for the BUTTON event.
MouseEvent(Object source, MouseEvent.Type type, EventScroll gdkEvent)
Construct a LifeCycleEvent object for the WHEEL_SCROLL event.
MouseEvent(Object source, MouseEvent.Type type, EventCrossing gdkEvent)
Construct a LifeCycleEvent object for the ENTER and LEAVE event.
Method Summary
intgetButtonPressed()
Returns the buttonPressed.
intgetClickType()
Returns the click type (single, double, triple).
ScrollDirectiongetDirection()
Returns the direction.
ModifierTypegetModifierKey()
Returns the modifier key used.
WindowgetWindow()
doublegetX()
Returns the x.
doublegetY()
Returns the y.
booleanisOfType(MouseEvent.Type test)
Test to compare events.

Field Detail

BUTTON1

public static final int BUTTON1

BUTTON2

public static final int BUTTON2

BUTTON3

public static final int BUTTON3

DOUBLE_CLICK

public static final int DOUBLE_CLICK

SINGLE_CLICK

public static final int SINGLE_CLICK

TRIPLE_CLICK

public static final int TRIPLE_CLICK

TRIPPLE_CLICK

public static final int TRIPPLE_CLICK

Deprecated:

Constructor Detail

MouseEvent

public MouseEvent(Object source, MouseEvent.Type type, EventButton gdkEvent)
Construct a LifeCycleEvent object for the BUTTON event.

MouseEvent

public MouseEvent(Object source, MouseEvent.Type type, EventScroll gdkEvent)
Construct a LifeCycleEvent object for the WHEEL_SCROLL event.

MouseEvent

public MouseEvent(Object source, MouseEvent.Type type, EventCrossing gdkEvent)
Construct a LifeCycleEvent object for the ENTER and LEAVE event.

Method Detail

getButtonPressed

public int getButtonPressed()
Returns the buttonPressed.

Returns: int

getClickType

public int getClickType()
Returns the click type (single, double, triple). The return value should be compared against one of the constants included in this class (SINGLE_CLICK, DOUBLE_CLICK, or TRIPLE_CLICK).

getDirection

public ScrollDirection getDirection()
Returns the direction.

Returns: ScrollDirection

getModifierKey

public ModifierType getModifierKey()
Returns the modifier key used.

Returns: (see ModifierType)

getWindow

public Window getWindow()

getX

public double getX()
Returns the x.

Returns: double

getY

public double getY()
Returns the y.

Returns: double

isOfType

public boolean isOfType(MouseEvent.Type test)
Test to compare events.